1234567891011
<?phpfunction sum(...$numbers) { $acc = 0; foreach ($numbers as $n) { $acc += $n; } return $acc;}echo sum(1, 2, 3, 4);?>
1
10
12345678910
<?phpfunction add($a, $b) { return $a + $b;}echo add(...[1, 2])."\n";$a = [1, 2];echo add(...$a);?>
12
33