$variance = array_sum(array_map(function ($x) use ($fMean) { return pow($x - $fMean, 2); }, $array)) / count($array);