rfc:unary_null_coalescing_operator
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:unary_null_coalescing_operator [2017/06/21 15:21] – created ajf | rfc:unary_null_coalescing_operator [2017/07/19 00:29] – ajf | ||
---|---|---|---|
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: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
Line 20: | Line 20: | ||
The unary form of < | The unary form of < | ||
+ | |||
+ | One practical use is optional request parameters: | ||
+ | |||
+ | <code php> | ||
+ | if ($_POST[" | ||
+ | // Form submission logic | ||
+ | } else { | ||
+ | // Form display logic | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Another is optional options in, say, a configuration object, or an “options bag” parameter: | ||
+ | |||
+ | <code php> | ||
+ | if ($optionsBag-> | ||
+ | // Safe mode | ||
+ | } else { | ||
+ | // Not safe | ||
+ | } | ||
+ | </ | ||
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
None. | None. | ||
+ | |||
+ | There is an ambiguity in the case where unary < | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
Line 37: | 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 ends 2017-07-18. | ||
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
===== Patches and Tests ===== | ===== Patches and Tests ===== | ||
A php-src patch, including a test, can be found here: https:// | A php-src patch, including a test, can be found here: https:// | ||
- | Language specification | + | A patch for the language specification, |
===== Implementation ===== | ===== Implementation ===== | ||
Line 53: | Line 82: | ||
===== References ===== | ===== References ===== | ||
- | * [[rfc: | + | |
rfc/unary_null_coalescing_operator.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1