3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $temperature = array(78, 60, 62, 68, 71, 68, 73, 85, 66, 64, 76, 63, 75, 76, 73, 68, 62, 73, 72, 65, 74, 62, 62, 65, 64, 68, 73, 75, 79, 73); $total = 0; $len = count($temperature); echo $len; foreach($temperature as $temp) { $total += $temp; } $avg = $total/$len; echo "Averaage temp is" .$avg; sort($temperature); for ($i = 0; $i < 5 ; $i++) { echo $temperature[$i]; } ?>
based on N7Pmi
Output for 4.3.0 - 7.2.0
30Averaage temp is69.7666666666676062626262