mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
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.
13 lines
207 B
PHP
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
|