rfc:final_properties
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_properties [2020/02/18 13:29] – kocsismate | rfc:final_properties [2020/02/18 20:29] – kocsismate | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== PHP RFC: Final properties | + | ====== PHP RFC: Write-Once Properties |
* Version: 0.1 | * Version: 0.1 | ||
* Date: 2020-02-18 | * Date: 2020-02-18 | ||
Line 8: | Line 8: | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | This RFC proposes to add support for a new property modifier that would allow properties to be initialized, | + | This RFC proposes to add support for a new property modifier that would allow properties to be initialized, |
===== Proposal ===== | ===== Proposal ===== | ||
- | "Final" properties in PHP (the actual keyword is to be decided) could be initialized either by an explicit default value, or by assigning a value to them. Unlike to '' | + | "Write-once" properties in PHP (the actual keyword is to be decided) could be initialized either by an explicit default value, or by assigning a value to them. Unlike to '' |
- | As soon as initialization is done, any other attempt to assign a new value to "final" properties would result in an exception as it can be seen below: | + | As soon as initialization is done, any other attempt to assign a new value to "write-once" properties would result in an exception as it can be seen below: |
<code php> | <code php> |
rfc/final_properties.txt · Last modified: 2020/02/18 23:29 by kocsismate