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

标签 php posix exit kill

有人可以解释 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/

相关文章:

php - 启用 HTTPS 后 Laravel 5.7 @csrf 无法正常工作

c++ - POSIX 消息队列可以在 Linux 上跨用户使用吗?

c - ubuntu 上的 sem_init 使用 C 语言

c - 用c语言编写正确的软件

init - __init 和 __exit 宏用于内置和可加载模块

php - 如何使用 actionscript 和 javascript 在客户端获取文件大小?

php - 需要帮助从数据库(PHP)中仅显示每个用户的一个结果

c - 不建议在 fork 时执行外部程序

angularjs - 访问 Angular-UI-Router 的 onExit 范围?

php - 在运行时为 Lumen 的 .env 文件中定义的 APP_LOCALE 设置值