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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zlobnygrif at gmail dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Mon Dec 30 14:01:28 2024 UTC