[RFC] Accessors : read-only / write-only keywords
| From: | Clint Priest | Date: | Fri, 19 Oct 2012 23:07:21 +0000 |
| Subject: | [RFC] Accessors : read-only / write-only keywords | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-63548@lists.php.net to get a copy of this message | ||
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