pcntl_wifexited

(PHP 4 >= 4.1.0, PHP 5)

pcntl_wifexited --  Returns TRUE if status code represents a successful exit

Description

bool pcntl_wifexited ( int status )

Returns TRUE if the child status code represents a successful exit.

status 参数是提供给成功调用的 pcntl_waitpid() 函数的状态参数。

See also pcntl_waitpid() and pcntl_wexitstatus().


add a note add a note User Contributed Notes
11-May-2005 01:43
The documentation claims a TRUE return in the case of a "successful exit", but that is misleading.  If you read the unix man page for the underlying WIFEXITED() macro, you will find that it returns TRUE in the case of a "normal exit".  In other words, this function returns TRUE if the child process ended by returning from main() or by calling an exit() function.  It returns FALSE in other cases, such as when the child process was terminated with a signal.  This function does not test the child's numeric exit code for success or failure.