rfc:final_class_const
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:final_class_const [2021/05/04 15:06] – kocsismate | rfc:final_class_const [2021/05/19 08:00] – kocsismate | ||
---|---|---|---|
Line 2: | Line 2: | ||
* Date: 2021-04-23 | * Date: 2021-04-23 | ||
* Author: Máté Kocsis < | * Author: Máté Kocsis < | ||
- | * Status: | + | * Status: |
* Implementation: | * Implementation: | ||
+ | * Target Version: PHP 8.1 | ||
===== Introduction ===== | ===== Introduction ===== | ||
Line 11: | Line 12: | ||
First of all, the engine can't optimize class constant references when late static binding is involved, so it has to pessimistically assume that '' | First of all, the engine can't optimize class constant references when late static binding is involved, so it has to pessimistically assume that '' | ||
- | What's more important is that class constants are not guaranteed to stay constant. Even if one always references them by using '' | + | What's more important is that class constants are not guaranteed to stay constant. Even if the declaring class always references them by using '' |
- | An interesting fact is that interface constants are already '' | + | A related |
<code php> | <code php> | ||
Line 29: | Line 30: | ||
</ | </ | ||
- | This leads to an interesting | + | This leads to a weird inconsistency. By introducing an intermediate class, overriding still becomes possible: |
<code php> | <code php> | ||
Line 88: | Line 89: | ||
===== Reflection ===== | ===== Reflection ===== | ||
- | A '' | + | A '' |
===== Backward Incompatible Changes ===== | ===== Backward Incompatible Changes ===== | ||
Line 96: | Line 97: | ||
===== Vote ===== | ===== Vote ===== | ||
- | Add support for final class constants? | + | Voting started on 2021-05-19 08:00 UTC and ends 2021-06-02 08:00 UTC. The vote requires 2/3 majority to be accepted. |
+ | |||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
rfc/final_class_const.txt · Last modified: 2021/07/06 20:52 by kocsismate