Created
August 16, 2011 01:14
-
-
Save damncabbage/1148249 to your computer and use it in GitHub Desktop.
switch() semi-colon sadness.
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 = 'foo'; | |
switch($a) { | |
case 'bar'; // <-- Yes, that's a semi-colon. | |
echo 'Stopped at bar.'; | |
break; | |
case 'foo'; | |
echo 'Stopped at foo.'; | |
break; | |
default; | |
echo 'Fell to default.'; | |
} | |
// Verdict: | |
// - Implications for internals. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(Correct response: http://i.imgur.com/mYUYN.jpg )