ID: 40056 Updated by: [EMAIL PROTECTED] Reported By: bugs dot php dot net at andrewprendergast dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Linux Red Hat EL PHP Version: 5.2.1RC2 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The reasons this works is because the methods are not called directly but rather internally by the class handler. Because they are called by the class handler private/protected check works. Previous Comments: ------------------------------------------------------------------------ [2007-01-08 02:16:20] bugs dot php dot net at andrewprendergast dot com Description: ------------ The access modifiers public & private are ignored when used on the methods __set(), __get(), __isset() & __unset() allowing encapsulation to be breached. Reproduce code: --------------- Refer to example 19-20 http://au.php.net/manual/en/language.oop5.overloading.php Note that even though the __get() and __set() methods are defined as private, they can be invoked from outside the classs scope (by setting or getting an overloaded member variable). Expected result: ---------------- If __get() & __set() are defined private, then attempting to manipulate member variables with them from outside a class's scope should generate an error. Actual result: -------------- No error is generated. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40056&edit=1