I noticed that Joomla uses less secure var
type for variables in classes
Why is this?
In my own components,plugins,modules
should I follow this convention or use a more secure private, public and protected keywords.
I noticed that Joomla uses less secure var
type for variables in classes
Why is this?
In my own components,plugins,modules
should I follow this convention or use a more secure private, public and protected keywords.
That is to be compatible with PHP4, which does not allow access modifiers and relies on the var keyword. See requirements here: http://www.joomla.org/technical-requirements.html, they support PHP4, though they do not recommend it.
Joomla's roots are in PHP 4, (and as @Palantir notes, they even still support it!).
It is very difficult to "add" PHP 5's new OOP features like private
/ public
/ protected
to a complex system like that. There are too many dependencies to be aware of, and too much potential for obscure bugs.
They will probably start appearing in the future when PHP 4 support is dropped (shouldn't be long anymore), and parts of the system undergo a fundamental rewrite.