php-src/Zend/tests/arg_unpack/many_args.phpt
Nikita Popov 31a2ac470c Fix argument unpacking across stack pages
If multiple unpacks were used (or mixed with normal arguments)
parts of the arguments could land on different stack pages. If
this occurs the arguments will now be copied to a new stack page.

The code used to do this is copied verbatim from the PHP 5.4 branch
and only modified to reduce the amount of inlined code.
2014-01-18 14:41:33 +01:00

16 lines
206 B
PHP

--TEST--
Argument unpacking with many arguments
--FILE--
<?php
function fn(...$args) {
var_dump(count($args));
}
$array = array_fill(0, 10000, 42);
fn(...$array, ...$array);
?>
--EXPECT--
int(20000)