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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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 Apr 26 04:01:30 2024 UTC