From 3561bf9c17b657abd2913ff6074d88df50d5dc33 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Fri, 17 Jan 2025 13:49:07 +0100 Subject: [PATCH] Revert "Replace `call_user_func_array` with native invocation" --- src/Invoker.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); } /**