3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $tab = "78, 60, 62, 68, 71, 68, 73, 85, 66, 64, 76, 63, 81, 76, 73, 68, 72, 73, 75, 65, 74, 63, 67, 65, 64, 68, 73, 75, 79, 73"; $tab = explode(',', $tab); echo 'Srednia: ' . $srednia = array_sum($tab)/count($tab); sort($tab); for ($i = 0; $i<=6; $i++) { echo $tab[$i]; } echo '\n'; for ($i = count($tab)-7; $i<=count($tab); $i++) { echo $tab[$i]; }
based on f9EH8
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Srednia: 70.6 60 62 63 63 64 64 65\n 75 76 7678 79 81 85 Notice: Undefined offset: 30 in /in/1HjeP on line 15
Output for hhvm-3.10.0 - 3.12.0
Srednia: 70.6 60 62 63 63 64 64 65\n 75 76 7678 79 81 85 Notice: Undefined index: 30 in /in/1HjeP on line 15
Output for 4.3.0 - 5.2.17
Srednia: 70.6 60 62 63 63 64 64 65\n 75 76 7678 79 81 85 Notice: Undefined offset: 30 in /in/1HjeP on line 15