Is it possible to overwrite the already set register_shutdown_function stack? Something like:
function f1(){
echo "f1";
}
function f2(){
echo "f2";
}
register_shutdown_function("f1");
echo "actions here";
register_shutdown_function("f2");
call_to_undefined_function(); // to "produce" the error
In this case I want the script to only call f2(). Is this possible?
This is not possible. PHP has a
remove_user_shutdown_functionPHPAPI function, but this is not exposed to userland code.