3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class App { function test($function) { echo 1; $function(); throw new Exception('test'); } } $app = new App(); $app->test(function() use ($app){ echo 2; });
based on QUJWY
Output for 7.0.0 - 7.2.0
12 Fatal error: Uncaught Exception: test in /in/dQkbM:7 Stack trace: #0 /in/dQkbM(14): App->test(Object(Closure)) #1 {main} thrown in /in/dQkbM on line 7
Process exited with code 255.
Output for 5.3.21 - 5.6.28
12 Fatal error: Uncaught exception 'Exception' with message 'test' in /in/dQkbM:7 Stack trace: #0 /in/dQkbM(14): App->test(Object(Closure)) #1 {main} thrown in /in/dQkbM on line 7
Process exited with code 255.