How can I detect whether PHP is shutting down? By "shutting down", I mean that a function registered with register_shutdown_function
is currently executing. For example, consider the following code:
<?php
function do_something() {
// How can I detect whether PHP is shutting down.
}
register_shutdown_function('do_something');
do_something();
In the above code snippet, I want to be able to detect shutdown from within the do_something
function.