Download src/php/php-src/Zend/tests/closures/closure_011.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 247 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/closures/closure_011.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/closures/closure_011.phpt
-
curl -L -o closure_011.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/closures/closure_011.phpt
247 Bytes
| --TEST-- | |
| Closure 011: Lexical copies not static in closure | |
| --FILE-- | |
| $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 | |