Corveda / PHPSandbox

A PHP-based sandboxing library with a full suite of configuration and validation options.
https://phpsandbox.org
Other
220 stars 46 forks source link

Code with argument unpacking not working #19

Open Furgas opened 4 years ago

Furgas commented 4 years ago

Code:

function foo(int ...$a) {
    return $a;
}

$ints = [1,2];
foo(...$ints);

Result: Compile Error: Cannot use positional argument after argument unpacking

Generated code causing the error:

return foo(\PHPSandbox\wrapByRef(...$ints, \PHPSandbox\PHPSandbox::getSandbox('__PHPSandbox_ff7c8ab064063e1d4d509dfbadda498e')));