rfc:nullsafe_operator
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:nullsafe_operator [2020/07/16 07:54] – Disallow ?-> in write context ilutov | rfc:nullsafe_operator [2020/07/31 08:55] (current) – Close vote ilutov | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2020-06-02 | * Date: 2020-06-02 | ||
* Author: Ilija Tovilo, tovilo.ilija@gmail.com | * Author: Ilija Tovilo, tovilo.ilija@gmail.com | ||
- | * Status: | + | * Status: |
* Target Version: PHP 8.0 | * Target Version: PHP 8.0 | ||
* Implementation: | * Implementation: | ||
Line 79: | Line 79: | ||
The following elements will cause new sub-chains. | The following elements will cause new sub-chains. | ||
- | * Right hand side of an assignment | ||
* Arguments in a function call | * Arguments in a function call | ||
* The expression in '' | * The expression in '' | ||
Line 110: | Line 109: | ||
$foo? | $foo? | ||
</ | </ | ||
- | The evaluation of '' | + | The evaluation of '' |
**2. You can see which methods/ | **2. You can see which methods/ | ||
Line 155: | Line 154: | ||
|[[https:// | |[[https:// | ||
- | * In Object-C accessing properties and calling methods on '' | + | * In Object-C accessing properties and calling methods on '' |
+ | † Possible via [[https:// | ||
+ | ‡ Hack evaluates method arguments even if the left hand side of '' | ||
8/13 languages have a nullsafe operator. 4/8 of those implement the nullsafe operator with short circuiting. | 8/13 languages have a nullsafe operator. 4/8 of those implement the nullsafe operator with short circuiting. | ||
Line 161: | Line 162: | ||
===== Syntax choice ===== | ===== Syntax choice ===== | ||
- | The '' | + | The '' |
===== Forbidden usages ===== | ===== Forbidden usages ===== | ||
Line 182: | Line 183: | ||
// Assignments can only happen to writable values | // Assignments can only happen to writable values | ||
</ | </ | ||
- | It was previously suggested to allow the nullsafe operator in the left hand side of assignments and skip the assignment if the left hand side of the nullsafe operator was '' | + | It was previously suggested to allow the nullsafe operator in the left hand side of assignments and skip the assignment if the left hand side of the nullsafe operator was '' |
==== References ==== | ==== References ==== | ||
Line 231: | Line 232: | ||
===== Vote ===== | ===== Vote ===== | ||
- | Voting starts 2020-xx-xx and ends 2020-xx-xx. | + | Voting starts 2020-07-17 and ends 2020-07-31. |
<doodle title=" | <doodle title=" |
rfc/nullsafe_operator.1594886040.txt.gz · Last modified: 2020/07/16 07:54 by ilutov