- var_dump: documentation ( source)
<?php
class x {
function __construct(){
$x=& $this;
$x = new y;
var_dump($this);
}
function foo(){
$this->bar();
}
}
class y{
function bar(){
echo "bar";
}
}
$b=new x;
$b->__construct();