|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: David dot Dvorak at bnv-tech dot cz
New email:
PHP Version: OS:


 [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: Sun Jul 25 12:01:23 2021 UTC