Re: RFC Proposal - Attributes read/write visibility
| From: | Nikita Popov | Date: | Mon, 16 Jul 2012 13:11:55 +0000 |
| Subject: | Re: RFC Proposal - Attributes read/write visibility | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61292@lists.php.net to get a copy of this message | ||
On Sun, Jul 15, 2012 at 5:46 PM, Amaury Bouchard <amaury@amaury.net> wrote:
> Hi,
>
> Here is an RFC proposal about a syntax extension for PHP. The purpose is to
> manage precisely the visbiliy of attributes, by separating reading and
> writing access.
>
> First of all, I know there is already an RFC about attributes ("Property
> get/set syntax" [1]). Its goal is mainly different, but I'll discuss it
> lower.
I'm not sure I really understand what this adds over the existing
getter/setter proposal. read-only and write-only should cover the most
common cases. If you do need visibility control, it is possible too:
public $property {
get { ... }
protected set { ... }
}
So what does this proposal add to it?
Nikita