Doc #54954 [Opn->Fbk]: preg_match() returns zero if an error occurred
| From: | aharvey@php.net | Date: | Tue, 14 Jun 2011 14:36:28 +0000 |
| Subject: | Doc #54954 [Opn->Fbk]: preg_match() returns zero if an error occurred | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-6746@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=54954&edit=1
ID: 54954
Updated by: aharvey@php.net
Reported by: benoit dot chenu at gmail dot com
Summary: preg_match() returns zero if an error occurred
-Status: Open
+Status: Feedback
Type: Documentation Problem
Package: Documentation problem
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
What version of PHP are you getting integer 0 back from preg_match() when the backtrack limit is
hit? Everything I have to hand is returning boolean false, which is what I'd expect.
Previous Comments:
------------------------------------------------------------------------
[2011-05-30 19:34:29] benoit dot chenu at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/manual/en/function.preg-match.php#Return
Values
---
A bug was already opened (#51741) about this but not treated. If an error occurs (like reaching
pcre.backtrack_limit), preg_match doesn't return FALSE as described in the documentation but
returns 0.
It should be nice to update the documentation.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=54954&edit=1