Search code examples
phpcallbackexitabortatexit

exiting from php command without triggering shutdown functions


how can I exit from a php script (for example with the exit() function) but without triggering all previously registered shutdown functions (with register_shutdown_function)?

Thanks!

EDIT: alternatively, is there a way to clear from all the registered shutdown functions?


Solution

  • Shutdown functions will not be executed if the process is killed with a SIGTERM or SIGKILL signal.

    posix_kill(posix_getpid(), SIGTERM);