public function __call($method, $args) { $callback = array($this->__instance, $method); if (is_callable($callback)) { return call_user_func_array($callback, $args); } else { throw new \BadMethodCallException(sprintf('%s::%s() is not callable', get_class($this->__instance), $method)); } }