rfc:arbitrary_static_variable_initializers

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:arbitrary_static_variable_initializers [2023/03/17 13:28] – Adjust destructor example ilutovrfc:arbitrary_static_variable_initializers [2023/05/24 18:29] (current) – Move to implemented ilutov
Line 3: Line 3:
   * Date: 2022-11-06   * Date: 2022-11-06
   * 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/9301   * Implementation: https://github.com/php/php-src/pull/9301
Line 70: Line 70:
 </code> </code>
  
-The static variable is overridden at compile time resulting in both statements to refer to the same underlying static+The static variable is overridden at compile timeresulting in both statements referring to the same underlying static
 variable initializer. This is not useful or intuitive. The new implementation is not compatible with this behavior but variable initializer. This is not useful or intuitive. The new implementation is not compatible with this behavior but
 would instead result in the first initializer to win. Instead of switching from one dubious behavior to another, would instead result in the first initializer to win. Instead of switching from one dubious behavior to another,
Line 85: Line 85:
 ==== ReflectionFunction::getStaticVariables() ==== ==== ReflectionFunction::getStaticVariables() ====
  
-<php>ReflectionFunction::getStaticVariables()</php> can be used to inspect a functions static variables and their+<php>ReflectionFunction::getStaticVariables()</php> can be used to inspect a function'static variables and their
 current values. Currently, PHP automatically evaluates the underlying constant expression and initializes the static current values. Currently, PHP automatically evaluates the underlying constant expression and initializes the static
 variable if the function has never been called. With this RFC this is no longer possible, as static variables may depend variable if the function has never been called. With this RFC this is no longer possible, as static variables may depend
Line 225: Line 225:
 ===== Vote ===== ===== Vote =====
  
-Voting starts ??? and ends ???+Voting starts 2023-03-21 and ends 2023-04-04
  
 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/arbitrary_static_variable_initializers.1679059734.txt.gz · Last modified: 2023/03/17 13:28 by ilutov