rfc:fetch_property_in_const_expressions

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:fetch_property_in_const_expressions [2022/06/23 11:13] – Add sentence that support can be extended ilutovrfc:fetch_property_in_const_expressions [2022/07/15 18:14] – Move to accepted ilutov
Line 2: Line 2:
   * Date: 2022-05-27   * Date: 2022-05-27
   * Author: Ilija Tovilo <ilutov@php.net>   * Author: Ilija Tovilo <ilutov@php.net>
-  * Status: Under discussion+  * Status: Accepted
   * Proposed Version: PHP 8.2   * Proposed Version: PHP 8.2
   * Implementation: https://github.com/php/php-src/pull/8625   * Implementation: https://github.com/php/php-src/pull/8625
Line 95: Line 95:
  
   - Order of evaluation   - Order of evaluation
-  - Cache invalidation+  - Caching of constant expression values
  
 Once we have a solution for these two problems we can extend support of ''->'' in constant expressions to all objects. Once we have a solution for these two problems we can extend support of ''->'' in constant expressions to all objects.
Line 155: Line 155:
 ==== Allow all readonly properties ==== ==== Allow all readonly properties ====
  
-It was suggested that instead of restricting ''->'' to be used on all non-enums to restrict access to just non-''readonly'' properties. Unfortunately, this doesn't solve the caching problem described above as ''readonly'' properties can be initialized after object construction and thus becomes non-pure.+It was suggested that instead of restricting ''->'' to be used on all non-enums to restrict access to just non-''readonly'' properties. Unfortunately, this doesn't solve the caching problem described above as ''readonly'' properties can be initialized after object construction and thus becomes non-pure. The enum ''name'' and ''value'' properties are automatically initialized by the engine and thus are truly immutable.
  
 <PHP> <PHP>
Line 188: Line 188:
 ===== Vote ===== ===== Vote =====
  
-Voting opened on xxx and closes on xxx.+Voting opened on 2022-07-01 and closes on 2022-07-15.
  
 <doodle title="Add support for fetching properties of enums in constant expressions?" auth="ilutov" voteType="single" closed="true"> <doodle title="Add support for fetching properties of enums in constant expressions?" auth="ilutov" voteType="single" closed="true">
rfc/fetch_property_in_const_expressions.txt · Last modified: 2022/07/18 21:57 by ilutov