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.

3 Responses to “Why I hate PHP”

  1. Luke says:

    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.

  2. I got around it by using !is_int().

  3. reiki says:

    Never figured out this language although many guys I know say it is very easy. Not for me though :)

Leave a Reply