ID: 45648 Updated by: [EMAIL PROTECTED] Reported By: gwd at heex dot pl -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Win XP PHP Version: 5.2.6 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 Visibility is bound to the class, not the object. Previous Comments: ------------------------------------------------------------------------ [2008-07-28 18:21:46] gwd at heex dot pl Description: ------------ Private/protected property/method is visible in methods of another object of that same class Reproduce code: --------------- class A { private $sameVar = "it's private variable!<br>"; private function testMthd () { echo "it's private method!<br>"; } public function testVar($otherObj) { echo $otherObj->sameVar; $otherObj->testMthd(); } } $sm1 = new A(); $sm2 = new A(); $sm1->testVar($sm2); Expected result: ---------------- it should rise an "Fatal error: Cannot access private property" Actual result: -------------- it's private variable! it's private method! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45648&edit=1