mirror of
https://github.com/php/php-src.git
synced 2025-01-05 18:33:56 +08:00
22 lines
431 B
PHP
22 lines
431 B
PHP
--TEST--
|
|
Bug #72684 (AppendIterator segfault with closed generator)
|
|
--FILE--
|
|
<?php
|
|
|
|
function createGenerator() { yield 1; }
|
|
$generator = createGenerator();
|
|
|
|
$appendIterator = new AppendIterator();
|
|
$appendIterator->append($generator);
|
|
|
|
iterator_to_array($appendIterator);
|
|
try {
|
|
iterator_to_array($appendIterator);
|
|
} catch (\Exception $e) {
|
|
echo $e->getMessage();
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Cannot traverse an already closed generator
|