Side effects of PHP string comparison operators. The copy code is as follows: $ a212345678912000005; $ b212345678912000001; var_dump ($ a $ B); the output of this code is bool (true). This indicates that the two conclusions are obtained.
The code is as follows:
$ A = '000000 ';
$ B = '000000 ';
Var_dump ($ a = $ B );
The output of this code is bool (true), indicating that the two are equal. similar features are applicable when the 3rd in_array () function parameters are false or not set. the reason is that you first determine whether the string is a number, then convert it to long or double (C data type), and then judge-use zendi_smart_strcmp. however, the comments in the source code indicate that the declaration considers overflow,
The code is as follows:
} Else if (dval1 = Dval &&! Zend_finite (dval1 )){
/* Both values overflowed and have the same sign,
* So a numeric comparison wocould be inaccurate */
Goto string_cmp;
}
Dval1 and Dval are the values after the two strings are converted to the double type, but why? Maybe this judgment is incorrect. further research...
Solution: Use the three equal signs "=" to replace the two equal signs "=". The in_array () function sets the third parameter to true: in_array ('Val', $ array, true ).
The http://www.bkjia.com/PHPjc/320772.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/320772.htmlTechArticle code is as follows: $ a = '000000'; $ B = '000000'; var_dump ($ a = $ B); the output of this code is bool (true ), it indicates that this judgment will conclude that the two are in the same phase...