- var_dump: documentation ( source)
<?php
class Foo {
public function bar() {
$that = $this;
return static function() use($that) { var_dump($that); };
}
public function baz() {
return function() { var_dump($this); };
}
}
$bar = $f->bar();
$bar();