mirror of
https://github.com/php/php-src.git
synced 2024-12-12 03:15:29 +08:00
20 lines
255 B
PHP
20 lines
255 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
|