# Fields of extended class not instatiated

- Thread: https://externals.io/message/154
- Original archive: https://news-web.php.net/php.internals/154
- Started by Jan Schneider on 2003-03-22T23:43:54+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #154 — Jan Schneider — 2003-03-22T23:43:54+00:00

URL: https://externals.io/message/154#154

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

---

## #158 — Zeev Suraski — 2003-03-23T01:26:42+00:00

URL: https://externals.io/message/154#158 · In reply to: #154

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?
>
>Jan.
>
>--
>http://www.horde.org - The Horde Project
>http://www.ammma.de - discover your knowledge
>http://www.tip4all.de - Deine private Tippgemeinschaft
