今天用die()函数来debug程序,它死活不打印出来。后来查了下手册,发现原来die() 函数,传入的参数是整型时,参数会被识别为退出状态码,而不打印出来。以下是手册中的解释:
If status is an integer , that value will also be used as the exit status. Exit statuses should be in the range 0 to 254, the exit status 255 is reserved by PHP and shall not be used. The status 0 is used to terminate the program successfully.
本文探讨了在PHP中使用die()函数进行调试时遇到的问题。当传递整型参数时,该参数被视为程序退出状态码而非打印内容。文章进一步解释了有效退出状态码的范围及其在调试中的应用。
5132

被折叠的 条评论
为什么被折叠?



