fork download
  1. <?php
  2.  
  3. // your code goes here
  4. $var = function ($var) {
  5. return array_sum($var) / count($var);
  6. };
  7. $arr = [10,20,30,40,50];
  8. echo $var($arr).'<br/>';
Success #stdin #stdout 0.02s 23620KB
stdin
Standard input is empty
stdout
30<br/>