3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo() { throw new \Exception('Oups.'); } function test() { try { $foo = foo(); } catch (\Exception $e) { throw new \Exception('Another one'); } finally { if ($foo === null) { throw new \Exception('Third.'); } return $foo; } } var_dump(test());
Output for 7.0.28 - 7.3.0rc3
Notice: Undefined variable: foo in /in/M0sgn on line 13 Fatal error: Uncaught Exception: Another one in /in/M0sgn:11 Stack trace: #0 /in/M0sgn(20): test() #1 {main} Next Exception: Third. in /in/M0sgn:14 Stack trace: #0 /in/M0sgn(20): test() #1 {main} thrown in /in/M0sgn on line 14
Process exited with code 255.
Output for 5.6.38
Notice: Undefined variable: foo in /in/M0sgn on line 13 Fatal error: Uncaught exception 'Exception' with message 'Another one' in /in/M0sgn:11 Stack trace: #0 /in/M0sgn(20): test() #1 {main} Next exception 'Exception' with message 'Third.' in /in/M0sgn:14 Stack trace: #0 /in/M0sgn(20): test() #1 {main} thrown in /in/M0sgn on line 14
Process exited with code 255.