php-src/Zend/tests/closure_006.phpt
2020-02-03 22:52:20 +01:00

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