Doc #51568 [NEW]: Incorrect return value description for preg_filter
| From: | bcollecutt at gmail dot com | Date: | Thu, 15 Apr 2010 23:57:32 +0000 |
| Subject: | Doc #51568 [NEW]: Incorrect return value description for preg_filter | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-4202@lists.php.net to get a copy of this message | ||
From:
Operating system:
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Incorrect return value description for preg_filter
Description:
------------
Documentation for preg_filter incorrectly says
"If matches are found, the new subject will be returned, otherwise subject
will be
returned unchanged or NULL if an error occurred."
preg_filter returns NULL if no match is found. Not the unchanged string.
Test script:
---------------
$subject = "this is a test";
$pattern = "/cat/i";
if(is_null(preg_filter($pattern,'dog',$subject)))
echo "null";
else
echo "not null";
Expected result:
----------------
null
Actual result:
--------------
null
--
Edit bug report at http://bugs.php.net/bug.php?id=51568&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51568&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51568&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51568&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51568&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51568&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51568&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51568&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51568&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51568&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51568&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51568&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51568&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51568&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51568&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51568&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51568&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51568&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51568&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51568&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51568&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51568&r=mysqlcfg