3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function _AVG($args){ /*$count = func_num_args(); $args = func_get_args();*/ $count = count($args); $sum = array_sum($args); return (float)bcdiv($sum,$count,2); } function _MIN($args){ return (float)min($args); } echo _AVG(0.10);
Output for 7.0.0 - 7.1.0
Warning: array_sum() expects parameter 1 to be array, float given in /in/W1W1Y on line 6 0
Output for hhvm-3.12.0
Warning: Invalid operand type was used: array_sum expects an array or collection as argument 1 in /in/W1W1Y on line 6 Warning: bcdiv() expects parameter 1 to be string, null given in /in/W1W1Y on line 7 0
Output for hhvm-3.10.0
Warning: Invalid operand type was used: array_sum expects an array or collection as argument 1 in /in/W1W1Y on line 6 0
Output for 5.3.0 - 5.6.28
Warning: array_sum() expects parameter 1 to be array, double given in /in/W1W1Y on line 6 0
Output for 4.3.2 - 5.2.17
Warning: array_sum(): The argument should be an array in /in/W1W1Y on line 6 0
Output for 4.3.0 - 4.3.1
Warning: array_sum() [http://www.php.net/function.array-sum]: The argument should be an array in /in/W1W1Y on line 6 0