|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62677 preg_match_all: Useless without optional parameters
Submitted: 2012-07-27 13:09 UTC Modified: 2012-07-27 16:11 UTC
From: David dot Dvorak at bnv-tech dot cz Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: ubuntu3.2
Private report: No CVE-ID: None
 [2012-07-27 13:09 UTC] David dot Dvorak at bnv-tech dot cz
The preg_match_all function always returns false if it is used with only mandatory parameters.

Test script:
var_dump(preg_match_all('/[^0-9\.]/', '455asdf'));

Expected result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-27 14:30 UTC]
That's a documentation bug. $matches is not optional in preg_match_all()
 [2012-07-27 14:30 UTC]
-Package: *Regular Expressions +Package: Documentation problem
 [2012-07-27 16:11 UTC]
The behaviour was changed as of 5.4.0, making the third parameter optional.  This 
is clearly noted on the preg_match_all() docs page [1], and in the ChangeLog [2].

 [2012-07-27 16:11 UTC]
-Status: Open +Status: Not a bug
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Jul 27 00:01:25 2021 UTC