closure_035.phpt 322 B

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