ID:               20052
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         Zend Engine 2 problem
 Operating System: OS X 10.1
 PHP Version:      4CVS-2002-10-23
 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. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in PHP.




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

[2002-10-23 17:20:22] [EMAIL PROTECTED]

If a child class has a __construct() function, it won't make
use of its parent's __get() function (and presumably other
overload functions too). Workaround: add a __get() to the child class
and call parent::__get($property).

test code:

<?php
class a { function __get() { return 'a::_get'; } }
class b extends a { }
class c extends a { function __construct() { } }
class d extends a { function __construct() { } function __get($p) {
return parent::__get($p); } }
$a = new a;
print "a->foo = {$a->foo}\n";
$b = new b;
print "b->foo = {$b->foo}\n";
$c = new c;
print "c->foo = {$c->foo}\n";
$d = new d;
print "d->foo = {$d->foo}\n";
?>

output:

PHP Notice:  Undefined property:  foo in /full/path/overload.php on
line 11
overload.php(11) : Notice - Undefined property:  foo
a->foo = a::_get
b->foo = a::_get

Notice: Undefined property:  foo in /full/path/overload.php on line 11
c->foo =
d->foo = a::_get


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


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

Reply via email to