|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-03-02 04:12 UTC] derick@php.net
[2004-03-18 05:31 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
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]