diff --git a/src/Invoker.php b/src/Invoker.php index 2ae50df..f7957b7 100644 --- a/src/Invoker.php +++ b/src/Invoker.php @@ -57,8 +57,7 @@ public function call($callable, array $parameters = []) $args = $this->parameterResolver->getParameters($callableReflection, $parameters, []); - // Sort by array keys is needed since the resolved arguments returned by the resolver are indexed by numeric keys - // that correspond to the parameters of the callable, but may be out of order. + // Sort by array key because call_user_func_array ignores numeric keys ksort($args); // Check all parameters are resolved @@ -72,7 +71,7 @@ public function call($callable, array $parameters = []) )); } - return $callable(...$args); + return call_user_func_array($callable, $args); } /**