On 24/10/2014 00:36, Andrea Faulds wrote:
Here’s another RFC: https://wiki.php.net/rfc/readonly_properties
It proposes, with a working implementation, a modifier for properties
that makes them readable and writeable from different scopes.
Since I am a big proponent of including specification patches in new
RFCs, I have decided to put my money (or rather, time) where my mouth
is and I have actually written a specification patch before writing
an RFC. I would love to see this become the new standard for RFCs
affecting the language.
Thanks for the work (again). It's an interesting small idea but I'd much
prefer revisiting the original getter/setter RFC [1] which had a
majority but just fell short of the 66% mark.
This RFC only implements parts of the getter/setter functionality
(readonly properties) but it does not address the fact that sometimes
you want to add logic to a setter or a getter and if you don't have
language level getters/setters you end up having to change the interface
of the object from a public property to a getFoo/setFoo pair.
This leads to everyone having getFoo/setFoo by default just to avoid
interface changes or mixed interfaces of public properties and setFoo.
[1] https://wiki.php.net/rfc/propertygetsetsyntax-v1.2
Cheers
--
Jordi Boggiano
@seldaek - http://nelm.io/jordi
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php