Last active
December 23, 2015 13:39
-
-
Save ScreamingDev/6644108 to your computer and use it in GitHub Desktop.
The day I wanted to test against associative array ...
This file contains hidden or 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 | |
| // php -r "var_dump(intval('foo'), intval('foo') == 'foo', 0 == 'foo', (bool) 'foo', 0 == true);" | |
| var_dump( | |
| intval('foo'), // 0 | |
| 0 == 'foo', // true | |
| 'foo' == 0, // true | |
| true == 'foo', // true | |
| 'foo' == true, // true | |
| // so when 0 == foo and foo == true then ... | |
| 0 == true // false | |
| ); | |
| echo "meh!"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
:D Sehr cool