Hy,

a friend of mine asked me why someone can change private and protected properties from an class within PHP.

From my understanding of OOP and class handling a private property must not
be changed or visible from outside the class.
And protected properties should only be visible and changeable from the own or an extended class.

This was the reason why I was wondering as my friend showed me how to access and change private properties...

He also made an entry within bugs.php.net but the php developers said this is no bug but a feature and closed the issue.
http://bugs.php.net/bug.php?id=40402

So I would like to ask the community what do you think...
Changing and accessing private properties from everywhere outside the class object ??
Is this normal behaviour ??
Was my prof at the university wrong with standard oop definitions ??

Greetings
Thomas

Reply via email to