3v4l.org

run code in 500+ 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); // get all p values asort($column); // sort values ascending but keep keys $arr[65] = $arr[65][array_key_first($column)]; // replace key "65" array by array-value with key containing lowest "p" 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:
45.39 ms | 1372 KiB | 4 Q