#46686 [Opn->Bgs]: preg_replace returns NULL
| From: | iliaa@php.net | Date: | Wed, 26 Nov 2008 21:23:32 +0000 |
| Subject: | #46686 [Opn->Bgs]: preg_replace returns NULL | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131375@lists.php.net to get a copy of this message | ||
ID: 46686
Updated by: iliaa@php.net
Reported By: adi_helfenstein at yahoo dot com
-Status: Open
+Status: Bogus
Bug Type: PCRE related
Operating System: Linux (SUSE)
PHP Version: 5.2.6
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
You need to delimit your regular expression.
Previous Comments:
------------------------------------------------------------------------
[2008-11-26 15:09:54] adi_helfenstein at yahoo dot com
Description:
------------
The preg_replace function returns a NULL value on a not NULL input
string. Even if there is no problem with backtrack_limit and
recursion_limit.
The preg_last_error() returns 0.
Reproduce code:
---------------
$search = array("s1"=>"s1"); //In reality the arrays have 3000
entries
$repl = array("s1"=>"S1");
$str = "bla";
$str = preg_replace($search,$repl,$str);
echo $str;
Expected result:
----------------
bla
Actual result:
--------------
NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46686&edit=1