3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr[] = ['первый',10,'бла']; $arr[] = ['второй',5,'бла']; $arr[] = ['третий',11,'бла']; $sort = [5,11,10]; $sort_map = array_flip($sort); // [5=>0, 11=>1, 10=>2] usort($arr, function($a, $b) use ($sort_map) { return $sort_map[$a[1]] - $sort_map[$b[1]]; }); var_dump($arr);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [0]=> array(3) { [0]=> string(12) "второй" [1]=> int(5) [2]=> string(6) "бла" } [1]=> array(3) { [0]=> string(12) "третий" [1]=> int(11) [2]=> string(6) "бла" } [2]=> array(3) { [0]=> string(12) "первый" [1]=> int(10) [2]=> string(6) "бла" } }

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:
47.45 ms | 1524 KiB | 4 Q