register_shutdown_function覆盖 [英] register_shutdown_function overwrite

查看:110
本文介绍了register_shutdown_function覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以覆盖已经设置的 register_shutdown_function 堆栈?例如:

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

在这种情况下,我希望脚本只调用 F2()。这可能吗?

In this case I want the script to only call f2(). Is this possible?

推荐答案

这是不可能的。 PHP有一个 remove_user_shutdown_function PHPAPI函数,但这不会暴露给用户级代码。

This is not possible. PHP has a remove_user_shutdown_function PHPAPI function, but this is not exposed to userland code.

这篇关于register_shutdown_function覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆