Can someone explain difference between exit()
and posix_kill(getmypid(), 开发者_JS百科SIGKILL)
in PHP code?
From the exit()
docs page:
Terminates execution of the script. Shutdown functions and object destructors will always be executed even if exit() is called.
SIGKILL, on the other hand, does not allow any cleanup to be done by the process receiving the signal.
When sent to a program, SIGKILL causes it to terminate immediately. In contrast to SIGTERM and SIGINT, this signal cannot be caught or ignored, and the receiving process cannot perform any clean-up upon receiving this signal.
(http://en.wikipedia.org/wiki/SIGKILL#Usage)
精彩评论