Download src/php/php-src/Zend/tests/foreach/bug34873.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 462 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/foreach/bug34873.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/foreach/bug34873.phpt
-
curl -L -o bug34873.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/foreach/bug34873.phpt
462 Bytes
| --TEST-- | |
| Bug #34873 (Segmentation Fault on foreach in object) | |
| --FILE-- | |
| class pwa { | |
| public $var; | |
| function __construct(){ | |
| $this->var = array(); | |
| } | |
| function test (){ | |
| $cont = array(); | |
| $cont["mykey"] = "myvalue"; | |
| foreach ($cont as $this->var['key'] => $this->var['value']) | |
| var_dump($this->var['value']); | |
| } | |
| } | |
| $myPwa = new Pwa(); | |
| $myPwa->test(); | |
| echo "Done\n"; | |
| --EXPECT-- | |
| string(7) "myvalue" | |
| Done | |