<?php
class App {
function test($function) {
echo 1;
$function();
throw new Exception('test');
}
}
$app = new App();
$app->test(function() use ($app){
echo 2;
});
12
Fatal error: Uncaught Exception: test in /in/dQkbM:7
Stack trace:
#0 /in/dQkbM(12): App->test(Object(Closure))
#1 {main}
thrown in /in/dQkbM on line 7
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
12
Fatal error: Uncaught Exception: test in /in/dQkbM:7
Stack trace:
#0 /in/dQkbM(12): App->test(Object(Closure))
#1 {main}
thrown in /in/dQkbM on line 7
Process exited with code 255.
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.5.0 - 5.5.38, 5.6.0 - 5.6.40
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.