1--TEST--
2Only arrays and Traversables can be unpacked
3--FILE--
4<?php
5
6function test(...$args) {
7    var_dump($args);
8}
9
10test(...null);
11test(...42);
12test(...new stdClass);
13
14test(1, 2, 3, ..."foo", ...[4, 5]);
15test(1, 2, 3, ...new StdClass, ...3.14, ...[4, 5]);
16
17?>
18--EXPECTF--
19Warning: Only arrays and Traversables can be unpacked in %s on line %d
20array(0) {
21}
22
23Warning: Only arrays and Traversables can be unpacked in %s on line %d
24array(0) {
25}
26
27Warning: Only arrays and Traversables can be unpacked in %s on line %d
28array(0) {
29}
30
31Warning: Only arrays and Traversables can be unpacked in %s on line %d
32array(5) {
33  [0]=>
34  int(1)
35  [1]=>
36  int(2)
37  [2]=>
38  int(3)
39  [3]=>
40  int(4)
41  [4]=>
42  int(5)
43}
44
45Warning: Only arrays and Traversables can be unpacked in %s on line %d
46
47Warning: Only arrays and Traversables can be unpacked in %s on line %d
48array(5) {
49  [0]=>
50  int(1)
51  [1]=>
52  int(2)
53  [2]=>
54  int(3)
55  [3]=>
56  int(4)
57  [4]=>
58  int(5)
59}
60