3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [ ['name' => 'third1', 'order' => 3], ['name' => 'first1', 'order' => 1], ['name' => 'third2', 'order' => 3], ['name' => 'second1', 'order' => 2], ['name' => 'fourth', 'order' => 4], ['name' => 'second2', 'order' => 2], ]; usort ($a, function ($a, $b) { if ($a['order'] == $b['order']) { return 0; } return ($a['order'] < $b['order']) ? -1 : 1; }); print_r ($a);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [name] => first1 [order] => 1 ) [1] => Array ( [name] => second1 [order] => 2 ) [2] => Array ( [name] => second2 [order] => 2 ) [3] => Array ( [name] => third1 [order] => 3 ) [4] => Array ( [name] => third2 [order] => 3 ) [5] => Array ( [name] => fourth [order] => 4 ) )

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:
53.85 ms | 402 KiB | 8 Q