src/Functions/Map/Multi.php
public static function multiply(array ...$arrays): array
    {
        self::checkArrayLengths($arrays);

        $number_of_arrays = count($arrays);
        $length_of_arrays = count($arrays[0]);
        $products         = array_fill(0, $length_of_arrays, 1);

        for ($i = 0; $i < $length_of_arrays; $i++) {
            for ($j = 0; $j < $number_of_arrays; $j++) {
                $products[$i] *= $arrays[$j][$i];
            }
        }

        return $products;
    }
public static function multiply(array ...$arrays): array
    {
        self::checkArrayLengths($arrays);

        $number_of_arrays = count($arrays);
        $length_of_arrays = count($arrays[0]);
        $products         = array_fill(0, $length_of_arrays, 1);

        for ($i = 0; $i < $length_of_arrays; $i++) {
            for ($j = 0; $j < $number_of_arrays; $j++) {
                $products[$i] *= $arrays[$j][$i];
            }
        }

        return $products;
    }
public static function multiply ( array ... $ arrays ) : array { self :: checkArrayLengths ( $ arrays ) ; $ number_of_arrays = count ( $ arrays ) ; $ length_of_arrays = count ( $ arrays [ 0 ] ) ; $ products = array_fill ( 0 , $ length_of_arrays , 1 ) ; for ( $ i = 0 ; $ i < $ length_of_arrays ; $ i ++ ) { for ( $ j = 0 ; $ j < $ number_of_arrays ; $ j ++ ) { $ products [ $ i ] *= $ arrays [ $ j ] [ $ i ] ; } } return $ products ; }
Map multiply against multiple arrays

[x₁ * y₁, x₂ * y₂, ... ]

@param array ...$arrays Two or more arrays of numbers

@return array

@throws Exception\BadDataException
Map multiply against multiple arrays