$a = ' 212345678912000005 ';
$b = ' 212345678912000001 ';
Var_dump ($a = = $b);
The output of this code is bool (true), which means that the judgment will conclude that the two are equal. Similar attributes are false or not set in the 3rd argument of the In_array () function. The reason is to first judge whether a string is a number and then convert it to a long or double (C language data type) to be judged again – using ZENDI_SMART_STRCMP. However, the comments in the source code say that the declaration takes into account the overflow situation,
else if (Dval1 = = Dval2 &&!zend_finite (dval1)) {
/* Both values overflowed and have the same sign,
* So a numeric comparison would to be inaccurate * *
Goto string_cmp;
}
The Dval1 and Dval2 are two strings converted to the double type value respectively. But why is that still the case? Perhaps this is not the correct judgment. Further study to say ...
Workaround, using three equal sign "= =" instead of two equals "=", the In_array () function sets the third argument to True:in_array (' Val ', $array, true).