3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<? Class D { public $data = 'data'; } Class T { public $firstChild; __construct(D $d) { $this->firstChild = $d; } } $d = new D; $item = new T($d); echo "$item->firstChild->data\n";
Output for 5.4.0 - 5.4.32
<? Class D { public $data = 'data'; } Class T { public $firstChild; __construct(D $d) { $this->firstChild = $d; } } $d = new D; $item = new T($d); echo "$item->firstChild->data\n";