php-8.0.30-src/Zend/tests/generators/yield_from_non_iterable.phpt

19 lines
252 B
PHP

--TEST--
Yield from non-iterable
--FILE--
<?php
function gen() {
yield from new stdClass;
}
try {
gen()->current();
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Can use "yield from" only with arrays and Traversables