1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
--TEST-- Testing recursion detection with Closures --FILE-- <?php $x = function () use (&$x) { $h = function () use ($x) { var_dump($x); return 1; }; return $h(); }; var_dump($x()); ?> --EXPECTF-- object(Closure)#%d (1) { ["static"]=> array(1) { ["x"]=> *RECURSION* } } int(1)