Why I hate PHP
echo (0 == null); => 1
@#$%@*@*%@#!
To those unfamiliar with PHP, 1 stands for true in PHP. Apparently, I’m not alone in my hatred.
echo (0 == null); => 1
@#$%@*@*%@#!
To those unfamiliar with PHP, 1 stands for true in PHP. Apparently, I’m not alone in my hatred.
December 26th, 2006 at 10:26 am
I think you need to use === (identity check) for that. Sill, I have no clue why would need to 0 be equal to null… I wonder if this is a bug or a feature.
I guess to it’s best to use is_null() to avoid the PHP comparison oddities in situations such as this one.
December 26th, 2006 at 11:06 am
I got around it by using !is_int().
December 7th, 2008 at 10:25 am
Never figured out this language although many guys I know say it is very easy. Not for me though