mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
19 lines
228 B
PHP
19 lines
228 B
PHP
--TEST--
|
|
Closure 010: Closure calls itself
|
|
--FILE--
|
|
<?php
|
|
$i = 3;
|
|
$lambda = function ($lambda) use (&$i) {
|
|
if ($i==0) return;
|
|
echo $i--."\n";
|
|
$lambda($lambda);
|
|
};
|
|
$lambda($lambda);
|
|
echo "$i\n";
|
|
?>
|
|
--EXPECT--
|
|
3
|
|
2
|
|
1
|
|
0
|