3v4l.org

run code in 300+ PHP versions simultaneously
<?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.3.28, 5.4.0 - 5.4.27
Parse error: syntax error, unexpected '}', expecting ',' or ';' in /in/ktMPE on line 17
Process exited with code 255.

preferences:
182.08 ms | 1395 KiB | 64 Q