Re: [RFC Proposal] var keyword deprecation/removal
| From: | James Titcumb | Date: | Sun, 28 Feb 2016 09:49:59 +0000 |
| Subject: | Re: [RFC Proposal] var keyword deprecation/removal | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91450@lists.php.net to get a copy of this message | ||
On 28 Feb 2016 06:18, "Jakub Kubíček" <kelerest123@gmail.com> wrote:
>
> I see a difference in its
> _semantics_. While the
public modifier states anyone can change
> the
> property, var is useful for marking internal properties which
> must
> be public, but should not be manipulated by simply anybody
If it's public, it will be modified by someone. This isn't an intended
semantic meaning of var, and simply saying "don't modify this please" is
never going to be enough. Make them private, protected or public and make
your intent clear, because for anyone unfamiliar with this design will
simply translate var to mean public, and use it as such.