3v4l.org

run code in 500+ PHP versions simultaneously
<?php $a = [3]; foo(...$a ?? range(1,2)); $a = [null]; foo(...$a ?? range(1,2)); $a = null; foo(...$a ?? range(1,2)); function foo() { print_r(func_get_args()); }
Output for 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.21, 8.5.0 - 8.5.6
Array ( [0] => 3 ) Array ( [0] => ) Array ( [0] => 1 [1] => 2 )

preferences:
52.42 ms | 853 KiB | 4 Q