Download src/php/php-src/Zend/tests/foreach/foreach.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 294 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/foreach/foreach.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/foreach/foreach.phpt
-
curl -L -o foreach.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/foreach/foreach.phpt
294 Bytes
| --TEST-- | |
| foreach() by-ref bug | |
| --FILE-- | |
| $foo = array(1,2,3,4); | |
| foreach($foo as $key => &$val) { | |
| if($val == 3) { | |
| $foo[$key] = 0; | |
| } else { | |
| $val++; | |
| } | |
| } | |
| var_dump($foo); | |
| --EXPECT-- | |
| array(4) { | |
| [0]=> | |
| int(2) | |
| [1]=> | |
| int(3) | |
| [2]=> | |
| int(0) | |
| [3]=> | |
| &int(5) | |
| } | |