← All docs

pcntl_exec()

Replaces the current process image with a program and optional arguments and environment.

pcntl_exec()

function pcntl_exec(string $path, mixed $args = [], mixed $env_vars = []): bool

Replaces the current process image with a program and optional arguments and environment.

Parameters:

  • $path (string)
  • $args (mixed), default [], optional
  • $env_vars (mixed), default [], optional

Returns: bool

Availability

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

Internals

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