1--TEST-- 2Closure::fromCallable() and GC 3--FILE-- 4<?php 5 6class Test { 7 public function method() {} 8 9 public function method2($y) { 10 static $x; 11 $x = $y; 12 } 13} 14 15$fn = Closure::fromCallable([new Test, 'method2']); 16$fn($fn); 17unset($fn); // Still referenced from static var. 18gc_collect_cycles(); 19 20$fn = Closure::fromCallable([new Test, 'method']); 21$fn2 = $fn; unset($fn2); // Add to root buffer. 22gc_collect_cycles(); 23 24?> 25===DONE=== 26--EXPECT-- 27===DONE=== 28