Download src/php/php-src/tests/classes/autoload_005.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 805 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/tests/classes/autoload_005.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/tests/classes/autoload_005.phpt
-
curl -L -o autoload_005.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/tests/classes/autoload_005.phpt
805 Bytes
| --TEST-- | |
| ZE2 Autoload from destructor | |
| --SKIPIF-- | |
| if (class_exists('autoload_root', false)) die('skip Autoload test classes exist already'); | |
| --FILE-- | |
| spl_autoload_register(function ($class_name) { | |
| var_dump(class_exists($class_name, false)); | |
| require_once(__DIR__ . '/' . $class_name . '.inc'); | |
| echo 'autoload(' . $class_name . ")\n"; | |
| }); | |
| var_dump(class_exists('autoload_derived', false)); | |
| var_dump(class_exists('autoload_derived', false)); | |
| class Test | |
| { | |
| function __destruct() { | |
| echo __METHOD__ . "\n"; | |
| $o = new autoload_derived; | |
| var_dump($o); | |
| } | |
| } | |
| $o = new Test; | |
| unset($o); | |
| --EXPECTF-- | |
| bool(false) | |
| bool(false) | |
| Test::__destruct | |
| bool(false) | |
| bool(false) | |
| autoload(autoload_root) | |
| autoload(autoload_derived) | |
| object(autoload_derived)#%d (0) { | |
| } | |