php-src/Zend/tests/generators/yield_from_by_reference.phpt
Nikita Popov ccc06e252b Forbid yield from in by-reference generators
The current yield from implementation doesn't support by-ref
yields. It's likely not worthwhile to actually implement this,
but we should at least keep the door open for the future by
issuing a compile error.

Refs bug #71252.
2016-02-12 17:55:29 +01:00

13 lines
207 B
PHP

--TEST--
Yield from by reference is not supported
--FILE--
<?php
function &gen() {
yield from [];
}
?>
--EXPECTF--
Fatal error: Cannot use "yield from" inside a by-reference generator in %s on line %d