- var_dump: documentation ( source)
<?php
class Test {
protected $resolver;
public function __construct(callable $resolver) {
$this->resolver = $resolver;
}
public function resolve($record) {
$this->resolver()($record);
}
}
$test = new Test(function($record) {
var_dump($record);
});
$test->resolve("hello");