|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-11-26 15:09 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 10:00:01 2025 UTC |
Ups, i've forgotten the delimiters in the short example above. The same problem happens when i write: $search = array("s1"=>"/s1/");