xref: /PHP-8.1/Zend/tests/closure_011.phpt (revision d5ef2f46)
1--TEST--
2Closure 011: Lexical copies not static in closure
3--FILE--
4<?php
5$i = 1;
6$lambda = function () use ($i) {
7    return ++$i;
8};
9$lambda();
10echo $lambda()."\n";
11//early prototypes gave 3 here because $i was static in $lambda
12?>
13--EXPECT--
142
15