- var_dump: documentation ( source)
<?php
class Container {
protected $s=array();
function __set($k, $c) { $this->s[$k]=$c; }
function __get($k) { return $this->s[$k]($this); }
}
$c = new Container;
$c->something = function(){
return 'StdClass';
};
var_dump(new $c->something());