开发者

Difference between exit() and posix_kill(getmypid(), SIGKILL) in PHP

开发者 https://www.devze.com 2023-03-11 23:13 出处:网络
Can someone explain difference between exit() and posix_kill(getmypid(), 开发者_JS百科SIGKILL) in PHP code?From the exit() docs page:

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号