Last active
January 10, 2018 15:34
-
-
Save kurtroberts/316b6cf89442d4fd3b7c7467e884a7af to your computer and use it in GitHub Desktop.
More fun with PHP's lack of type safety...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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