xref: /PHP-7.4/Zend/tests/variadic/by_ref.phpt (revision 0d7a6388)
1--TEST--
2Variadic arguments with by-reference passing
3--FILE--
4<?php
5
6function test(&... $args) {
7    $i = 0;
8    foreach ($args as &$arg) {
9        $arg = $i++;
10    }
11}
12
13test();
14test($a);
15var_dump($a);
16test($b, $c, $d);
17var_dump($b, $c, $d);
18
19?>
20--EXPECT--
21int(0)
22int(0)
23int(1)
24int(2)
25