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