3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyTrueException extends \Exception { } class MyFalseException extends \Exception { } function doSomething($var) { ($var) ? throw new MyTrueException() ? throw new MyFalseException(); } try { doSomething(true); } catch (MyTrueException) { echo 'got true'; } catch (MyFalseException) { echo 'got false'; }
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected 'throw' (T_THROW) in /in/d9mBr on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_THROW in /in/d9mBr on line 13
Process exited with code 255.

preferences:
191.2 ms | 1395 KiB | 62 Q