Return to closure_035.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests |
1.1 ! misho 1: --TEST-- ! 2: Testing recursion detection with Closures ! 3: --FILE-- ! 4: <?php ! 5: ! 6: $x = function () use (&$x) { ! 7: $h = function () use ($x) { ! 8: var_dump($x); ! 9: return 1; ! 10: }; ! 11: return $h(); ! 12: }; ! 13: ! 14: var_dump($x()); ! 15: ! 16: ?> ! 17: --EXPECTF-- ! 18: object(Closure)#%d (1) { ! 19: ["static"]=> ! 20: array(1) { ! 21: ["x"]=> ! 22: *RECURSION* ! 23: } ! 24: } ! 25: int(1)