Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 595
fstab Avatar asked Jun 11 '26 14:06

fstab


1 Answers

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

posix_kill(posix_getpid(), SIGTERM);
like image 83
Mark Baker Avatar answered Jun 13 '26 07:06

Mark Baker