- var_dump: documentation ( source)
<?php
function inspect($object, $property) {
return (function () use ($property) {
return $this->$property;
})->call($object);
}
class Foo {
private $bar = "hands off!";
}
var_dump(inspect(new Foo(), "bar"));