3v4l.org

run code in 500+ PHP versions simultaneously
<?php function foo($x, ...$array) { print_r($x); print_r($array); } $a = ['w' => 'w', 'x' => 'x']; foo(...$a); print_r(array_merge(...$a)); // array_merge() does not accept unknown named parameters
Output for 8.6.0
xArray ( [w] => w ) Fatal error: Uncaught ArgumentCountError: Internal function array_merge() does not accept named variadic arguments in /in/miPmk:12 Stack trace: #0 /in/miPmk(12): array_merge(w: 'w', x: 'x') #1 {main} thrown in /in/miPmk on line 12
Process exited with code 255.
Output for 8.1.34, 8.2.0 - 8.2.36, 8.3.0 - 8.3.37, 8.4.1 - 8.4.28, 8.5.0 - 8.5.13
xArray ( [w] => w ) Fatal error: Uncaught ArgumentCountError: array_merge() does not accept unknown named parameters in /in/miPmk:12 Stack trace: #0 /in/miPmk(12): array_merge(w: 'w', x: 'x') #1 {main} thrown in /in/miPmk on line 12
Process exited with code 255.

preferences:
22.59 ms | 1167 KiB | 6 Q