3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($bar, ...$vargs) { var_dump($bar, $vargs); } foo(42, ...['a' => 1, 'b' => 2, 'c' => 3]);
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
int(42) array(3) { ["a"]=> int(1) ["b"]=> int(2) ["c"]=> int(3) }

preferences:
56.7 ms | 406 KiB | 5 Q