3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array(74.6779,25.918,44.9589); $total = array_sum($arr); $total_percentage = 0; foreach($arr as $total_item) { $percentage = ($total_item*100)/$total; $percentage = round($percentage,2); echo $percentage; echo '<br>'; $total_percentage+=$percentage; } echo $total_percentage;
Output for 4.3.0 - 5.6.21, hhvm-3.12.0, 7.0.0 - 7.1.0
51.31<br>17.81<br>30.89<br>100.01
Output for hhvm-3.10.0

Process exited with code 153.