#50306 [NEW]: preg_match_all() example #3 is wrong
| From: | kalle dot v at kolumbus dot fi | Date: | Thu, 26 Nov 2009 06:55:58 +0000 |
| Subject: | #50306 [NEW]: preg_match_all() example #3 is wrong | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-3344@lists.php.net to get a copy of this message | ||
From: kalle dot v at kolumbus dot fi
Operating system: Red Hat
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: preg_match_all() example #3 is wrong
Description:
------------
Similar to Bug #46904 preg_match() example #4 is wrong
(http://bugs.php.net/bug.php?id=46904), but with preg_match_all.
Seems the original issue discussed in the comments of bug #46904 is not
actually related only to PHP version. I have a Red Hat box with PHP 5.2.6
installed but still this doesn't work: (?<name>\w+) and this works:
(?P<name>\w+)
And I had some trouble figuring this one out, since I use preg_match_all
and in the preg_match_all documentation example #3 is similar to the one
that was previously in preg_match example #4. And named subpatterns was
something I hadn't used before, so I didn't know about the different
syntaxes. So I think at least the same comment that was added to preg_match
should be added to preg_match_all documentation so people will know there
are these different syntaxes and they can try them out if they get errors.
But maybe someone should check this again to find out what actually makes
these different syntaxes work with different PHP
versions/machines/operating systems.
--
Edit bug report at http://bugs.php.net/?id=50306&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50306&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50306&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50306&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50306&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50306&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50306&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50306&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50306&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50306&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50306&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50306&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50306&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50306&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50306&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50306&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50306&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50306&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50306&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50306&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50306&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50306&r=mysqlcfg