Download src/php/php-src/ext/com_dotnet/tests/variant_variation2.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 608 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/com_dotnet/tests/variant_variation2.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/com_dotnet/tests/variant_variation2.phpt
-
curl -L -o variant_variation2.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/com_dotnet/tests/variant_variation2.phpt
608 Bytes
| --TEST-- | |
| Testing reading and writing of properties | |
| --EXTENSIONS-- | |
| com_dotnet | |
| --FILE-- | |
| class MyClass { | |
| public $foo = "foo"; | |
| public string $bar = "bar"; | |
| } | |
| $o = new MyClass(); | |
| $v = new variant($o); | |
| var_dump($v->foo); | |
| var_dump($v->bar); | |
| $v->foo = "new foo"; | |
| var_dump($v->foo instanceof variant); | |
| var_dump((string) $v->foo); | |
| var_dump($o->foo instanceof variant); | |
| var_dump((string) $o->foo); | |
| $v->bar = "new bar"; | |
| var_dump($v->bar); | |
| var_dump($o->bar); | |
| --EXPECT-- | |
| string(3) "foo" | |
| string(3) "bar" | |
| bool(true) | |
| string(7) "new foo" | |
| bool(true) | |
| string(7) "new foo" | |
| string(7) "new bar" | |
| string(7) "new bar" | |