From: zlobnygrif at gmail dot com Operating system: FreeBSD 7.2-RELEASE PHP version: 6SVN-2009-09-02 (snap) PHP Bug Type: Unicode Engine related Bug description: (unicode) and (string) types
Description: ------------ ENG: Functions for working with strings return different types. Because of this, for example, function strtr not working properly. RUS: Ôóíêöèè äëÿ ðàáîòû ñî ñòðîêàìè âîçâðàùàþò ðàçíûå òèïû ðåñóðñîâ. Èç-çà ýòîãî äðóãèå ôóíêöèè, íàïðèìåð strtr, ðàáîòàþò íåïðàâèëüíî. Reproduce code: --------------- $sour = 'hello'; ob_start(); echo $sour; $buff = ob_get_clean(); var_dump($sour); var_dump($buff); var_dump($sour === $buff); var_dump(substr($buff,0)); var_dump(strtr($buff, array($sour => 'HELLO'))); var_dump(strtr($buff, $sour, 'HELLO')); Expected result: ---------------- unicode(5) "hello" string(5) "hello" bool(false) string(5) "hello" string(5) "hello" unicode(5) "HELLO" Actual result: -------------- unicode(5) "hello" unicode(5) "hello" bool(true) unicode(5) "hello" unicode(5) "HELLO" unicode(5) "HELLO" -- Edit bug report at http://bugs.php.net/?id=49439&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49439&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49439&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49439&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49439&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49439&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49439&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49439&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49439&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49439&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49439&r=support Expected behavior: http://bugs.php.net/fix.php?id=49439&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49439&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49439&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49439&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49439&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49439&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49439&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49439&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49439&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49439&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49439&r=mysqlcfg
