3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( '3' => 10, '2' => 2, '5' => 'Nakiya', ); /** * Prepend a value to an array PHP */ function prependelement($array, $value) { array_unshift($array, $value); return $array; } var_dump(prependelement($array,'Jack'));
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { [0]=> string(4) "Jack" [1]=> int(10) [2]=> int(2) [3]=> string(6) "Nakiya" }

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:
26.42 ms | 405 KiB | 5 Q