php-src/ext/standard/tests/strings/bug39621.phpt
Steph Fox 87fac43ac0 - killed off UEXPECT
- html_translation_table and setlocale tests are no longer relevant
- there are a number of ANSI-encoded files. Is this deliberate?
2008-05-27 10:50:48 +00:00

46 lines
868 B
PHP
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--TEST--
Bug #39621 (str_replace() is not binary safe on strings with equal length)
--FILE--
<?php
$search = "qxxx\0qqqqqqqq";
$subject = "qxxx\0xxxxxxxx";
$replace = "any text";
$result = str_replace ( $search, $replace, $subject );
var_dump($result);
$search = "QXXX\0qqqqqqqq";
$subject = "qxxx\0xxxxxxxx";
$replace = "any text";
$result = str_ireplace ( $search, $replace, $subject );
var_dump($result);
$search = "qxxx\0xxxxxxxx";
$subject = "qxxx\0xxxxxxxx";
$replace = "any text";
$result = str_replace ( $search, $replace, $subject );
var_dump($result);
$search = "qXxx\0xXxXxXxx";
$subject = "qxXx\0xxxxxxxx";
$replace = "any text";
$result = str_ireplace ( $search, $replace, $subject );
var_dump($result);
echo "Done\n";
?>
--EXPECT--
unicode(13) "qxxxxxxxxxxx"
unicode(13) "qxxxxxxxxxxx"
unicode(8) "any text"
unicode(8) "any text"
Done