Re: [RFC] Readonly Properties

From: Date: Fri, 24 Oct 2014 08:35:09 +0000
Subject: Re: [RFC] Readonly Properties
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-78294@lists.php.net to get a copy of this message
Hi, On Fri, Oct 24, 2014 at 2:36 AM, Andrea Faulds <ajf@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.. +1 I've always wanted this, it has never made sense to me to write numerous lines of code just to make an already declared property *readable* from outside a class. __get() has helped to some extent, but it has its disadvantages. Cheers, Andrey.

« previous php.internals (#78294) next »