summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_011.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-07-08 07:05:04 +0000
committerDmitry Stogov <dmitry@php.net>2008-07-08 07:05:04 +0000
commit8d2e0a7e0f91c5906550d81249569cfd822c9598 (patch)
tree03e99b82c037bcb6b505501d6348959cc1ca1572 /Zend/tests/closure_011.phpt
parent79807096b5fb0df8cdb3ef517bd0a034f9781d61 (diff)
downloadphp-git-8d2e0a7e0f91c5906550d81249569cfd822c9598.tar.gz
Added closures support
Diffstat (limited to 'Zend/tests/closure_011.phpt')
-rw-r--r--Zend/tests/closure_011.phpt18
1 files changed, 18 insertions, 0 deletions
diff --git a/Zend/tests/closure_011.phpt b/Zend/tests/closure_011.phpt
new file mode 100644
index 0000000000..3cd900f825
--- /dev/null
+++ b/Zend/tests/closure_011.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Closure 011: Lexical copies not static in closure
+--SKIPIF--
+<?php
+ if (!class_exists('Closure')) die('skip Closure support is needed');
+?>
+--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