Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's some interesting facts about PHP I like to know and share. How many of them are now untrue?

"foo" == TRUE, and "foo" == 0, but TRUE != 0

NULL < -1, and NULL == 0

PHP sez:

    Parse error: syntax error, unexpected (T_PAAMAYIM_NEKUDOTAYIM)


You may have missed it, but with PHP 7 the language has even more shifted towards stricter typing paradigms. People use strict comparison, typed properties, typed arguments, etc. Couple that with one of the popular static analysis tools and you'll never see any such errors.


T_PAAMAYIM_NEKUDOTAYIM was changed to T_DOUBLE_COLON ages ago




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: