xref: /PHP-7.4/Zend/tests/bug75786.phpt (revision fd30c59e)
1--TEST--
2Bug #75786: segfault when using spread operator on generator passed by reference
3--FILE--
4<?php
5
6function &gen($items) {
7    foreach ($items as $key => &$value) {
8        yield $key => $value;
9    }
10}
11
12var_dump(...gen(['a', 'b', 'c']));
13
14?>
15--EXPECT--
16string(1) "a"
17string(1) "b"
18string(1) "c"
19