Download src/php/php-src/Zend/tests/clone/bug69996.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 451 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/clone/bug69996.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/clone/bug69996.phpt
-
curl -L -o bug69996.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/clone/bug69996.phpt
451 Bytes
| --TEST-- | |
| Bug #69996 (Changing the property of a cloned object affects the original) | |
| --FILE-- | |
| function method($cache) { | |
| $prepared = clone $cache; | |
| var_dump($prepared->data); | |
| $prepared->data = "bad"; | |
| return $prepared; | |
| } | |
| $cache = new stdClass(); | |
| $cache->data = "good"; | |
| for ($i = 0; $i < 5; ++$i) { | |
| method($cache); | |
| } | |
| --EXPECT-- | |
| string(4) "good" | |
| string(4) "good" | |
| string(4) "good" | |
| string(4) "good" | |
| string(4) "good" | |