ID:               30428
 Updated by:       [EMAIL PROTECTED]
 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

Reply via email to