3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 65 => [ ["p" => 234, "sp" => 234], ["p" => 53, "sp" => 5], ["p" => 530, "sp" => 5], ] ]; $col = 'p'; // set the column you want to order on $column = array_column($arr[65], $col); array_multisort($column, SORT_ASC, $arr[65]); // SORT_ASC or SORT_DESC $arr[65] = $arr[65][0]; // only keep the record with lowest 'p' value var_dump($arr);
Output for git.master, git.master_jit, rfc.property-hooks
array(1) { [65]=> array(2) { ["p"]=> int(53) ["sp"]=> int(5) } }

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