This is also easily achieved through the Reflection API and is a designed feature.

The purpose of private/protected modifiers is ONLY to help developers use classes as intended. It is not a security model in any way shape or form.

Kevin McArthur
----- Original Message ----- From: "Stanislav Malyshev" <[EMAIL PROTECTED]>
To: "Thomas Weidner" <[EMAIL PROTECTED]>
Cc: <fw-general@lists.zend.com>
Sent: Thursday, February 08, 2007 12:59 PM
Subject: Re: [fw-general] PHP5 Security


First of all, I think it is important to note that this has nothing to do with security. Anyone who relies on OOP visibility features for any security is making a serious mistake, these are not security features and should not be used as such.

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.

Yes, and it is - unless you employ some trickery outside of the context of OO. You shouldn't do that unless you know what you are doing.

Changing and accessing private properties from everywhere outside the class object ??
Is this normal behaviour ??

No, it's not normal - this is why you have to employ non-normal code to achieve it.
--
Stanislav Malyshev, Zend Products Engineer
[EMAIL PROTECTED]  http://www.zend.com/


Reply via email to