3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php try { throw new InvalidArgumentException("1"); } catch (InvalidArgumentException $e) { echo "Caught 1"; throw new Exception("2"); } catch (Exception $e2) { echo "Caught 2"; }
Output for 7.0.0 - 7.1.0
Caught 1 Fatal error: Uncaught Exception: 2 in /in/va0KI:6 Stack trace: #0 {main} thrown in /in/va0KI on line 6
Process exited with code 255.
Output for 5.1.0 - 5.6.28
Caught 1 Fatal error: Uncaught exception 'Exception' with message '2' in /in/va0KI:6 Stack trace: #0 {main} thrown in /in/va0KI on line 6
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Fatal error: Class 'InvalidArgumentException' not found in /in/va0KI on line 3
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/va0KI on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '{' in /in/va0KI on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/va0KI on line 2
Process exited with code 255.