Download src/php/php-src/Zend/tests/closures/bug54358.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 605 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/closures/bug54358.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/closures/bug54358.phpt
-
curl -L -o bug54358.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/closures/bug54358.phpt
605 Bytes
| --TEST-- | |
| Bug #54358 (Closure, use and reference) | |
| --FILE-- | |
| class asserter { | |
| public function call($function) { | |
| } | |
| } | |
| $asserter = new asserter(); | |
| $closure = function() use ($asserter, &$function) { | |
| $asserter->call($function = 'md5'); | |
| }; | |
| $closure(); | |
| var_dump($function); | |
| $closure = function() use ($asserter, $function) { | |
| $asserter->call($function); | |
| }; | |
| $closure(); | |
| var_dump($function); | |
| $closure = function() use ($asserter, $function) { | |
| $asserter->call($function); | |
| }; | |
| $closure(); | |
| var_dump($function); | |
| --EXPECT-- | |
| string(3) "md5" | |
| string(3) "md5" | |
| string(3) "md5" | |