#49673 [Bgs]: preg_match_all returns false when third arument is omitted
| From: | mfthemon at gmail dot com | Date: | Sat, 26 Sep 2009 11:52:33 +0000 |
| Subject: | #49673 [Bgs]: preg_match_all returns false when third arument is omitted | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-142921@lists.php.net to get a copy of this message | ||
ID: 49673
User updated by: mfthemon at gmail dot com
Reported By: mfthemon at gmail dot com
Status: Bogus
Bug Type: PCRE related
Operating System: win2k7server
PHP Version: 5.3.0
New Comment:
oh, my bad.)
Previous Comments:
------------------------------------------------------------------------
[2009-09-25 21:49:33] jani@php.net
RTFM: "Returns the number of full pattern matches (which might be
zero),
or FALSE if an error occurred."
And might the error perhaps be that the 3rd parameter is NOT optional?
:)
------------------------------------------------------------------------
[2009-09-25 19:22:46] mfthemon at gmail dot com
Description:
------------
preg_match_all doesn't return matches count when the third argument is
omitted.
Reproduce code:
---------------
var_dump(preg_match_all('/b\([\w\W]*?\)/',
'b(2)b(4)b(5)b(8)b(2)b(18)'));
Expected result:
----------------
int(6)
Actual result:
--------------
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49673&edit=1