Re: [RFC Proposal] var keyword deprecation/removal
| From: | Tony Marston | Date: | Mon, 29 Feb 2016 09:55:18 +0000 |
| Subject: | Re: [RFC Proposal] var keyword deprecation/removal | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91457@lists.php.net to get a copy of this message | ||
"James Titcumb" wrote in message news:CAKnqCEY7art1GUWG=Pm0wyPGQmYp0Dq8oxdohgBkSGq+O_BTZw@mail.gmail.com...
On 28 Feb 2016 06:18, "Jakub Kubícek" <kelerest123@gmail.com> wrote:Incorrect. It *may* be modified, but surely any invalid modifications will be detected in the testing phase?I see a difference in its _semantics_. While theIf it's public, it will be modified by someone.publicmodifier states anyone can change the property,varis useful for marking internal properties which must be public, but should not be manipulated by simply anybody
This isn't an intended semantic meaning ofIf "var" is automatically translated into "public", and has been since PHP 5 emerged, and has been documented to behave in this way, then what does it cost to leave it that way? Answer: NOTHING! -- Tony Marstonvar, 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 translatevarto meanpublic, and use it as such.