ID:               27457
 Updated by:       [EMAIL PROTECTED]
 Reported By:      solace at ezmail dot ru
 Status:           Open
-Bug Type:         Strings related
+Bug Type:         Zend Engine 2 problem
 Operating System: Win2K
 PHP Version:      5.0.0b4 (beta4)
-Assigned To:      
+Assigned To:      andi
 New Comment:

Recategorize bug.


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to