php-src/ext/zend_test/tests/zend_legacy_iterable.phpt
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
507 B
PHP

--TEST--
Test that legacy IS_ITERABLE arg info type generates a notice
--EXTENSIONS--
zend_test
--FILE--
<?php
function gen() {
yield 1;
};
var_dump(zend_iterable_legacy([], null));
var_dump(zend_iterable_legacy([], []));
var_dump(zend_iterable_legacy(gen(), null));
var_dump(zend_iterable_legacy(gen(), gen()));
?>
==DONE==
--EXPECTF--
array(0) {
}
array(0) {
}
object(Generator)#%d (1) {
["function"]=>
string(3) "gen"
}
object(Generator)#%d (1) {
["function"]=>
string(3) "gen"
}
==DONE==