From the manual Variable-length argument lists, there should only be one variable-length parameter as the last parameter of a function.
But why this opentelemetry-php api function:return $c(...$a, ...($a = [])); has two?
function trace(SpanInterface $span, Closure $closure, iterable $args = [])
{
$s = $span;
$c = $closure;
$a = $args;
unset($span, $closure, $args);
$scope = $s->activate();
try {
/** @psalm-suppress InvalidArgument */
return $c(...$a, ...($a = []));
} catch (Throwable $e) {
$s->setStatus(StatusCode::STATUS_ERROR, $e->getMessage());
$s->recordException($e, ['exception.escaped' => true]);
throw $e;
} finally {
$scope->detach();
$s->end();
}
}