mirror of
https://github.com/php/php-src.git
synced 2024-12-02 22:34:55 +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
|