3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rgData = array( 3 => 1, 5 => 0, 1 => 2, 9 => 0, 0 => 1, 4 => 2, 2 => 1, 7 => 0, 6 => 0, 8 => 0, ); $keys = array_keys($rgData); // Sort the array's keys usort($keys, function($a, $b) use($rgData){ $aVal = $rgData[$a]; $bVal = $rgData[$b]; // Compare the values if($aVal === $bVal){ // If they are the same, compare the keys return $a - $b; } // Otherwise compare the values return $aVal - $bVal; }); print_r($rgData);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [3] => 1 [5] => 0 [1] => 2 [9] => 0 [0] => 1 [4] => 2 [2] => 1 [7] => 0 [6] => 0 [8] => 0 )

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:
36.95 ms | 401 KiB | 8 Q