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(array(0.10));
Output for 4.3.0 - 5.5.33, 5.5.35 - 5.6.19, 5.6.21 - 7.0.4, 7.0.6 - 7.1.0
0.1
Output for 7.0.5
Fatal error: Uncaught Error: Call to undefined function bcdiv() in /in/2kHhp:7 Stack trace: #0 /in/2kHhp(13): _AVG(Array) #1 {main} thrown in /in/2kHhp on line 7
Process exited with code 255.
Output for 5.5.34, 5.6.20
Fatal error: Call to undefined function bcdiv() in /in/2kHhp on line 7
Process exited with code 255.