3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ 1 => [ 'name' => 'EC567', 'type' => 'B3000', 'value' => '4DFYU', ], 2 => [ 'name' => '1C527', 'type' => 'B3UI0', 'value' => '4DMNU', ] ]; $order = ['RD678', '9O0PM', '1C527', 'EC567']; usort($arr, fn(array $a, array $b): int => array_search($a['name'], $order) <=> array_search($b['name'], $order) ); var_dump($arr);
Output for git.master, git.master_jit, rfc.property-hooks
array(2) { [0]=> array(3) { ["name"]=> string(5) "1C527" ["type"]=> string(5) "B3UI0" ["value"]=> string(5) "4DMNU" } [1]=> array(3) { ["name"]=> string(5) "EC567" ["type"]=> string(5) "B3000" ["value"]=> string(5) "4DFYU" } }

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:
50.01 ms | 1301 KiB | 4 Q