$value) { if (is_numeric($value) && is_numeric($b[$index])) { $product += $value * $b[$index]; } } return $product; } }