summaryrefslogtreecommitdiff
path: root/Zend/tests/variadic/typehint_error.phpt
blob: 3006b999576c633b203d28d09f386e78d5b14321 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--TEST--
Variadic arguments enforce typehints
--FILE--
<?php

function test(array... $args) {
    var_dump($args);
}

test();
test([0], [1], [2]);
test([0], [1], 2);

?>
--EXPECTF--
array(0) {
}
array(3) {
  [0]=>
  array(1) {
    [0]=>
    int(0)
  }
  [1]=>
  array(1) {
    [0]=>
    int(1)
  }
  [2]=>
  array(1) {
    [0]=>
    int(2)
  }
}

Catchable fatal error: Argument 3 passed to test() must be of the type array, integer given, called in %s on line %d