3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array('a' => 2, 'b' => 1, 'c' => 4); krsort($array); print_r($array); $array = array('q' => 2, 'b' => 1, 'z' => 4); $array = array_reverse($array); print_r($array); $array = array('a' => 2, 'b' => 1, 'c' => 4); $first = array_shift($array); array_unshift(array_pop($array)); array_push($array,$first); print_r($array);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [c] => 4 [b] => 1 [a] => 2 ) Array ( [z] => 4 [b] => 1 [q] => 2 ) Notice: Only variables should be passed by reference in /in/mtKT3 on line 12 Fatal error: Uncaught TypeError: array_unshift(): Argument #1 ($array) must be of type array, int given in /in/mtKT3:12 Stack trace: #0 /in/mtKT3(12): array_unshift(4) #1 {main} thrown in /in/mtKT3 on line 12
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:
86.91 ms | 405 KiB | 9 Q