<?php class Aa { public $meme = 'pepe'; } class Bb { public $a; public function __constuct() { $a = new Aa(); $this->a = $a; } } $b = new Bb(); var_dump($b);
Standard input is empty
object(Bb)#1 (1) { ["a"]=> NULL }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!