rfc:nullsafe_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
Last revisionBoth sides next revision
rfc:nullsafe_operator [2020/07/16 09:29] – Shortly explain more about why ?-> in write context was dropped ilutovrfc:nullsafe_operator [2020/07/17 09:01] – Also set status to voting 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: Under discussion+  * Status: Voting
   * Target Version: PHP 8.0   * Target Version: PHP 8.0
   * Implementation: https://github.com/php/php-src/pull/5619   * Implementation: https://github.com/php/php-src/pull/5619
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 ''%%[]%%'' of an array access   * The expression in ''%%[]%%'' of an array access
Line 110: Line 109:
 $foo?->bar(expensive_function()); $foo?->bar(expensive_function());
 </code> </code>
-The evaluation of ''%%expensive_function()%%'' is undesirable if ''%%$foo%%'' is ''%%null%%'' as its result will simply be discarded. If the function has side effects it could also lead to surpsises.+The evaluation of ''%%expensive_function()%%'' is undesirable if ''%%$foo%%'' is ''%%null%%'' as its result will simply be discarded. If the function has side effects it could also lead to surprises.
  
 **2. You can see which methods/properties return null** **2. You can see which methods/properties return null**
Line 163: Line 162:
 ===== Syntax choice ===== ===== Syntax choice =====
  
-The ''%%?%%'' in ''%%?->%%'' denotes the precise place in the code where the short circuiting occurs. It closesly resembles the syntax of every other language that implements a nullsafe operator.+The ''%%?%%'' in ''%%?->%%'' denotes the precise place in the code where the short circuiting occurs. It closely resembles the syntax of every other language that implements a nullsafe operator.
  
 ===== Forbidden usages ===== ===== Forbidden usages =====
Line 233: 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="Add nullsafe operator to the language?" auth="ilutov" voteType="single" closed="true">+<doodle title="Add nullsafe operator to the language?" auth="ilutov" voteType="single" closed="false">
    * Yes    * Yes
    * No    * No
 </doodle> </doodle>
rfc/nullsafe_operator.txt · Last modified: 2020/07/31 08:55 by ilutov