rfc:noreturn_type

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:noreturn_type [2021/03/31 13:47] – Make naming section more honest mattbrownrfc:noreturn_type [2021/04/19 09:31] (current) nikic
Line 3: Line 3:
   * Date: 2021-03-10   * Date: 2021-03-10
   * Author: Matt Brown <php@muglug.com> & Ondřej Mirtes <ondrej@mirtes.cz>   * Author: Matt Brown <php@muglug.com> & Ondřej Mirtes <ondrej@mirtes.cz>
-  * Status: Voting+  * Status: Implemented
   * Proposed Version: PHP 8.1   * Proposed Version: PHP 8.1
   * Implementation: https://github.com/php/php-src/pull/6761   * Implementation: https://github.com/php/php-src/pull/6761
Line 9: Line 9:
 ===== Introduction ===== ===== Introduction =====
  
-There has been a trend over the past few years that concepts initially just expressed in PHP docblocks eventually become native PHP types. +There has been a trend over the past few years that concepts initially just expressed in PHP docblocks eventually become native PHP types. Past examples are: [[https://wiki.php.net/rfc/scalar_type_hints_v5|scalar typehints]], [[https://wiki.php.net/rfc/return_types|return types]], [[https://wiki.php.net/rfc/union_types_v2|union types]], [[https://wiki.php.net/rfc/mixed_type_v2|mixed types]], and [[https://wiki.php.net/rfc/static_return_type|static types]].
- +
-Past examples are: [[https://wiki.php.net/rfc/scalar_type_hints_v5|scalar typehints]], [[https://wiki.php.net/rfc/return_types|return types]], [[https://wiki.php.net/rfc/union_types_v2|union types]], [[https://wiki.php.net/rfc/mixed_type_v2|mixed types]], and [[https://wiki.php.net/rfc/static_return_type|static types]].+
  
 Our static analysis tools currently provide support for '' @return noreturn '' docblocks to denote functions that always ''throw'' or ''exit''. Users of these tools have found that syntax useful to describe the behaviour of their own code, but we think it’s even more useful as a native return type, where PHP compile-time and runtime type-checks can guarantee its behaviour. Our static analysis tools currently provide support for '' @return noreturn '' docblocks to denote functions that always ''throw'' or ''exit''. Users of these tools have found that syntax useful to describe the behaviour of their own code, but we think it’s even more useful as a native return type, where PHP compile-time and runtime type-checks can guarantee its behaviour.
Line 253: Line 251:
 Voting opens 2021-03-30 and 2021-04-13 at 11:00:00 AM EDT. 2/3 required to accept. Voting opens 2021-03-30 and 2021-04-13 at 11:00:00 AM EDT. 2/3 required to accept.
  
-<doodle title="Add noreturn type" auth="mattbrown" voteType="single" closed="false">+<doodle title="Add noreturn type" auth="mattbrown" voteType="single" closed="true">
    * Yes    * Yes
    * No    * No
Line 260: Line 258:
 Following vote requires simple majority: Following vote requires simple majority:
  
-<doodle title="noreturn vs never" auth="mattbrown" voteType="single" closed="false">+<doodle title="noreturn vs never" auth="mattbrown" voteType="single" closed="true">
    * noreturn    * noreturn
    * never    * never
 </doodle> </doodle>
rfc/noreturn_type.1617198430.txt.gz · Last modified: 2021/03/31 13:47 by mattbrown