Download src/php/php-src/Zend/tests/arg_unpack/method.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 392 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/arg_unpack/method.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/arg_unpack/method.phpt
-
curl -L -o method.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/arg_unpack/method.phpt
392 Bytes
| --TEST-- | |
| Unpack arguments for method calls | |
| --FILE-- | |
| class Foo { | |
| public function test(...$args) { | |
| var_dump($args); | |
| } | |
| public static function test2(...$args) { | |
| var_dump($args); | |
| } | |
| } | |
| $foo = new Foo; | |
| Foo::test2(1, 2, ...[3, 4], ...[], ...[5]); | |
| --EXPECT-- | |
| array(5) { | |
| [0]=> | |
| int(1) | |
| [1]=> | |
| int(2) | |
| [2]=> | |
| int(3) | |
| [3]=> | |
| int(4) | |
| [4]=> | |
| int(5) | |
| } | |