Longhorn PHP 2025 - Speakers and Schedule Announced!

Voting

: six plus one?
(Example: nine)

The Note You're Voting On

Uwe Ohse
9 years ago
Regarding: "Returns the termination status of the process that was run. In case of an error then -1 is returned."

This is, at best, misleading. It returns:
* -1 on error,
* WEXITSTATUS(status) if WIFEXITED(status) is true, or
* status if WIFEXITED(status) is false,
where status is the status parameter of waitpid().

This makes it impossible to differentiate between a relatively normal exit or a termination by signal, and reduces the value of the proc_close return code to a binary one (ok / something broke).

This can be seen in proc_open_rsrc_dtor() in ext/standard/proc_open.c (PHP 5.4.44, 5.6.12).

<< Back to user notes page

To Top