3v4l.org

run code in 300+ PHP versions simultaneously
<?php function t($nakrutka) { switch (true) { case ($nakrutka < 6): $color = 'red'; break; case ($nakrutka < 12): $color = 'yellow'; break; case ($nakrutka < 20): $color = 'white'; break; default: $color = 'green'; } return $color } echo t(3);
Output for 7.0.0
Parse error: syntax error, unexpected '}', expecting ';' in /in/gsdVr on line 18
Process exited with code 255.
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Parse error: syntax error, unexpected '}' in /in/gsdVr on line 18
Process exited with code 255.

preferences:
167.36 ms | 1387 KiB | 24 Q