mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
20 lines
243 B
PHP
20 lines
243 B
PHP
--TEST--
|
|
Closure 006: Nested lambdas
|
|
--FILE--
|
|
<?php
|
|
|
|
$getClosure = function ($v) {
|
|
return function () use ($v) {
|
|
echo "Hello World: $v!\n";
|
|
};
|
|
};
|
|
|
|
$closure = $getClosure (2);
|
|
$closure ();
|
|
|
|
echo "Done\n";
|
|
?>
|
|
--EXPECT--
|
|
Hello World: 2!
|
|
Done
|