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());
Output for git.master_jit, git.master
string(5) "first" string(6) "second" array(2) { [0]=> string(5) "third" ["named"]=> string(6) "fourth" } string(5) "first" string(6) "second" array(2) { [0]=> string(5) "third" ["named"]=> string(6) "fourth" } NULL NULL array(4) { ["100"]=> string(5) "first" ["101"]=> string(6) "second" ["102"]=> string(5) "third" ["named"]=> string(6) "fourth" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
38.28 ms | 406 KiB | 5 Q