mirror of
https://github.com/php/php-src.git
synced 2024-10-17 22:42:38 +00:00
15 lines
247 B
Plaintext
15 lines
247 B
Plaintext
|
--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
|