What about private final set($value) { } tells you that it's read only? There
is a setter.
From: Pierre Joye [mailto:[email protected]]
Sent: Thursday, October 11, 2012 12:05 AM
To: Clint Priest
Cc: PHP internals; Jazzer Dane
Subject: RE: [PHP-DEV] [RFC] Propety Accessors v1.1
On Oct 11, 2012 5:00 AM, "Clint Priest"
<[email protected]<mailto:[email protected]>> wrote:
>
> Why is everyone so dead set against read-only and write-only?
>
> I could not disagree more with you on what is "pretty" and "readable".
>
> To me:
>
> public read-only $hours {
> get { ... }
> }
>
> Is infinitely more readable and understandable than:
>
> public $hours {
> get() { ... }
> private final set($value) { ... }
> }
Fully agreed. It is obvious and clear like water.
Cheers,
Pierre