3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Exception_Foo extends Exception {} class Exception_Bar extends Exception {} function foo() { throw new Exception_Foo('thing happened'); } function bar() { try { foo(); } catch (Exception_Foo $e) { echo "Exception_Foo caught: " . $e->getMessage() } }
Output for 5.3.0 - 5.4.27
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /in/ktMPE on line 17
Process exited with code 255.