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

        $number_of_arrays = count($arrays);
        $length_of_arrays = count($arrays[0]);
        $maxes            = array_map(
            function ($x) {
                return $x;
            },
            $arrays[0]
        );

        for ($i = 0; $i < $length_of_arrays; $i++) {
            for ($j = 1; $j < $number_of_arrays; $j++) {
                $maxes[$i] = max($maxes[$i], $arrays[$j][$i]);
            }
        }

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

        $number_of_arrays = count($arrays);
        $length_of_arrays = count($arrays[0]);
        $maxes            = array_map(
            function ($x) {
                return $x;
            },
            $arrays[0]
        );

        for ($i = 0; $i < $length_of_arrays; $i++) {
            for ($j = 1; $j < $number_of_arrays; $j++) {
                $maxes[$i] = max($maxes[$i], $arrays[$j][$i]);
            }
        }

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

[max(x₁, y₁), max(x₂, y₂), ... ]

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

@return array

@throws Exception\BadDataException
Map max against multiple arrays