Download src/php/php-src/Zend/tests/ArrayAccess/bug30346.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 503 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/ArrayAccess/bug30346.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/ArrayAccess/bug30346.phpt
-
curl -L -o bug30346.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/ArrayAccess/bug30346.phpt
503 Bytes
| --TEST-- | |
| Bug #30346 (arrayAccess and using $this) | |
| --FILE-- | |
| class Test implements ArrayAccess | |
| { | |
| public function __construct() { } | |
| public function offsetExists( $offset ): bool { return false; } | |
| public function offsetGet( $offset ): mixed { return $offset; } | |
| public function offsetSet( $offset, $data ): void { } | |
| public function offsetUnset( $offset ): void { } | |
| } | |
| $post = new Test; | |
| $id = 'page'; | |
| echo $post[$id.'_show']; | |
| echo "\n"; | |
| --EXPECT-- | |
| page_show | |