Download src/php/php-src/Zend/tests/closures/closure_012.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 368 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/closures/closure_012.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/closures/closure_012.phpt
-
curl -L -o closure_012.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/closures/closure_012.phpt
368 Bytes
| --TEST-- | |
| Closure 012: Undefined lexical variables | |
| --FILE-- | |
| $lambda = function () use ($i) { | |
| return ++$i; | |
| }; | |
| $lambda(); | |
| $lambda(); | |
| var_dump($i); | |
| $lambda = function () use (&$i) { | |
| return ++$i; | |
| }; | |
| $lambda(); | |
| $lambda(); | |
| var_dump($i); | |
| --EXPECTF-- | |
| Warning: Undefined variable $i in %s on line %d | |
| Warning: Undefined variable $i in %s on line %d | |
| NULL | |
| int(2) | |