- var_dump: documentation ( source)
<?php
class FooBar
{
public function __destruct()
{
var_dump('I\'m Dead!!!');
}
}
$foo = new FooBar();
$closure = (new ReflectionFunction('strlen'))->getClosure()->bindTo($foo);
var_dump($closure('foo'), (new ReflectionFunction($closure))->getClosureScopeClass(), (new ReflectionFunction($closure))->getClosureThis());