Req #55051 [NEW]: bag with function str_replace

From: Date: Mon, 13 Jun 2011 22:20:49 +0000
Subject: Req #55051 [NEW]: bag with function str_replace
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-161377@lists.php.net to get a copy of this message
From: Operating system: win 7 PHP version: 5.3.6 Package: PHP options/info functions Bug Type: Feature/Change Request Bug description:bag with function str_replace Description: ------------ hi? im from russian? english is bad so here code with bug <? $a=array("1","2","3","4","5","6","7","8","9","0"); $b=array("9","8","7","6","5","4","3","2","1","0"); $str="1234567890"; echo str_replace($a,$b,$str); ?> ////echo 1234543210 Test script: --------------- <? $a=array("1","2","3","4","5","6","7","8","9","0"); $b=array("9","8","7","6","5","4","3","2","1","0"); $str="1234567890"; echo str_replace($a,$b,$str); ?> must be 0987654321 Expected result: ---------------- <? $a=array("1","2","3","4","5","6","7","8","9","0"); $b=array("9","8","7","6","5","4","3","2","1","0"); $str="1234567890"; echo str_replace($a,$b,$str); ?> Actual result: -------------- <? $a=array("1","2","3","4","5","6","7","8","9","0"); $b=array("9","8","7","6","5","4","3","2","1","0"); $str="1234567890"; echo str_replace($a,$b,$str); ?> -- Edit bug report at http://bugs.php.net/bug.php?id=55051&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=55051&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=55051&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=55051&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=55051&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=55051&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=55051&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=55051&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=55051&r=needscript Try newer version: http://bugs.php.net/fix.php?id=55051&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=55051&r=support Expected behavior: http://bugs.php.net/fix.php?id=55051&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=55051&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=55051&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=55051&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=55051&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=55051&r=dst IIS Stability: http://bugs.php.net/fix.php?id=55051&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=55051&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=55051&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=55051&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=55051&r=mysqlcfg

« previous php.bugs (#161377) next »