Download src/php/php-src/Zend/tests/anon/anon_class_name.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 736 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/anon/anon_class_name.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/anon/anon_class_name.phpt
-
curl -L -o anon_class_name.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/anon/anon_class_name.phpt
736 Bytes
| --TEST-- | |
| Generated names for anonymous classes | |
| --FILE-- | |
| <?php | |
| namespace DeclaringNS { | |
| class Test1 {} | |
| interface Test2 {} | |
| interface Test3 {} | |
| } | |
| namespace UsingNS { | |
| function print_name(object $obj) { | |
| echo strstr(get_class($obj), "\0", true), "\n"; | |
| } | |
| print_name(new class {}); | |
| print_name(new class extends \DeclaringNS\Test1 {}); | |
| print_name(new class extends \DeclaringNS\Test1 implements \DeclaringNS\Test2 {}); | |
| print_name(new class implements \DeclaringNS\Test2 {}); | |
| print_name(new class implements \DeclaringNS\Test2, \DeclaringNS\Test3 {}); | |
| } | |
| ?> | |
| --EXPECT-- | |
| class@anonymous | |
| DeclaringNS\Test1 | |
| DeclaringNS\Test1 | |
| DeclaringNS\Test2 | |
| DeclaringNS\Test2 | |