mirror of
https://github.com/php/php-src.git
synced 2024-09-28 21:36:12 +00:00
ccc06e252b
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
|