3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo() { print_r(func_get_args()); } $array = [1,2,3]; // Not possible // cannot use positional argument after unpacking //foo(...$array, ...$array, 4); foo(...$array, ...$array, ...[4]);
Output for 8.2.31 - 8.2.32, 8.3.0 - 8.3.33, 8.4.1 - 8.4.24, 8.5.0 - 8.5.9
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 1 [4] => 2 [5] => 3 [6] => 4 )

preferences:
48.56 ms | 768 KiB | 4 Q