3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $totaal["week1"][0] = 0.46; $totaal["week2"][1] = 2.87; $totaal["week3"][2] = 4.97; $totaal["week4"][3] = 4.35; $totaal["week5"][4] = 3.02; $totaal["week6"][5] = 2.03; $totaal["week7"][6] = 1.41; $totaal["week8"][7] = 1.12; $totaal["week9"][8] = 1.13; $sum = 0; foreach(array_values($totaal) as $index=>$item) $sum += reset($item); echo $sum; // 21.36 $totaal_vruchtzetting_week[10] = $sum;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
21.36