1--TEST--
2Optional parameter before variadic parameter
3--FILE--
4<?php
5
6function f($reqParam, $optParam = null, ...$params) {
7    var_dump($reqParam, $optParam, $params);
8}
9
10f(1);
11f(1, 2);
12f(1, 2, 3);
13f(1, 2, 3, 4);
14f(1, 2, 3, 4, 5);
15
16?>
17--EXPECT--
18int(1)
19NULL
20array(0) {
21}
22int(1)
23int(2)
24array(0) {
25}
26int(1)
27int(2)
28array(1) {
29  [0]=>
30  int(3)
31}
32int(1)
33int(2)
34array(2) {
35  [0]=>
36  int(3)
37  [1]=>
38  int(4)
39}
40int(1)
41int(2)
42array(3) {
43  [0]=>
44  int(3)
45  [1]=>
46  int(4)
47  [2]=>
48  int(5)
49}
50