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