Skip to content

Instantly share code, notes, and snippets.

@damncabbage
Created August 16, 2011 01:14
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 damncabbage/1148249 to your computer and use it in GitHub Desktop.
Save damncabbage/1148249 to your computer and use it in GitHub Desktop.
switch() semi-colon sadness.
<?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.
@damncabbage
Copy link
Author

(Correct response: http://i.imgur.com/mYUYN.jpg )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment