Skip to content

Instantly share code, notes, and snippets.

@lowellkitchen
Last active July 29, 2016 00:37
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 lowellkitchen/c613d490b3f34db9bb3bd3a08c829b1f to your computer and use it in GitHub Desktop.
Save lowellkitchen/c613d490b3f34db9bb3bd3a08c829b1f to your computer and use it in GitHub Desktop.
laracon foreach challenge
foreach($array as $key => $value) {
goto ifkeyvalueexists;
ifkeyvalueexists:
if($key && $value){
forach($value as $innerkey => $innervalue){
switch($innerkey) {
case 'something':
doSomething($value);
break;
case 'somethingelse':
doSomethingElse($innervalue);
break;
}
}
} elseif(!$key){
break;
} elseif(!$value){
goto valuenotexists;
} else{
dosomethingreallybadass();
}
valuenotexists:
hahahahahaha();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment