[snip]
";
} else {
echo "'NULL' != 0";
}
?>
[/snip]
Interesting, to be sure. I even flipped the test
if('NULL' == 0)
Of course, once I made 0 a string '0' the test evaluated FALSE. So 0
(integer) is TRUE and 'NULL' is TRUE, which means that you asked if(TRUE
== TRUE), which is, of course, T
Yeah.. you're comparing a string, 'NULL' with an integer 0. You're not
comparing NULL with anything, you're comparing a string that contains the word
'NULL'.
You can use === to do an exact comparison without conversion.
echo intval('NULL');
intval('NULL') === 0
= = = Original message = = =
2 matches
Mail list logo