Re: [RFC] Accessors : read-only / write-only keywords

From: Date: Sat, 20 Oct 2012 07:29:49 +0000
Subject: Re: [RFC] Accessors : read-only / write-only keywords
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-63549@lists.php.net to get a copy of this message
read-only => final set null; It begins to be verbose. As I said many times, why don't you want to use the "const" keyword? It already exists and is pretty well understood by everybody. 2012/10/20 Clint Priest <cpriest@zerocue.com> > I had thought of a deviation on some of the ideas presented to get rid of > read-only/write-only while still keeping the ability to maintain their > effect, if we so decide that the feature is wanted. Here it is: > > class TimePeriod { > private $Seconds; > > public $Hours { > get() { return $this->Hours; } > final set NULL; > } > } > > It's close to what's been suggested but is pretty clear that there IS NO > SETTER it could not be called within the class and since its final it > cannot be over-ridden. I've included this in the change tracking document. > > Thoughts? > > -Clint > > >

« previous php.internals (#63549) next »