Fields of extended class not instatiated

php.internals

Jan Schneider

23 years ago
This code run in current code (HEAD): class Foo { var $arr = array(); } class FooX extends Foo { function bar() { var_dump($this->arr); } } $foo = new FooX(); $foo->bar(); produces "NULL" as the output. I guess this is not the intended behaviour? Jan.
-- http://www.horde.org - The Horde Project http://www.ammma.de - discover your knowledge http://www.tip4all.de - Deine private Tippgemeinschaft

Zeev Suraski

23 years ago
Should be fixed now. Thanks for the test case! Zeev At 17:43 22/03/2003, Jan Schneider wrote:

Jan Schneider

23 years ago
Quoting Zeev Suraski <zeev@zend.com>:
> Should be fixed now. Thanks for the test case! > > Zeev > > At 17:43 22/03/2003, Jan Schneider wrote: > >This code run in current code (HEAD): > > > >class Foo { > > var $arr = array(); > >} > > > >class FooX extends Foo { > > function bar() > > { > > var_dump($this->arr); > > > > } > >} > > > >$foo = new FooX(); > >$foo->bar(); > > > >produces "NULL" as the output. I guess this is not the intended > behaviour?
Yes, works great now. Jan.
-- http://www.horde.org - The Horde Project http://www.ammma.de - discover your knowledge http://www.tip4all.de - Deine private Tippgemeinschaft