3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = Array ( "0" => 12 , "1" => 17 , "2" => 5, "3" => 27, "4" => 5 ); //print_r($array); $i=1; foreach($array as $key=>$values) { echo max($array)." rank is ". $i."\n"; if(!in_array($values,$array)) $i++; unset($array[$key]); }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
27 rank is 1 27 rank is 1 27 rank is 1 27 rank is 1 5 rank is 1