php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49439 (unicode) and (string) types
Submitted: 2009-09-02 09:50 UTC Modified: 2010-06-20 23:53 UTC
From: zlobnygrif at gmail dot com Assigned:
Status: Wont fix Package: Unicode Engine related
PHP Version: 6SVN-2009-09-02 (snap) OS: FreeBSD 7.2-RELEASE
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-09-02 09:50 UTC] zlobnygrif at gmail dot com
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"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-20 23:53 UTC] felipe@php.net
-Status: Open +Status: Wont fix
 [2010-06-20 23:53 UTC] felipe@php.net
Old trunk related.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 04:01:29 2024 UTC