summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_011.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/closure_011.phpt')
-rw-r--r--Zend/tests/closure_011.phpt14
1 files changed, 14 insertions, 0 deletions
diff --git a/Zend/tests/closure_011.phpt b/Zend/tests/closure_011.phpt
new file mode 100644
index 000000000..707136463
--- /dev/null
+++ b/Zend/tests/closure_011.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Closure 011: Lexical copies not static in closure
+--FILE--
+<?php
+$i = 1;
+$lambda = function () use ($i) {
+ return ++$i;
+};
+$lambda();
+echo $lambda()."\n";
+//early prototypes gave 3 here because $i was static in $lambda
+?>
+--EXPECT--
+2