PHP string compare: odd result, possible type juggling, no idea why -
i'm aware numeric strings may type juggled in php, can't see why it's happening here or giving result:
$a="00010010001101000000101"; $b="00010010001101000000001"; $c = (($a == $b) ? "true" : "false"); $d = (($a === $b) ? "true" : "false"); echo $c . " " . $d . "\n"; // true false
but in case $a , $b defined same way, of same length, different contents many chars in. how ($a == $b) evaluating true?
it bug. test on http://3v4l.org/cmld0 .
version 4.3.1 - 5.0.5
, 5.1.1 - 5.4.3
return true false
.
versions 5.4.4 - 5.5.3
return false false
.
Comments
Post a Comment