php-src/Zend/tests/closure_035.phpt

26 lines
301 B
Plaintext
Raw Normal View History

2009-12-21 06:04:55 +08:00
--TEST--
Testing recursion detection with Closures
--FILE--
<?php
$x = function () use (&$x) {
$h = function () use ($x) {
var_dump($x);
return 1;
2018-09-17 01:16:42 +08:00
};
2009-12-21 06:04:55 +08:00
return $h();
};
var_dump($x());
?>
--EXPECTF--
object(Closure)#%d (1) {
["static"]=>
array(1) {
["x"]=>
*RECURSION*
2009-12-21 06:04:55 +08:00
}
}
int(1)