1--TEST--
2Unpack iterator by reference with type check
3--FILE--
4<?php
5function test(T &$a) {
6}
7function gen() {
8    yield null;
9}
10try {
11    test(...gen());
12} catch (TypeError $e) {
13    echo $e->getMessage(), "\n";
14}
15?>
16--EXPECTF--
17Warning: Cannot pass by-reference argument 1 of test() by unpacking a Traversable, passing by-value instead in %s on line %d
18test(): Argument #1 ($a) must be of type T, null given, called in %s on line %d
19