ID:               39621
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ivb at is dot ua
-Status:           Open
+Status:           Closed
 Bug Type:         Strings related
 Operating System: Windows XP
 PHP Version:      5.2.0
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




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

[2006-11-24 16:14:32] ivb at is dot ua

Description:
------------
If 'search' and 'subject' has equal length and both begins with equal
substring with chr(0) inside - str_replace() considers that 'search'
and 'subject' equals.

Reproduce code:
---------------
<?php
$search =  "qx\0qqqqqqqqqq";
$subject = "qx\0xxxxxxxxxx";
$replace = "any text";

$result = str_replace ( $search, $replace, $subject );

echo $search . "\n" . $replace . "\n" . $subject . "\n" . $result .
"\n";
?>

Expected result:
----------------
qx qqqqqqqqqq
any text
qx xxxxxxxxxx
qx xxxxxxxxxx

Actual result:
--------------
qx qqqqqqqqqq
any text
qx xxxxxxxxxx
any text


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


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

Reply via email to