3v4l.org

run code in 300+ PHP versions simultaneously
<?php function a() { return [ 100 => 'first', 101 => 'second', 102 => 'third', 'named' => 'fourth', ]; } function b() { yield 100 => 'first'; yield 101 => 'second'; yield 102 => 'third'; yield 'named' => 'fourth'; } function c() { yield '100' => 'first'; yield '101' => 'second'; yield '102' => 'third'; yield 'named' => 'fourth'; } function test($x=null, $y=null, ...$z) { var_dump($x, $y, $z); } test(...a()); echo "\n"; test(...b()); echo "\n"; test(...c());

preferences:
28.06 ms | 404 KiB | 5 Q