3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = array(-3,5,1,3,2,10); function array_avg($array) { $sum = 0; for ($i = 0; $i <= count($array); $i++) { $sum += $array[$i]; } echo $sum; } array_avg($x);
based on cnhcS
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined offset: 6 in /in/dUqql on line 7 18
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined index: 6 in /in/dUqql on line 7 18
Output for 4.3.0 - 5.2.17
Notice: Undefined offset: 6 in /in/dUqql on line 7 18