3v4l.org

run code in 300+ PHP versions simultaneously
<?php function zeroOneTwo($one, $two, $three) { return [$one, $two, $three]; } function abc($b, $c, $a) { return [$a, $b, $c]; } $numericKeyedArray = [4,5,6]; var_export(abc(...$numericKeyedArray)); echo "\n---\n"; var_export(zeroOneTwo(...$numericKeyedArray)); echo "\n===\n"; $nonNumericKeyedArray = ['c' => 'sea', 'a' => 'A', 'b' => 'bee']; echo "\n---\n"; var_export(abc(...$nonNumericKeyedArray)); echo "\n===\n"; var_export(zeroOneTwo(...$nonNumericKeyedArray));
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 6, 1 => 4, 2 => 5, ) --- array ( 0 => 4, 1 => 5, 2 => 6, ) === --- array ( 0 => 'A', 1 => 'bee', 2 => 'sea', ) === Fatal error: Uncaught Error: Unknown named parameter $c in /in/NYufH:21 Stack trace: #0 {main} thrown in /in/NYufH on line 21
Process exited with code 255.

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:
88.1 ms | 406 KiB | 5 Q