Download src/php/php-src/ext/opcache/tests/opt/inference_001.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 729 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/opcache/tests/opt/inference_001.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/opcache/tests/opt/inference_001.phpt
-
curl -L -o inference_001.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/opcache/tests/opt/inference_001.phpt
729 Bytes
| --TEST-- | |
| Type inference 001: Invalid type narrowing warning | |
| --INI-- | |
| opcache.enable=1 | |
| opcache.enable_cli=1 | |
| opcache.optimization_level=-1 | |
| --FILE-- | |
| function test() { | |
| for ($i = 0; $i < 2; $i++) { | |
| $obj->x; | |
| $obj = new stdClass; | |
| } | |
| } | |
| test(); | |
| class Test { | |
| public int $x = 1; | |
| } | |
| function test2() { | |
| for ($i = 0; $i < 2; $i++) { | |
| $obj->x; | |
| $obj = new Test; | |
| } | |
| } | |
| test2(); | |
| DONE | |
| --EXPECTF-- | |
| Warning: Undefined variable $obj in %s on line %d | |
| Warning: Attempt to read property "x" on null in %s on line %d | |
| Warning: Undefined property: stdClass::$x in %s on line %d | |
| Warning: Undefined variable $obj in %s on line %d | |
| Warning: Attempt to read property "x" on null in %s on line %d | |
| DONE | |