← All built-ins / exit()

exit()

exit(...$args): void

Parameters

NameTypeDescription
$codeintprocess exit code (default 0)optional

Return value

Terminates the program immediately.

Example

echo "before";
if (true) { exit(0); }
echo "unreachable";
before

See also

die()