- var_dump: documentation ( source)
<?php
class Foo {private $a=1;}
class Bar {
function test() {
var_dump($this);
}
}
$closure = (new \ReflectionMethod('Bar','test'))->getClosure(new Bar);
$object = new Foo;
$closure = $closure->bindTo($object, $object);
$closure();