3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function some_call() { throw new Exception( 'haha' ); } function some_catcher( Exception $excpt ) { echo 'Got it!'; } set_exception_handler( 'some_catcher' ); try { some_call(); } catch ( Exception $e ) { throw $e; }
Output for 5.0.0 - 7.1.0
Got it!
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_NEW in /in/LBL5m on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_NEW in /in/LBL5m on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/LBL5m on line 4
Process exited with code 255.