3 ms·
"foo" == TRUE "foo" == 0 TRUE != 0 NULL == 0 NULL < -1 0 > -1 You have to test the simplest expressions because you can't trust the language to do w
by erik_seaberg 6y ago
"foo" == TRUE
"foo" == 0
TRUE != 0
NULL == 0
NULL < -1
0 > -1
You have to test the simplest expressions because you can't trust the language to do what you wrote.
- francislavoie 6y agoThat's why `===` is a thing. But FYI, "foo" == 0 is no longer true in PHP 8: https://3v4l.org/fQLXX https://3v4l.org/fQLXX RFC is here: https://wiki.php.net/rfc/string_to_number_comparison https://wiki.php.net/rfc/string_to_number_comparison