summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/bug69144.phpt
blob: ded915b4c0ad5514972704dfc71722ff23ca93ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--TEST--
Bug #69144 (strtr not replacing with partly matching replace pairs)
--FILE--
<?php
$tests = array('bar' => '', 'foo' => 'o', 'foobar' => '', 'hello' => 'hello');

foreach ($tests as $input => $expected) {
    if ($expected !== ($actual = strtr($input, array("fo" => "", "foobar" => "", "bar" => "")))) {
        echo "KO `$input` became `$actual` instead of `$expected`\n";
    }
}
echo "okey";
?>
--EXPECT--
okey