php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43789 Missing information about preg_replace() returning null
Submitted: 2008-01-08 22:22 UTC Modified: 2008-01-09 00:17 UTC
From: david at dfoerster dot de Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david at dfoerster dot de
New email:
PHP Version: OS:

 

 [2008-01-08 22:22 UTC] david at dfoerster dot de
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-09 00:17 UTC] felipe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 01:01:30 2024 UTC