- var_dump: documentation ( source)
<?php
class b{
public $o;
public function __construct(){
$this->o = (object)array('id'=>12);
}
}
class foo {
private $b;
public function __construct(){
$this->b = new b();
}
public function bar(){
return $this->b;
}
}
$f = new foo();
var_dump( $f->bar()->o->id );