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.
Comments are closed.
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. :P
I guess to it’s best to use is_null() to avoid the PHP comparison oddities in situations such as this one.
I got around it by using !is_int().
Never figured out this language although many guys I know say it is very easy. Not for me though :)