3v4l.org

run code in 300+ PHP versions simultaneously
<?php $list = array( array(0 => "F"), array(1 => "E"), array(60 => "B"), array(20 => "C"), array(14 => "D"), array(100 => "A"), ); $tmp = []; for($x = 0; $x < sizeof($list); $x++) { for($i = 0; $i < sizeof($list) - $x - 1; $i++) { $nextVal = key($list[$i + 1]); $currentVal = key($list[$i]); if ($nextVal > $currentVal) { [$list[$i], $list[$i + 1]] = [$list[$i + 1], $list[$i]]; } } } echo "AFTER:\n"; var_dump($list);
Output for git.master, git.master_jit, rfc.property-hooks
AFTER: array(6) { [0]=> array(1) { [100]=> string(1) "A" } [1]=> array(1) { [60]=> string(1) "B" } [2]=> array(1) { [20]=> string(1) "C" } [3]=> array(1) { [14]=> string(1) "D" } [4]=> array(1) { [1]=> string(1) "E" } [5]=> array(1) { [0]=> string(1) "F" } }

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