rfc:dynamic_class_constant_fetch
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:dynamic_class_constant_fetch [2022/11/04 14:15] – ilutov | rfc: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: | + | * Status: |
* Target Version: PHP 8.3 | * Target Version: PHP 8.3 | ||
* Implementation: | * Implementation: | ||
Line 53: | Line 53: | ||
==== {} expression type ==== | ==== {} expression type ==== | ||
- | The result of the expression in the braces < | + | The result of the expression in the braces < |
- | <php>Error</ | + | <php>TypeError</ |
<code php> | <code php> | ||
echo Foo::{[]}; | echo Foo::{[]}; | ||
- | // Error: Illegal offset | + | // TypeError: Cannot use value of type array as class constant name |
</ | </ | ||
Line 130: | Line 130: | ||
</ | </ | ||
- | Property and array accesses evaluate all expressions in the chain before performing any of the actual operations. | + | Property and array accesses evaluate all expressions in the chain before performing any of the actual operations. |
- | constants, order is less relevant because it's very rare for them to be chained. The simpler and more intuitive in-order | + | |
- | approach is chosen. | + | |
<code php> | <code php> | ||
Line 170: | Line 168: | ||
===== Vote ===== | ===== Vote ===== | ||
- | Voting starts | + | Voting starts |
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.txt · Last modified: 2023/02/02 17:17 by ilutov