rfc:typed_properties_v2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:typed_properties_v2 [2019/01/03 14:20] – add errata: runtime-evaluated default values nikic | rfc:typed_properties_v2 [2019/01/10 19:00] – typos nikic | ||
---|---|---|---|
Line 1257: | Line 1257: | ||
==== Automatic promotion of arrays and objects ==== | ==== Automatic promotion of arrays and objects ==== | ||
- | PHP automatically initializes falsy values that are used as arrays or object | + | PHP automatically initializes falsy values that are used as arrays or objects |
<code php> | <code php> | ||
Line 1296: | Line 1296: | ||
The reason for this choice is that evaluation of constant expressions at compile-time vs run-time is an optimization choice and should not result in behavioral differences. Whether a constant expression is evaluated during compilation depends on many factors, including code order and whether or not opcache is enabled. We believe that the current behavior of parameters is a bug, not an intentional choice. | The reason for this choice is that evaluation of constant expressions at compile-time vs run-time is an optimization choice and should not result in behavioral differences. Whether a constant expression is evaluated during compilation depends on many factors, including code order and whether or not opcache is enabled. We believe that the current behavior of parameters is a bug, not an intentional choice. | ||
+ | |||
+ | ==== Incrementing/ | ||
+ | |||
+ | When a value is incremented beyond '' | ||
+ | |||
+ | As stated, this would result in the following peculiar behavior: Incrementing an '' | ||
+ | |||
+ | As such, we would always generate an error on increment/ | ||
+ | |||
+ | To avoid this, we instead define that incrementing/ | ||
===== Changelog ===== | ===== Changelog ===== | ||
Line 1301: | Line 1311: | ||
Significant changes to the RFC are noted here. | Significant changes to the RFC are noted here. | ||
- | * 2018-01-03: Add errata: Strictness of runtime-evaluated default values. | + | * 2019-01-07: Add errata: Increment/ |
- | * 2018-01-03: Add errata: Automatic promotion of arrays and objects. | + | * 2019-01-03: Add errata: Strictness of runtime-evaluated default values. |
+ | * 2019-01-03: Add errata: Automatic promotion of arrays and objects. | ||
* 2018-07-16: Add note about compatibility requirement on properties coming from traits. | * 2018-07-16: Add note about compatibility requirement on properties coming from traits. | ||
* 2018-07-10: Add shim header to make porting extension easy. | * 2018-07-10: Add shim header to make porting extension easy. |
rfc/typed_properties_v2.txt · Last modified: 2019/01/11 16:16 by nikic