ID:               42861
 Updated by:       [EMAIL PROTECTED]
 Reported By:      mahesh dot vemula at in dot ibm dot com
 Status:           Open
 Bug Type:         Strings related
 Operating System: RHEL4, Windows XP
 PHP Version:      6CVS-2007-10-05 (snap)
 New Comment:

Works fine. (php6.0-200711202130)


Previous Comments:
------------------------------------------------------------------------

[2007-10-05 06:48:46] mahesh dot vemula at in dot ibm dot com

Description:
------------
strtr() crashes on php6 with unicode ON , when $from argument is given
as any of the following:
empty string
Null

e.g:
var_dump( strtr("hello", array("" => "string") ) );
var_dump( strtr("hello", "", "string") );

This is applicable for PHP6 with Unicode.

Reproduce code:
---------------
<?php
var_dump( strtr("hello", array("" => "string") ) );
var_dump( strtr("hello", array('' => "string") ) );
var_dump( strtr("hello", array(null => "string") ) );
var_dump( strtr("hello", array(NULL => "string") ) );

var_dump( strtr("hello", "", "string") );
var_dump( strtr("hello", '', "string") );
var_dump( strtr("hello", NULL, "string") );
var_dump( strtr("hello", null, "string") );
?>

Expected result:
----------------
unicode(5) "hello"
unicode(5) "hello"
unicode(5) "hello"
unicode(5) "hello"
unicode(5) "hello"
unicode(5) "hello"
unicode(5) "hello"
unicode(5) "hello"

Actual result:
--------------
On Windows: crashes
On linux(RHEL4):
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 1066789985 bytes) in %s on line %d


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=42861&edit=1

Reply via email to