void exit ( [string $status] ) void exit ( int $status )status If status is a string, this function prints the status just before exiting. 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 >= 4.2.0 does NOT print the status if it is an integer.
把代码改为(把int改为string):define('XXX_ERROR',"1");exit(XXX_ERROR);而不是数字。
为啥直接echo XXX_ERROR;可以呢?
只想知道下原因!谁能解答下?
gingzai777你来吧。
你告诉他exit和echo有啥不一样。
void exit ( int $status )status
If status is a string, this function prints the status just before exiting. 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. 只有为字符串的时候,才会输出.