#30428 [Opn->Bgs]: __set()/__get property access

From: Date: Thu, 13 Jan 2005 00:16:47 +0000
Subject: #30428 [Opn->Bgs]: __set()/__get property access
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-72000@lists.php.net to get a copy of this message
ID: 30428 Updated by: tony2001@php.net Reported By: pavel at plpu dot permnet dot ru -Status: Open +Status: Bogus Bug Type: Zend Engine 2 problem Operating System: WinXP PHP Version: 5.0.1 New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Duplicate of #28444. Previous Comments: ------------------------------------------------------------------------ [2004-10-14 05:52:43] pavel at plpu dot permnet dot ru 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" !!! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30428&edit=1

« previous php.bugs (#72000) next »