php-src/Zend/zend_generators.stub.php
Tim Düsterhus 8094bd1b58
Make ReflectionGenerator::getFunction() legal after generator termination (#14167)
* Make `ReflectionGenerator::getFunction()` legal after generator termination

* Expose the generator function name via `Generator::__debugInfo()`

* Allow creating `ReflectionGenerator` after termination

* Reorder `struct _zend_generator` to avoid a hole

* Adjust `ext/reflection/tests/028.phpt`

This is legal now.

* Fix Generator Closure collection

* Add test to verify the Closure dies with the generator

* NEWS / UPGRADING
2024-05-21 08:54:51 +02:00

33 lines
578 B
PHP

<?php
/** @generate-class-entries */
/**
* @strict-properties
* @not-serializable
*/
final class Generator implements Iterator
{
public function rewind(): void {}
public function valid(): bool {}
public function current(): mixed {}
public function key(): mixed {}
public function next(): void {}
public function send(mixed $value): mixed {}
public function throw(Throwable $exception): mixed {}
public function getReturn(): mixed {}
public function __debugInfo(): array {}
}
class ClosedGeneratorException extends Exception
{
}