1--TEST--
2Variadic arguments enforce types
3--FILE--
4<?php
5
6function test(array... $args) {
7    var_dump($args);
8}
9
10test();
11test([0], [1], [2]);
12test([0], [1], 2);
13
14?>
15--EXPECTF--
16array(0) {
17}
18array(3) {
19  [0]=>
20  array(1) {
21    [0]=>
22    int(0)
23  }
24  [1]=>
25  array(1) {
26    [0]=>
27    int(1)
28  }
29  [2]=>
30  array(1) {
31    [0]=>
32    int(2)
33  }
34}
35
36Fatal error: Uncaught TypeError: test(): Argument #3 must be of type array, int given, called in %s:%d
37Stack trace:
38#0 %s(%d): test(Array, Array, 2)
39#1 {main}
40  thrown in %s on line %d
41