rfc:dynamic_class_constant_fetch

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:dynamic_class_constant_fetch [2022/12/08 10:41] ilutovrfc:dynamic_class_constant_fetch [2023/02/02 17:17] (current) – Move to implemented ilutov
Line 3: Line 3:
   * Date: 2022-11-04   * Date: 2022-11-04
   * Author: Ilija Tovilo, tovilo.ilija@gmail.com   * Author: Ilija Tovilo, tovilo.ilija@gmail.com
-  * Status: Under discussion+  * Status: Implemented
   * Target Version: PHP 8.3   * Target Version: PHP 8.3
   * Implementation: https://github.com/php/php-src/pull/9793   * Implementation: https://github.com/php/php-src/pull/9793
Line 130: Line 130:
 </code> </code>
  
-Property and array accesses evaluate all expressions in the chain before performing any of the actual operations. The reason for this is rather [[https://www.npopov.com/2017/04/14/PHP-7-Virtual-machine.html#writes-and-memory-safety|technical]]. Basically, PHP needs to guarantee that no userland code runs between property or array accesses. This problem does not apply to class constants. Thus, the simpler and more intuitive in-order approach is chosen. Evaluation order for class constants is also unlikely to matter since chaining them is of dubious usefulness.+Property and array accesses evaluate all expressions in the chain before performing any of the actual operations. The reason for this is rather [[https://www.npopov.com/2017/04/14/PHP-7-Virtual-machine.html#writes-and-memory-safety|technical]]. Basically, no userland code must run between property or array accesses to avoid reallocation and thus potentially invalidating pointers. This problem does not apply to class constants. Thus, the simpler and more intuitive in-order approach is chosen. Evaluation order for class constants is also unlikely to matter since chaining them is of dubious usefulness.
  
 <code php> <code php>
Line 168: Line 168:
 ===== Vote ===== ===== Vote =====
  
-Voting starts ??? and ends ???+Voting starts 2022-12-22 and ends 2023-01-05
  
 As this is a language change, a 2/3 majority is required. As this is a language change, a 2/3 majority is required.
rfc/dynamic_class_constant_fetch.1670496114.txt.gz · Last modified: 2022/12/08 10:41 by ilutov