rfc:throw_expression

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:throw_expression [2020/03/22 16:07] – Move to Under Discussion ilijatovilorfc:throw_expression [2020/04/23 15:30] (current) – Move to implemented ilijatovilo
Line 1: Line 1:
 ====== PHP RFC: throw expression ====== ====== PHP RFC: throw expression ======
-  * Version: 0.9 
   * Date: 2020-03-21   * Date: 2020-03-21
-  * Author: Ilija Tovilo, ilija.tovilo@me.com+  * Author: Ilija Tovilo, tovilo.ilija@gmail.com
   * Target Version: PHP 8.0   * Target Version: PHP 8.0
-  * Status: Under Discussion+  * Status: Implemented
   * Implementation: https://github.com/php/php-src/pull/5279   * Implementation: https://github.com/php/php-src/pull/5279
  
Line 88: Line 87:
 The common theme here is that everything after the ''throw'' keyword has a higher precedence. For this reason this RFC proposes to use the lowest operator precedence possible. All the current code, even if broken or strange, will continue behaving the same way. This isn't a problem because generally ''throw'' should be the last operator you're using as every expression after it wouldn't be evaluated anyway. The common theme here is that everything after the ''throw'' keyword has a higher precedence. For this reason this RFC proposes to use the lowest operator precedence possible. All the current code, even if broken or strange, will continue behaving the same way. This isn't a problem because generally ''throw'' should be the last operator you're using as every expression after it wouldn't be evaluated anyway.
  
-One exception to this rule is using ''throw'' between two short-circuit operators which is not possible in this RFC:+The only downside of the low precedence is that a ''throw'' between two short-circuit operators would not be possible without parentheses:
  
 <code php> <code php>
Line 113: Line 112:
 Proposed version is PHP 8. Proposed version is PHP 8.
  
-===== RFC Impact ===== +===== Voting ===== 
-==== To SAPIs ==== +Voting starts 2020-04-05 and ends 2020-04-19
-None.+
  
-==== To Existing Extensions ==== +As this is a language change, a 2/3 majority is required. The vote is a straight Yes/No vote for accepting the RFC and merging the patch.
-None.+
  
-==== To Opcache ==== +<doodle title="Would you like to convert the throw statement into an expression?" auth="ilijatovilo" voteType="single" closed="true"> 
-None. +   * Yes 
- +   * No 
-===== Proposed Voting Choices ===== +</doodle>
-As this is a language change, a 2/3 majority is required. The vote is a straight Yes/No vote for accepting the RFC and merging the patch.+
  
 ===== References ===== ===== References =====
rfc/throw_expression.txt · Last modified: 2020/04/23 15:30 by ilijatovilo