summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_006.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/closure_006.phpt')
-rw-r--r--Zend/tests/closure_006.phpt19
1 files changed, 19 insertions, 0 deletions
diff --git a/Zend/tests/closure_006.phpt b/Zend/tests/closure_006.phpt
new file mode 100644
index 000000000..aa0ec1199
--- /dev/null
+++ b/Zend/tests/closure_006.phpt
@@ -0,0 +1,19 @@
+--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