3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //$list = array(3,4,2,5,6,7,8,2,5,1,4,4,6); $list = array( array('name'=>"harold",'age'=> 24), array('name'=>"sonia",'age'=> 25), array('name'=>"isaiah",'age'=> 5), array('name'=>"sheral",'age'=> 21), ); function minimum($list) { $len = count($list); $minimum = $list[0]; for ($i = 1; $i < $len; $i++) { if ($minimum['age'] > $list[$i]['age']) { $minimum = $list[$i]; } } return $minimum; } // 1 var_dump( minimum($list)); ?>
Output for 4.3.0 - 7.1.0
array(2) { ["name"]=> string(6) "isaiah" ["age"]=> int(5) }