3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = array ( array(1, 9), array(1, 3), array(1, 5), array(9, 2), array(9, 7), ); $col0 = array_column($data, 0); $col1 = array_column($data, 1); $min0 = min($col0); $min1 = min($col1); $mincol0 = array_intersect($col0, [$min0]); $mincol1 = array_intersect($col1, [$min1]); var_dump(array_keys(array_intersect_key($col1, $mincol0),min(array_intersect_key($col1, $mincol0)))); Var_dump($mincol0, $mincol1);
based on HgU9U
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.30 - 7.3.0alpha1
array(1) { [0]=> int(1) } array(3) { [0]=> int(1) [1]=> int(1) [2]=> int(1) } array(1) { [3]=> int(2) }