mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02: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.
12 lines
207 B
PHP
12 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
|