xref: /PHP-8.2/Zend/tests/closure_035.phpt (revision f8d79582)
1--TEST--
2Testing 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
14var_dump($x());
15
16?>
17--EXPECTF--
18object(Closure)#%d (1) {
19  ["static"]=>
20  array(1) {
21    ["x"]=>
22    *RECURSION*
23  }
24}
25int(1)
26