Re:What PHP 5.5 might look like
by jasonlotito on Thursday July 12, 2012 @10:06AM
(#4234537)
That's not what he's referring to. He's specifically referring to a read-only that only affects external classes. So, the object itself could write to that field, but nothing else could.
Re:What PHP 5.5 might look like
by shakesbeard on Thursday July 12, 2012 @10:17AM
(#4234593)
You can set the visibility of both the properties and the getters/setters.
class Foo {
private $fuzz;
protected $Bar {
get { return $this->fuzz; }
private set { $this->fuzz = $value; }
}
}
Re:What PHP 5.5 might look like
by jasonlotito on Thursday July 12, 2012 @10:20AM
(#4234605)
Yes. I understand that.
My point was just that he specifically wanted a read-only.
https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented