- var_dump: documentation ( source)
<?php
class Base {
public function __get($property) {
$reflector = new ReflectionObject($this);
if ($reflector->hasProperty($property)) {
return $reflector->getProperty($property)->getValue();
}
}
}
class Child extends Base {
private $test = 'This is a test.';
}
class Test extends Child {
}
$test = new Test;
var_dump($test->test);