exit(); die(); return false; [duplicate]

2021/01/14 05:41 · php ·  · 0评论

Possible Duplicate:
what are the differences in die() and exit() in PHP?

I guess the main question is what is the difference between the 3 exactly?

What is the correct semantic usage for each one of these?

From what I see return false; can discontinue a function whereas die(); and exit(); will prevent any further code running at all.

Is this correct?

die()并且exit()完全相同;他们停止了整个PHP程序并返回到操作系统。它们是同一功能的两个不同名称。

return另一方面,结束函数调用并返回到调用者。在程序结束时,return设置返回到OS的状态值。该程序将退出,无论如何。

根据文档PHP:exit Manual die()是别名,exit()因此它们执行相同的功能,即结束脚本。

return语句结束一个函数而不是整个脚本,并返回您选择的值。

本文地址:http://php.askforanswer.com/exit-die-return-false-duplicate.html
文章标签:
版权声明:本文为原创文章,版权归 admin 所有,欢迎分享本文,转载请保留出处!

文件下载

老薛主机终身7折优惠码boke112

上一篇:
下一篇:

评论已关闭!