3v4l.org

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