fork download
  1. <?php
  2. class Foo {
  3. public $message = 'none';
  4.  
  5. public function __construct($message) {
  6. $this->message = $message;
  7. }
  8. }
  9.  
  10. $foo = new Foo('hello');
  11. $foo->bar = new Foo('bar');
  12.  
  13. var_dump($foo);
Success #stdin #stdout 0.02s 23444KB
stdin
Standard input is empty
stdout
object(Foo)#1 (2) {
  ["message"]=>
  string(5) "hello"
  ["bar"]=>
  object(Foo)#2 (1) {
    ["message"]=>
    string(3) "bar"
  }
}