Download src/php/php-src/Zend/tests/dereference/dereference_007.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 429 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/dereference/dereference_007.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/dereference/dereference_007.phpt
-
curl -L -o dereference_007.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/dereference/dereference_007.phpt
429 Bytes
| --TEST-- | |
| Trying to write on method return | |
| --FILE-- | |
| error_reporting(E_ALL); | |
| class foo { | |
| public $x = array(); | |
| public function b() { | |
| return $this->x; | |
| } | |
| public function c() { | |
| return $x; | |
| } | |
| static public function d() { | |
| } | |
| } | |
| $foo = new foo; | |
| $foo->b()[0] = 1; | |
| $foo->c()[100] = 2; | |
| foo::d()[] = 3; | |
| print "ok\n"; | |
| --EXPECTF-- | |
| Warning: Undefined variable $x in %s on line %d | |
| ok | |