3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($bar, ...$vargs) { var_dump($bar, $vargs); } foo(...['a' => 1, 'b' => 2, 'c' => 3], ...[4, 5, 6]);
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
int(4) array(5) { [0]=> int(5) [1]=> int(6) ["a"]=> int(1) ["b"]=> int(2) ["c"]=> int(3) }

preferences:
52.43 ms | 854 KiB | 5 Q