PHP函数参数的3点

prg*_*grm 5 php

我正在查看 Laravel 代码并在 Authenticate.php 中间件中找到了这个:

  public function handle($request, Closure $next, ...$guards)
    {
        $this->authenticate($guards);

        return $next($request);
    }
Run Code Online (Sandbox Code Playgroud)

没见过这种东西,3点有什么作用?我用谷歌搜索但什么也没找到

Bra*_*ley 6

这是一个扩展运算符......这里是相关文档:http : //php.net/manual/en/functions.arguments.php#functions.variable-arg-list

它本质上是将一个数组转换为一组参数,或者将一组参数转换为一个数组。