"James Titcumb" wrote in message news:CAKnqCEY7art1GUWG=pm0wypgqmyp0dq8oxdohgbksgq+o_b...@mail.gmail.com...

On 28 Feb 2016 06:18, "Jakub Kubícek" <kelerest...@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.

Incorrect. It *may* be modified, but surely any invalid modifications will be detected in the testing phase?

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.

If "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 Marston


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to