Doc #62161 [Opn]: Incorrect definition of return value for preg_match
| From: | googleguy@php.net | Date: | Mon, 30 Jul 2012 02:29:12 +0000 |
| Subject: | Doc #62161 [Opn]: Incorrect definition of return value for preg_match | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-8652@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62161&edit=1
ID: 62161
Updated by: googleguy@php.net
Reported by: stiles dot nathan at gmail dot com
Summary: Incorrect definition of return value for preg_match
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: N/A
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
You're right. I can no see no reason why this shouldn't be the documented
behavior. preg_match() will only ever return 0, 1, or false.
Previous Comments:
------------------------------------------------------------------------
[2012-05-25 17:52:37] stiles dot nathan at gmail dot com
Description:
------------
My suggested definition of preg_match return value...
preg_match returns 1 if a match is found, 0 if no match is found and FALSE if an
error occured.
And take out the info about preg_match_all as it has little to do with the return
value. This function is listed in related so it should be fine.
Expected result:
----------------
Simple definition..."preg_match() returns the number of times pattern matches."...
this statement is TOTALLY false and misleading.
Actual result:
--------------
Border line dark pattern.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62161&edit=1