fork download
  1. <?php
  2.  
  3. $out = null;
  4. $foo = 10;
  5. switch($foo) {
  6. case $foo > 10:
  7. $out = ' > 10';
  8. break;
  9. case $foo <= 10 && $foo >= 5:
  10. $out = '5 <= x <= 10';
  11. break;
  12. default:
  13. $out = null;
  14. }
  15.  
  16. var_dump($out);
Success #stdin #stdout 0.02s 23780KB
stdin
Standard input is empty
stdout
string(12) "5 <= x <= 10"