<?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);
You have javascript disabled. You will not be able to edit any code.