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.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(42) array(3) { ["a"]=> int(1) ["b"]=> int(2) ["c"]=> int(3) }

preferences:
55.21 ms | 846 KiB | 4 Q