mirror of
https://github.com/php/php-src.git
synced 2024-10-17 14:32:37 +00:00
32 lines
412 B
Plaintext
32 lines
412 B
Plaintext
|
--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) {
|
||
|
[%u|b%"x"]=>
|
||
|
&object(Closure)#%d (1) {
|
||
|
["static"]=>
|
||
|
array(1) {
|
||
|
[%u|b%"x"]=>
|
||
|
*RECURSION*
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
int(1)
|