--TEST-- Closure 034: var_dump() of a Closure --FILE-- func1 = function($param, $other = "default") use ($outer) { }; } } $o = new Test; var_dump($o->func1); $o->func2 = function($param, $other = "default") use ($outer) { }; var_dump($o->func2); $func3 = function($param, $other = "default") use ($outer) { }; var_dump($func3); ?> ===DONE=== --EXPECTF-- object(Closure)#%d (3) { ["this"]=> object(Test)#%d (2) { ["func1"]=> object(Closure)#%d (3) { ["this"]=> object(Test)#%d (2) { ["func1"]=> object(Closure)#%d (3) { ["this"]=> *RECURSION* ["static"]=> array(1) { ["outer"]=> int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } ["var"]=> int(42) } ["static"]=> array(1) { ["outer"]=> int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } ["var"]=> int(42) } ["static"]=> array(1) { ["outer"]=> int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } object(Closure)#%d (3) { ["this"]=> object(Test)#%d (3) { ["func1"]=> object(Closure)#%d (3) { ["this"]=> object(Test)#%d (3) { ["func1"]=> object(Closure)#%d (3) { ["this"]=> *RECURSION* ["static"]=> array(1) { ["outer"]=> int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } ["var"]=> int(42) ["func2"]=> object(Closure)#%d (3) { ["this"]=> *RECURSION* ["static"]=> array(1) { ["outer"]=> &int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } } ["static"]=> array(1) { ["outer"]=> int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } ["var"]=> int(42) ["func2"]=> object(Closure)#%d (3) { ["this"]=> object(Test)#%d (3) { ["func1"]=> object(Closure)#%d (3) { ["this"]=> *RECURSION* ["static"]=> array(1) { ["outer"]=> int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } ["var"]=> int(42) ["func2"]=> object(Closure)#%d (3) { ["this"]=> *RECURSION* ["static"]=> array(1) { ["outer"]=> &int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } } ["static"]=> array(1) { ["outer"]=> &int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } } ["static"]=> array(1) { ["outer"]=> &int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } object(Closure)#%d (3) { ["this"]=> NULL ["static"]=> array(1) { ["outer"]=> int(25) } ["parameter"]=> array(2) { ["$param"]=> string(10) "" ["$other"]=> string(10) "" } } ===DONE===