3v4l.org

run code in 300+ PHP versions simultaneously
<?php $yourArray = [ ['item1' => 80], ['item2' => 25], ['item3' => 85], ]; usort( $yourArray, fn(array $a, array $b): int => reset($a) /* get the first array elements from $a */ <=> /* <--- the spaceship operator */ reset($b) /* and from $b for comparison */ ); print_r($yourArray);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [item2] => 25 ) [1] => Array ( [item1] => 80 ) [2] => Array ( [item3] => 85 ) )

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