Created
February 17, 2011 14:44
-
-
Save woodworker/831845 to your computer and use it in GitHub Desktop.
Sometimes i really hate PHP :D
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 = 0; | |
switch ($a) { | |
case 'test': | |
$b = 'TEST'; | |
break; | |
default: | |
$b = 'DEFAULT'; | |
} | |
// will echo "Test" because $a is an int, so every case will be compared as int and intval('test')===0 | |
// MINDFUCK - arg | |
// PS: would be the name of the case 1test then it would be converted to 1 and so on | |
echo $b; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment