From: adi_helfenstein at yahoo dot com Operating system: Linux (SUSE) PHP version: 5.2.6 PHP Bug Type: PCRE related Bug description: preg_replace returns NULL
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 bug report at http://bugs.php.net/?id=46686&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46686&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46686&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46686&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46686&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46686&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46686&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46686&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46686&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46686&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46686&r=support Expected behavior: http://bugs.php.net/fix.php?id=46686&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46686&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46686&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46686&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46686&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46686&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46686&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46686&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46686&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46686&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46686&r=mysqlcfg