function sum(int ...$nums)
{
return array_sum($nums);
}
try {
echo sum(...nums:1,2,3,5); //这句报错,不知那里的问题。
} catch (\Throwable $th) {
echo $th->getMessage();
}
Parse error: syntax error, unexpected ':', expecting ')' in D:\phpstudy_pro\WWW\yhj.php on line 52