From: solace at ezmail dot ru Operating system: Win2K PHP version: 5.0.0b4 (beta4) PHP Bug Type: Strings related Bug description: Problem with strtr() and translation array
Description: ------------ I wanted to test compatibility of my scripts with the latest php5 beta and discovered very strange results. Well, something is wrong with strtr() function working with translation array. It worked fine with php 4.x.x. But strtr() with strings still works. I'm using command-line php.exe with -n switch, without php.ini or any modules. Reproduce code: --------------- $test = "Dot in brackets [.]\n"; $test = strtr($test, array('.' => '0')); // doesn't work ??? $test = strtr($test, array('0' => '.')); echo $test; // but this works!!! $test = strtr($test, '0', '.'); echo $test; Expected result: ---------------- Dot in brackets [.] Actual result: -------------- Dot in brackets [0] -- Edit bug report at http://bugs.php.net/?id=27457&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27457&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27457&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27457&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27457&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27457&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27457&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27457&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27457&r=support Expected behavior: http://bugs.php.net/fix.php?id=27457&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27457&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27457&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27457&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27457&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27457&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27457&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27457&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27457&r=float