Bug #62677 [Opn->Nab]: preg_match_all: Useless without optional parameters

From: Date: Fri, 27 Jul 2012 16:11:00 +0000
Subject: Bug #62677 [Opn->Nab]: preg_match_all: Useless without optional parameters
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8651@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62677&edit=1 ID: 62677 Updated by: salathe@php.net Reported by: David dot Dvorak at bnv-tech dot cz Summary: preg_match_all: Useless without optional parameters -Status: Open +Status: Not a bug Type: Bug Package: Documentation problem Operating System: ubuntu3.2 PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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]. [1] http://php.net/manual/en/function.preg-match-all.php [2] http://php.net/ChangeLog-5.php#5.4.0 Previous Comments: ------------------------------------------------------------------------ [2012-07-27 14:30:39] rasmus@php.net That's a documentation bug. $matches is not optional in preg_match_all() ------------------------------------------------------------------------ [2012-07-27 13:09:46] David dot Dvorak at bnv-tech dot cz Description: ------------ 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: ---------------- int(4) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=62677&edit=1

« previous php.doc.bugs (#8651) next »