3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=[1,2]; $b=[2,...$a, 1=>3]; var_dump($b);

preferences:
29.47 ms | 404 KiB | 5 Q