Download src/php/php-src/Zend/tests/dereference/dereference_014.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 665 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/dereference/dereference_014.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/dereference/dereference_014.phpt
-
curl -L -o dereference_014.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/dereference/dereference_014.phpt
665 Bytes
| --TEST-- | |
| Trying to create an object from dereferencing uninitialized variable | |
| --FILE-- | |
| error_reporting(E_ALL); | |
| class foo { | |
| public $x; | |
| static public $y; | |
| public function a() { | |
| return $this->x; | |
| } | |
| static public function b() { | |
| return self::$y; | |
| } | |
| } | |
| $foo = new foo; | |
| $h = $foo->a()[0]->a; | |
| var_dump($h); | |
| $h = foo::b()[1]->b; | |
| var_dump($h); | |
| --EXPECTF-- | |
| Warning: Trying to access array offset on null in %s on line %d | |
| Warning: Attempt to read property "a" on null in %s on line %d | |
| NULL | |
| Warning: Trying to access array offset on null in %s on line %d | |
| Warning: Attempt to read property "b" on null in %s on line %d | |
| NULL | |