ID:               28444
 Updated by:       [EMAIL PROTECTED]
 Reported By:      dennis at inmarket dot lviv dot ua
-Status:           Open
+Status:           Analyzed
 Bug Type:         Class/Object related
 Operating System: WinXP
 PHP Version:      5.0.0RC2
 New Comment:

The problem here is that it is unclear what actually should happen in
this case. When executing $y->x->x = 3, we need to fetch $y->x for
writing, i.e., get zval** of it. However, only handler that could give
it to us is get_property_ptr_ptr  and it is not overridable. 
We probably could use the result of __get, though it would mean we
would have to fake zval**, which could have some strange consequences -
needs to be checked.


Previous Comments:
------------------------------------------------------------------------

[2004-05-19 12:34:23] dennis at inmarket dot lviv dot ua

Description:
------------
"Cannot access undefined property for object with overloaded property
access" is an error when I try to set a property of an instance, which,
in turn, is a property of another instance of an overloaded class, i.e.
$a->x->y = 2 triggers the error if $a is an instance of an overloaded
class. Note that getting that property works fine.

Reproduce code:
---------------
class Object {
  public $x;
  function __construct($x) {
    $this->x = $x;
  }
}
class Overloaded {
  var $props;
  function __construct($x) {
    $this->x = new Object($x);
  }
  function __get($prop) {
    return $this->props[$prop];
  }
  function __set($prop, $val) {
    $this->props[$prop] = $val;
  }
}
$y = new Overloaded(2);
echo $y->x->x, " "; // Prints 2...
echo $y->x->x = 3; //Should print 3...

Expected result:
----------------
2 3

Actual result:
--------------
2
Fatal error: Cannot access undefined property for object with
overloaded property access in path/to/script.php on line 22


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28444&edit=1

Reply via email to