src/Functions/Map/Multi.php
private static function checkArrayLengths(array $arrays): bool
    {
        if (count($arrays) < 2) {
            throw new Exception\BadDataException('Need at least two arrays to map over');
        }

        $n = count($arrays[0]);
        foreach ($arrays as $array) {
            if (count($array) !== $n) {
                throw new Exception\BadDataException('Lengths of arrays are not equal');
            }
        }

        return true;
    }
private static function checkArrayLengths(array $arrays): bool
    {
        if (count($arrays) < 2) {
            throw new Exception\BadDataException('Need at least two arrays to map over');
        }

        $n = count($arrays[0]);
        foreach ($arrays as $array) {
            if (count($array) !== $n) {
                throw new Exception\BadDataException('Lengths of arrays are not equal');
            }
        }

        return true;
    }
private static function checkArrayLengths ( array $ arrays ) : bool { if ( count ( $ arrays ) < 2 ) { throw new Exception \ BadDataException ( 'Need at least two arrays to map over' ) ; } $ n = count ( $ arrays [ 0 ] ) ; foreach ( $ arrays as $ array ) { if ( count ( $ array ) !== $ n ) { throw new Exception \ BadDataException ( 'Lengths of arrays are not equal' ) ; } } return true ; }
Check that two or more arrays are all the same length

@param  array[] $arrays

@return bool

@throws Exception\BadDataException if there are not at least two arrays
@throws Exception\BadDataException if arrays are not equal lengths
Check that two or more arrays are all the same length