3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($a, $b) { echo "$a $b\n";} foo(...['x', 'y']); // x y // named parameters foo(...['a' => 'x', 'b' => 'y']); // x y foo(...['b' => 'x', 'a' => 'y']); // y x // positional parameters: integer key not used foo(...[0 => 'x', 1 => 'y']); // x y foo(...[120 => 'x', 11 => 'y']); // x y foo(...[11 => 'y', 120 => 'x']); // y x ?>

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
170.41 ms | 1463 KiB | 14 Q