Last active
June 3, 2019 18:55
-
-
Save ieatkillerbees/60c83c7dc0885a86497a to your computer and use it in GitHub Desktop.
Important Multi-Default Use Case
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 | |
// Apparently I need to point out that this is a joke? | |
$foo = 101; | |
switch (true) | |
{ | |
default: | |
less: | |
echo "$foo < 100!"; | |
break; | |
default: | |
more: | |
echo "$foo > 100!"; | |
break; | |
default: | |
same: | |
echo "$foo == 100!"; | |
break; | |
default: | |
if ($foo < 100) { | |
goto less; | |
} elseif ($foo > 100) { | |
goto more; | |
} elseif ($foo == 100) { | |
goto same; | |
} | |
break; | |
} |
LGTM
👍 can you merge this soon, i am blocked because i need this for my branch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@arosemena, as her employer, I love it! Being able to come up with this is why Samantha is awesome.