Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Replace call_user_func_array with native invocation" #54

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading