Skip to content

Instantly share code, notes, and snippets.

@djom202
Created December 14, 2015 13:27
Show Gist options
  • Save djom202/3905279ad109152941f7 to your computer and use it in GitHub Desktop.
Save djom202/3905279ad109152941f7 to your computer and use it in GitHub Desktop.
Using simple comparison is less ambiguous, faster and cleaner.
isset is_null ===null ==null empty
null | F | T | T | T | T |
unset | F | T | T | T | T |
"" | T | F | F | T | T |
[] | T | F | F | T | T |
0 | T | F | F | T | T |
false | T | F | F | T | T |
true | T | F | F | F | F |
1 | T | F | F | F | F |
\0 | T | F | F | F | F |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment