|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-05-02 21:12 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Fri Aug 28 17:00:02 2026 UTC |
Description: ------------ It seems like objects of the same class can access private variables in each other. Access rights check is based on class name instead of reference? Reproduce code: --------------- <?php class strange { private $_amount = 10; public function foo($other) { echo $other->_amount; $other->_amount = 666; } } $t = new strange(); $t->foo(new strange()); ?> Expected result: ---------------- fatal error Actual result: -------------- 10