gpt4 book ai didi

php - PHP 中 exit() 和 posix_kill(getmypid(), SIGKILL) 的区别

转载 作者:行者123 更新时间:2023-12-04 06:23:44 25 4
gpt4 key购买 nike

有人可以解释 exit() 之间的区别吗?和 posix_kill(getmypid(), SIGKILL)在 PHP 代码中?

最佳答案

来自 exit() docs page :

Terminates execution of the script. Shutdown functions and object destructors will always be executed even if exit() is called.



另一方面,SIGKILL 不允许接收信号的进程进行任何清理。

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 )

关于php - PHP 中 exit() 和 posix_kill(getmypid(), SIGKILL) 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6261845/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com