[ Mini Kiebo ]
Server: Windows NT AKFAR_SERVER 10.0 build 26200 (Windows 10) AMD64
Path:
D:
/
kmspico
/
release
/
dorams
/
geromi
/
vincent
/
[
Home
]
File: iterator_wrapper_leak.phpt
--TEST-- A generator iterator wrapper involved in a cycle should not leak --FILE-- <?php class Test { private $gen1; private $gen2; public function method() { $this->gen1 = (function () { yield 1; yield 2; yield 3; })(); $gen2 = function() { foreach ($this->gen1 as $x) { echo "$x\n"; yield $x; } }; $this->gen2 = $gen2(); foreach ($this->gen2 as $x) { if ($x == 2) { break; } } } } (new Test)->method(); gc_collect_cycles(); ?> --EXPECT-- 1 2