← All docs

pcntl_waitpid()

Waits for a selected child process and writes its target-native status.

pcntl_waitpid()

function pcntl_waitpid(int $process_id, mixed $status, int $flags = 0, mixed $resource_usage = []): int

Waits for a selected child process and writes its target-native status.

Parameters:

  • $process_id (int)
  • $status (mixed), passed by reference
  • $flags (int), default 0, optional
  • $resource_usage (mixed), passed by reference, default [], optional

Returns: int

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how pcntl_waitpid is implemented in the compiler, see the internals page.