- var_dump: documentation ( source)
<?php
class foo
{
protected $bar = 'A bar';
public function getBarDumper()
{
$that = $this;
return function() use ($that) { var_dump($that->bar); };
}
}
$foo = new foo();
$bar = $foo->getBarDumper();
$bar();
?>