Download src/php/php-src/Zend/tests/foreach/bug41929.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 331 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/foreach/bug41929.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/foreach/bug41929.phpt
-
curl -L -o bug41929.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/foreach/bug41929.phpt
331 Bytes
| --TEST-- | |
| Bug #41929 (Foreach on object does not iterate over all visible properties) | |
| --FILE-- | |
| class C { | |
| private $priv = "ok"; | |
| function doLoop() { | |
| echo $this->priv,"\n"; | |
| foreach ($this as $k=>$v) { | |
| echo "$k: $v\n"; | |
| } | |
| } | |
| } | |
| class D extends C { | |
| } | |
| $myD = new D; | |
| $myD->doLoop(); | |
| --EXPECT-- | |
| ok | |
| priv: ok | |