Download src/php/php-src/Zend/tests/foreach/bug33171.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 365 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/foreach/bug33171.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/foreach/bug33171.phpt
-
curl -L -o bug33171.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/foreach/bug33171.phpt
365 Bytes
| --TEST-- | |
| Bug #33171 (foreach enumerates private fields declared in base classes) | |
| --FILE-- | |
| class A | |
| { | |
| private $c = "A's c"; | |
| } | |
| class B extends A | |
| { | |
| private $c = "B's c"; | |
| public function go() | |
| { | |
| foreach ($this as $key => $val) | |
| { | |
| echo "$key => $val\n"; | |
| } | |
| } | |
| }; | |
| $x = new B; | |
| $x->go(); | |
| --EXPECT-- | |
| c => B's c | |