#27457 [Opn->Asn]: Problem with strtr() and translation array

From: Date: Tue, 09 Mar 2004 14:12:26 +0000
Subject: #27457 [Opn->Asn]: Problem with strtr() and translation array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56169@lists.php.net to get a copy of this message
ID: 27457 Updated by: sniper@php.net Reported By: solace at ezmail dot ru -Status: Open +Status: Assigned Bug Type: Zend Engine 2 problem -Operating System: Win2K +Operating System: * -PHP Version: 5.0.0b4 (beta4) +PHP Version: 5CVS-2004-03-09 Assigned To: andi Previous Comments: ------------------------------------------------------------------------ [2004-03-02 04:12:56] derick@php.net Recategorize bug. ------------------------------------------------------------------------ [2004-03-02 03:40:08] solace at ezmail dot ru 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 this bug report at http://bugs.php.net/?id=27457&edit=1

« previous php.bugs (#56169) next »