instance = $instance; $this->reflection = new ReflectionClass($instance); } public function __get($name) { $property = $this->reflection->getProperty($name); $property->setAccessible(true); return $property->getValue($this->instance); } public function __call($name, $arguments) { $method = $this->reflection->getMethod($name); $method->setAccessible(true); return $method->invokeArgs($this->instance, $arguments); } }