PHP 8.1 RFC: never type

never type
New Feature
PHP 8.1
Implemented

RFC Vote: never type

Implemented
 - 
>= 2/3
Yes: 42No: 11

An RFC to add a new return type called noreturn (or never), that indicates the declared function/method does not return any value, and terminates the execution flow by throwing an exception, or terminating the request with a die/exit call.

A secondary vote to select the return type name, between noreturn and never concluded with never being the winner.

Subscribe to PHP.Watch newsletter for monthly updates

You will receive an email on last Wednesday of every month and on major PHP releases with new articles related to PHP, upcoming changes, new features and what's changing in the language. No marketing emails, no selling of your contacts, no click-tracking, and one-click instant unsubscribe from any email you receive.

Support PHP.Watch — If you find the articles, version information, Codex, and other PHP.Watch contributions useful, consider supporting through GitHub Sponsors. Your sponsorship helps dedicate more time to creating valuable content and improving the PHP community. Together, we can keep the momentum going — thank you for your support!

Thanks to the highest tier sponsor: @TomasVotruba for your generous support to keep PHP.Watch moving 💜