3v4l.org

run code in 300+ PHP versions simultaneously
<?php function _AVG($args){ /*$count = func_num_args(); $args = func_get_args();*/ $count = count($args); $sum = array_sum($args); return bcdiv($sum,$count,2); } function _AVG1($args){ /*$count = func_num_args(); $args = func_get_args();*/ $count = count($args); //$sum = array_sum($args); return array_sum($args) / $count; } echo _AVG(array(0.99,1.80,5.03)); echo '<br />'; echo _AVG1(array(0.99,1.80,5.03));
Output for git.master, git.master_jit, rfc.property-hooks
2.60<br />2.6066666666667

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:
60.84 ms | 401 KiB | 8 Q