3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'user 1' => [ ['item 4' => '11385'], ['item 2' => '144268'], ['item 1' => '65774'], ['item 9' => '98523'], ], 'user 5' => [ ['item 8' => '239233'], ], 'user 2' => [ ['item 4' => '53718'], ['item 1' => '154687'], ], ]; ksort($array); foreach ($array as &$v) { usort( $v, fn($a, $b) => key($a) <=> key($b) ); } var_export($array);
Output for git.master_jit, git.master, rfc.property-hooks
array ( 'user 1' => array ( 0 => array ( 'item 1' => '65774', ), 1 => array ( 'item 2' => '144268', ), 2 => array ( 'item 4' => '11385', ), 3 => array ( 'item 9' => '98523', ), ), 'user 2' => array ( 0 => array ( 'item 1' => '154687', ), 1 => array ( 'item 4' => '53718', ), ), 'user 5' => array ( 0 => array ( 'item 8' => '239233', ), ), )

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:
51.91 ms | 1053 KiB | 4 Q