Download src/php/php-src/Zend/tests/foreach/bug37046.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 332 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/foreach/bug37046.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/foreach/bug37046.phpt
-
curl -L -o bug37046.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/foreach/bug37046.phpt
332 Bytes
| --TEST-- | |
| Bug #37046 (foreach breaks static scope) | |
| --FILE-- | |
| function s() { | |
| static $storage = array(array('x', 'y')); | |
| return $storage[0]; | |
| } | |
| foreach (s() as $k => $function) { | |
| echo "op1 $k\n"; | |
| if ($k == 0) { | |
| foreach (s() as $k => $function) { | |
| echo "op2 $k\n"; | |
| } | |
| } | |
| } | |
| --EXPECT-- | |
| op1 0 | |
| op2 0 | |
| op2 1 | |
| op1 1 | |