|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-13 01:16 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 11:00:01 2025 UTC |
Description: ------------ sorry for bad English. I developing class library on PHP5. All objects in library have property with set()/get() access, and som property return objects. But isnt work ObjectA->propertyA->propertyB = "some value" if propertyA return object instance. simple example below Reproduce code: --------------- class A { private $_caption = "test"; function __set($name,$value){ if($name == "caption") $this->_caption = $value; } } class B { private $_A; function __construct(){ $this->_A = new A(); } function __get($name){ if($name == "A") return $this->_A; } } $B = new B(); //dont work!!!!!! // Cannot access undefined property for object with overloaded property access $B->A->caption = "test"; // OK !!!!! $T = $B->A; $T->caption = "test"; Expected result: ---------------- i think $Object->ObjectA->property = "" must work !!!!! its bug !!! this make __set()/__get() methods absolutely uneffective!!! why i cant write for ex. $Application->mainMenu->menuItem1->caption = "some" !!!