Download src/php/php-src/Zend/tests/closures/closure_024.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 270 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/closures/closure_024.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/closures/closure_024.phpt
-
curl -L -o closure_024.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/closures/closure_024.phpt
270 Bytes
| --TEST-- | |
| Closure 024: Clone the Closure object | |
| --FILE-- | |
| $a = 1; | |
| $c = function($add) use(&$a) { return $a+$add; }; | |
| $cc = clone $c; | |
| echo $c(10)."\n"; | |
| echo $cc(10)."\n"; | |
| $a++; | |
| echo $c(10)."\n"; | |
| echo $cc(10)."\n"; | |
| echo "Done.\n"; | |
| --EXPECT-- | |
| 11 | |
| 11 | |
| 12 | |
| 12 | |
| Done. | |