On 24 October 2014 00:36:35 GMT+01:00, Andrea Faulds <a...@ajf.me> wrote:
>Good evening once again,
>
>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.
>
>If you are curious at all about the behaviour, I suggest perusing the
>fairly comprehensive set of twelve tests included in the main patch to
>php-src.
>
>Thanks!
>--
>Andrea Faulds
>http://ajf.me/

If nothing else, I like that this brings userland objects another step closer 
to those defined in extensions, which frequently use readonly properties.

I note that UString advertises a ->length rather than a ->getLength, and I 
haven't seen anyone in that thread object to that design decision, so I don't 
really buy the "you should never need this" argument.

The additional keyword and potential performance impact are more concerning, 
and will need to be weighed carefully against the benefits.


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to