- var_dump: documentation ( source)
<?php
class Foo
{
protected $callback;
public function __construct()
{
$this->callback = function (Exception $e) {
var_dump($e);
};
}
public function test()
{
($this->callback)(new Exception);
}
}
(new Foo)->test();