- var_dump: documentation ( source)
<?php
class Bar
{
public function foo()
{
return 1;
}
public function get($context)
{
$f = function() {
var_dump($this->foo(), static::foo());
return $this->foo() === static::foo();
};
$f->bindTo($context);
return $f;
}
}
class Baz
{
public function foo()
{
return 2;
}
}
$bar = new Bar;
$baz = new Baz;
var_dump(call_user_func($bar->get($baz)));