Advanced PHP
Q97 / 100

What is PHP's "never" return type?

Correct! Well done.

Incorrect.

The correct answer is B) A return type for functions that never return normally — they always throw or call exit()

B

Correct Answer

A return type for functions that never return normally — they always throw or call exit()

Explanation

function redirect(string $url): never { header("Location: $url"); exit(); } — never communicates to static analyzers and the reader that this function never returns.

Progress
97/100