pdo()); /* (3) Check if the method exists */ if( !\method_exists($instance, $method) ) throw new \Exception("Repo '$repo' has no public method '$method'"); /* (4) Fetch response (send arguments as well) */ $response = call_user_func_array([$instance, $method], array_slice(func_get_args(), 2)); /* (5) Call post-script */ $instance = null; /* (6) Dispatch response */ return $response; } }