#47691 [Opn]: strtr bug. Not replace unicode values from array, in binary string.

2009-03-18 Thread strike at true-vision dot net
 ID:   47691
 User updated by:  strike at true-vision dot net
 Reported By:  strike at true-vision dot net
 Status:   Open
 Bug Type: Strings related
 Operating System: Fedora 8.0
 PHP Version:  6CVS-2009-03-17 (snap)
 New Comment:

Description:

Found bug in function strtr...
Not replace unicode values from array, in binary string.

Reproduce code:
---
?php
$a = (binary)AAA; // In my code I use file_get_contents
// function retrun binary value
$b = array(AAA = BBB);
$c = strtr($a, $b);
var_dump($a);
var_dump($b);
var_dump($c);
?

Expected result:

string(3) AAA 
array(1) { [uAAA]= unicode(3) BBB } 
string(3) BBB 

Actual result:
--
string(3) AAA 
array(1) { [uAAA]= unicode(3) BBB } 
string(3) AAA


Previous Comments:


[2009-03-17 14:22:09] strike at true-vision dot net

Description:

Found bug in function strtr...
Not replace unicode values from array, in binary string.

Reproduce code:
---
php
$a = (binary)AAA; // In my code I use file_get_contents
// function retrun finary value
$b = array(AAA = BBB);
$c = strtr($a, $b);
var_dump($a);
var_dump($b);
var_dump($c);
?

Expected result:

string(3) AAA 
array(1) { [uAAA]= unicode(3) BBB } 
string(3) AAA 

Actual result:
--
This is bug ?





-- 
Edit this bug report at http://bugs.php.net/?id=47691edit=1



#47691 [NEW]: strtr bug. Not replace unicode values from array, in binary string.

2009-03-17 Thread strike at true-vision dot net
From: strike at true-vision dot net
Operating system: Fedora 8.0
PHP version:  6CVS-2009-03-17 (snap)
PHP Bug Type: Strings related
Bug description:  strtr bug. Not replace unicode values from array, in binary 
string.

Description:

Found bug in function strtr...
Not replace unicode values from array, in binary string.

Reproduce code:
---
php
$a = (binary)AAA; // In my code I use file_get_contents
// function retrun finary value
$b = array(AAA = BBB);
$c = strtr($a, $b);
var_dump($a);
var_dump($b);
var_dump($c);
?

Expected result:

string(3) AAA 
array(1) { [uAAA]= unicode(3) BBB } 
string(3) AAA 

Actual result:
--
This is bug ?

-- 
Edit bug report at http://bugs.php.net/?id=47691edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47691r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47691r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47691r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47691r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47691r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47691r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=47691r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=47691r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=47691r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=47691r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=47691r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=47691r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=47691r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47691r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=47691r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=47691r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=47691r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=47691r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=47691r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=47691r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=47691r=mysqlcfg