rfc:unary_null_coalescing_operator

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:unary_null_coalescing_operator [2017/06/21 15:27] ajfrfc:unary_null_coalescing_operator [2017/09/22 13:28] (current) – external edit 127.0.0.1
Line 3: Line 3:
   * Date: 2017-06-21   * Date: 2017-06-21
   * Author: Andrea Faulds, ajf@ajf.me   * Author: Andrea Faulds, ajf@ajf.me
-  * Status: Under Discussion+  * Status: Declined
   * First Published at: http://wiki.php.net/rfc/unary_null_coalescing_operator   * First Published at: http://wiki.php.net/rfc/unary_null_coalescing_operator
  
Line 34: Line 34:
  
 <code php> <code php>
-if ($optionsBag->safeMode === TRUE) {+if ($optionsBag->safeMode?? === TRUE) {
     // Safe mode     // Safe mode
 } else { } else {
Line 43: Line 43:
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
 None. None.
 +
 +There is an ambiguity in the case where unary <php>??</php> is followed by an operator that can be either unary or binary, i.e. <php>$a?? + $b</php> and <php>$a?? - $b</php>. These continue to be parsed the same (<php>$a ?? (+$b)</php>, <php>$a ?? (-$b)</php>), meaning there is no backwards-compatibility break. 
  
 ===== Proposed PHP Version(s) ===== ===== Proposed PHP Version(s) =====
Line 57: Line 59:
 None. None.
  
-===== Proposed Voting Choices =====+===== Vote =====
 This is a simple language change which should only require a 2/3 majority vote on whether or not to approve it. This is a simple language change which should only require a 2/3 majority vote on whether or not to approve it.
 +
 +Voting started 2017-07-11 and <del>ends 2017-07-18</del> ended 2017-07-18.
 +
 +<doodle title="Accept and merge unary null coalescing operator for PHP 7.2?" auth="ajf" voteType="single" closed="true">
 +   * Yes
 +   * No
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
 A php-src patch, including a test, can be found here: https://github.com/php/php-src/pull/2589 A php-src patch, including a test, can be found here: https://github.com/php/php-src/pull/2589
  
-Language specification patch forthcoming.+patch for the language specification, including the same test, can be found here: https://github.com/php/php-langspec/pull/197
  
 ===== Implementation ===== ===== Implementation =====
rfc/unary_null_coalescing_operator.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1