Skip to content

Instantly share code, notes, and snippets.

@kurtroberts
Last active January 10, 2018 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurtroberts/316b6cf89442d4fd3b7c7467e884a7af to your computer and use it in GitHub Desktop.
Save kurtroberts/316b6cf89442d4fd3b7c7467e884a7af to your computer and use it in GitHub Desktop.
More fun with PHP's lack of type safety...
$ php -a
php > echo ('' == (string)$some ? 1 : 0);
1
php > echo ('' == $some ? 1 : 0);
1
php > echo ('' === $some ? 1 : 0);
0
php > echo ('' === (string)$some ? 1 : 0);
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment