1--TEST-- 2Bug GH-9750 003 (Generator memory leak when interrupted during argument evaluation) 3--FILE-- 4<?php 5 6function f() { 7} 8 9class C { 10 function __destruct() { 11 echo __METHOD__, "\n"; 12 } 13} 14 15$gen = function ($c) use (&$gen) { 16 f(f($gen, yield)); 17}; 18 19$gen = $gen(new C()); 20 21foreach ($gen as $value) { 22 break; 23} 24 25$gen = null; 26 27gc_collect_cycles(); 28 29?> 30==DONE== 31--EXPECT-- 32C::__destruct 33==DONE== 34