rfc:propertygetsetsyntax-as-implemented:change-requests
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:propertygetsetsyntax-as-implemented:change-requests [2012/12/29 20:48] – [read-only / write-only keywords] cpriest | rfc:propertygetsetsyntax-as-implemented:change-requests [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 8: | Line 8: | ||
< | < | ||
- | Change | + | Allow syntax to use parenthesized syntax as well so that both a [TypeHint] and $value |
<code php> | <code php> | ||
class TimePeriod { | class TimePeriod { | ||
Line 21: | Line 22: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | The abbreviated syntax is also allowed as per 1.1 RFC. | ||
==== read-only / write-only keywords ==== | ==== read-only / write-only keywords ==== | ||
Line 41: | Line 44: | ||
==== Automatically Implemented Accessors ==== | ==== Automatically Implemented Accessors ==== | ||
+ | [[https:// | ||
+ | |||
v1.1 properties shadow (or over-ride) accessors, so if an accessor exists and a property is defined (only possible from within the accessors setter), then the property would shadow the accessor. | v1.1 properties shadow (or over-ride) accessors, so if an accessor exists and a property is defined (only possible from within the accessors setter), then the property would shadow the accessor. | ||
Line 72: | Line 77: | ||
==== Shadowing ==== | ==== Shadowing ==== | ||
+ | [[https:// | ||
+ | |||
Accessors will shadow properties such that if a property named $foo is declared and an accessor for $foo is declared, the accessor will be used instead, only the accessor will have direct access to the underlying property. | Accessors will shadow properties such that if a property named $foo is declared and an accessor for $foo is declared, the accessor will be used instead, only the accessor will have direct access to the underlying property. | ||
Line 90: | Line 97: | ||
==== isset / unset / attempted writes when no setter / attempted reads when no getter ==== | ==== isset / unset / attempted writes when no setter / attempted reads when no getter ==== | ||
+ | [[https:// | ||
Invalid calls to isset/unset will fail silently and return false in the case of isset(), no warning/ | Invalid calls to isset/unset will fail silently and return false in the case of isset(), no warning/ | ||
Line 113: | Line 121: | ||
==== Interfaces ==== | ==== Interfaces ==== | ||
+ | [[https:// | ||
An implementing class may specify a property with an appropriate access level to satisfy an accessor declaration requirement of an interface. | An implementing class may specify a property with an appropriate access level to satisfy an accessor declaration requirement of an interface. | ||
Line 163: | Line 172: | ||
Stas suggested that he could either help me to implement this more appropriately (such as changing the engine to make calls into zend_object_handler.c) so that these calls can be resolved dynamically, | Stas suggested that he could either help me to implement this more appropriately (such as changing the engine to make calls into zend_object_handler.c) so that these calls can be resolved dynamically, | ||
+ | **Update 12/ | ||
===== TODO ===== | ===== TODO ===== | ||
- | - Exceptions thrown from an accessor reveal underlying implementation details | + | - <del>Exceptions thrown from an accessor reveal underlying implementation details</ |
- | - get_class_methods() - hide accessors or re-write to call into Reflection* code? | + | - <del>get_class_methods() - hide accessors or re-write to call into Reflection* code?</ |
- | - Check debug_backtrace() output as well | + | - <del>Check debug_backtrace() output as well</ |
- | - Add notes to RFC on shadowing behavior of properties and acessors | + | - <del>Add notes to RFC on shadowing behavior of properties and acessors |
- < | - < | ||
- | - Check that the following should work and write tests for them: | + | - <del>Check that the following should work and write tests for them:</ |
- < | - < | ||
- < | - < | ||
Line 176: | Line 185: | ||
- < | - < | ||
- < | - < | ||
- | - $foo-> | + | - <del>$foo-> |
- | - Expand on the "Error Messaging" | + | - <del>Expand on the "Error Messaging" |
- < | - < | ||
rfc/propertygetsetsyntax-as-implemented/change-requests.1356814134.txt.gz · Last modified: 2017/09/22 13:28 (external edit)