Download src/php/php-src/Zend/tests/ArrayAccess/bug69955.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 858 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/ArrayAccess/bug69955.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/ArrayAccess/bug69955.phpt
-
curl -L -o bug69955.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/ArrayAccess/bug69955.phpt
858 Bytes
| --TEST-- | |
| Bug #69955 (Segfault when trying to combine [] and assign-op on ArrayAccess object). | |
| --FILE-- | |
| class C10 implements ArrayAccess | |
| { | |
| function offsetExists($offset): bool | |
| { | |
| echo "\nInside " . __METHOD__ . "\n"; var_dump($offset); | |
| } | |
| function offsetGet($offset): mixed | |
| { | |
| echo "\nInside " . __METHOD__ . "\n"; var_dump($offset); return 100; | |
| } | |
| function offsetSet($offset, $value): void | |
| { | |
| echo "\nInside " . __METHOD__ . "\n"; var_dump($offset); var_dump($value); | |
| } | |
| function offsetUnset($offset): void | |
| { | |
| echo "\nInside " . __METHOD__ . "\n"; var_dump($offset); | |
| } | |
| } | |
| $c10 = new C10; | |
| var_dump($c10[] += 5); | |
| --EXPECT-- | |
| Inside C10::offsetGet | |
| NULL | |
| Inside C10::offsetSet | |
| NULL | |
| int(105) | |
| int(105) | |