3v4l.org

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