3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [7, 3, 5, 4]; asort($arr); $temp = []; $count = 1; $key = key($arr); while (next($arr)) { $temp[$key] = key($arr); $key = key($arr); $count++; } $temp[$key] = -1; print_r($temp); $result = []; for ($i = 0; $i < $count; $i++) { $result[] = $temp[$i]; } print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [1] => 3 [3] => 2 [2] => 0 [0] => -1 ) Array ( [0] => -1 [1] => 3 [2] => 0 [3] => 2 )

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