5

I'm aware that numeric strings may be type juggled in PHP, but I can't see why it's happening here or giving this result:

$a="00010010001101000000101";
$b="00010010001101000000001";

$c = (($a == $b) ? "true" : "false");
$d = (($a === $b) ? "true" : "false");

echo $c . "  " . $d . "\n";  // true false

But in this case $a and $b are defined the same way, of the same length, but different contents many chars in. How is ($a == $b) evaluating as true?

4

1 回答 1

0

这是一个错误。在http://3v4l.org/CMld0上进行测试。

版本4.3.1 - 5.0.55.1.1 - 5.4.3返回true false

版本5.4.4 - 5.5.3返回false false

于 2013-09-03T22:41:12.393 回答