#43789 [NEW]: Missing information about preg_replace() returning null
| From: | david at dfoerster dot de | Date: | Tue, 08 Jan 2008 22:22:27 +0000 |
| Subject: | #43789 [NEW]: Missing information about preg_replace() returning null | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-426@lists.php.net to get a copy of this message | ||
From: david at dfoerster dot de
Operating system: Linux
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: Missing information about preg_replace() returning null
Description:
------------
I just filled a bogus bug report about preg_replace() returning
null. (http://bugs.php.net/bug.php?id=43788) I guess this was
introduced with preg_last_error in PHP 5.2 and should be documented.
I guess this applies to other preg_* functions as well.
Reproduce code:
---------------
Read the online documentation to preg_replace.
Expected result:
----------------
Return Values
preg_replace() returns an array if the subject parameter is an
array, or a string otherwise.
If matches are found, the new subject will be returned, otherwise
subject will be returned unchanged. If an error occurs, null (or
false ?) will be returned and the error will be available through
preg_last_error().
Actual result:
--------------
Return Values
preg_replace() returns an array if the subject parameter is an
array, or a string otherwise.
If matches are found, the new subject will be returned, otherwise
subject will be returned unchanged.
--
Edit bug report at http://bugs.php.net/?id=43789&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43789&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43789&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43789&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43789&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43789&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=43789&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43789&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43789&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43789&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43789&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43789&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=43789&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=43789&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43789&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43789&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43789&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43789&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43789&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43789&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43789&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43789&r=mysqlcfg