3v4l.org

run code in 300+ PHP versions simultaneously
<?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); // without this works, but result large numbers.. e.g: "51.305693800548" echo $percentage; echo "\n"; $total_percentage+=$percentage; } echo $total_percentage;
Output for git.master, git.master_jit, rfc.property-hooks
51.31 17.81 30.89 100.01

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.14 ms | 401 KiB | 8 Q