Skip to content

Instantly share code, notes, and snippets.

@boo1ean
Created November 30, 2012 11:08
Show Gist options
  • Save boo1ean/4175158 to your computer and use it in GitHub Desktop.
Save boo1ean/4175158 to your computer and use it in GitHub Desktop.
Tricky switch
<?php
switch (true) {
case ($a > $b):
//...
break;
case ($a > $c):
//...
break;
case ($someCustomCondition):
//...
break;
default:
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment