### Description Found while looking at #9735 The following code: ```php <?php function f() { } $gen = function () use (&$gen) { f($gen, yield); }; $gen = $gen(); foreach ($gen as $value) { break; } $gen = null; gc_collect_cycles(); ``` Resulted in this output: ``` [Fri Oct 14 15:51:40 2022] Script: 'gen.php' Zend/zend_generators.c(409) : Freeing 0x00007fb3a365d3c0 (272 bytes), script=gen.php === Total 1 memory leaks detected === ``` But I expected this output instead: ``` ``` ### PHP Version PHP 8.1 24c297086d01811c5fd14ba3a3b9151759ab9c16 ### Operating System _No response_