Skip to content

Commit

Permalink
Merge pull request #54 from PHP-DI/revert-52-master
Browse files Browse the repository at this point in the history
Revert "Replace `call_user_func_array` with native invocation"
  • Loading branch information
mnapoli authored Jan 17, 2025
2 parents 93d381d + 3561bf9 commit 59f1560
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Invoker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -72,7 +71,7 @@ public function call($callable, array $parameters = [])
));
}

return $callable(...$args);
return call_user_func_array($callable, $args);
}

/**
Expand Down

0 comments on commit 59f1560

Please sign in to comment.