1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
Tim Düsterhus 8a87206211 reflection: Add ReflectionGenerator::isClosed() (#14358)
* reflection: Add `ReflectionGenerator::isClosed()`

see https://github.com/php/php-src/pull/14167#issuecomment-2133641998

* Fix test expectation

* Drop `{{{` / `}}}` comments around `ReflectionGenerator::isClosed()`
2024-05-29 19:07:09 +02:00

23 lines
302 B
PHP

--TEST--
ReflectionGenerator::getTrace()
--FILE--
<?php
function foo()
{
yield 1;
}
$g = foo();
$r = new ReflectionGenerator($g);
$g->next();
try {
$r->getTrace();
} catch (ReflectionException $e) {
echo $e->getMessage();
}
?>
--EXPECT--
Cannot fetch information from a closed Generator