register_shutdown_function是否适用于嵌套函数

时间:2013-05-17 07:33:33

标签: php function nested shutdown

假设我有类似的东西,

<?php
   $test = new Test();
   register_shutdown_function(array($test, 'shutdownHandler'));
   $test->func1();

   Class Test {

     func1() {
        //code..
        func2();
     }

     func2() {
        //code..
        func3();
     }

     func3() {
        //code..
     }

     shutdownHandler() {
        //After func1 -> func2 -> func3 has finished, the handler should be called..
        //code..
     }
   }

?>

register_shutdown_handler会在上述情况下工作吗? 处理程序会被调用吗?

如果没有,我该如何实现?

任何帮助都将不胜感激。

提前致谢。

0 个答案:

没有答案