summaryrefslogtreecommitdiff
path: root/Zend/tests/arg_unpack/method.phpt
blob: fb9ace83782627a4088febc7a2e9df2d550857f2 (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
--TEST--
Unpack arguments for method calls
--FILE--
<?php

class Foo {
    public function test(...$args) {
        var_dump($args);
    }

    public static function test2(...$args) {
        var_dump($args);
    }
}

$foo = new Foo;
Foo::test2(1, 2, ...[3, 4], ...[], ...[5]);

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