3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function testing($var) { if ($var == 'test') { throw new Exception('broke'); } return true; } } $test = new Test(); try { var_dump($test->testing('test'); } catch (Exception $e) { echo $e->getMessage(); }
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.22
Parse error: syntax error, unexpected ';' in /in/DuL1f on line 16
Process exited with code 255.

preferences:
176.97 ms | 1395 KiB | 58 Q