#49439 [NEW]: (unicode) and (string) types
| From: | zlobnygrif at gmail dot com | Date: | Wed, 02 Sep 2009 09:50:54 +0000 |
| Subject: | #49439 [NEW]: (unicode) and (string) types | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-141843@lists.php.net to get a copy of this message | ||
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