protected function maybeEmptyNumericArrays(array $array, array ...$merge): array
    {
        if (!$merge) { // Save time. Merge is empty?
            return $base; // Nothing to do here.
        }
        foreach ($array as $_key => &$_value) {
            if (is_array($_value)) {
                foreach ($merge as $_merge) {
                    if (array_key_exists($_key, $_merge)) {
                        if (!$_value || $_value === array_values($_value)) {
                            $_value = []; // Empty.
                        } elseif (is_array($_merge[$_key])) {
                            $_value = $this->maybeEmptyNumericArrays($_value, $_merge[$_key]);
                        }
                    }
                } // unset($_merge); // Housekeeping.
            }
        } // unset($_key, $_value); // Housekeeping.

        return $array;
    }
protected function maybeEmptyNumericArrays(array $array, array ...$merge): array
    {
        if (!$merge) { // Save time. Merge is empty?
            return $base; // Nothing to do here.
        }
        foreach ($array as $_key => &$_value) {
            if (is_array($_value)) {
                foreach ($merge as $_merge) {
                    if (array_key_exists($_key, $_merge)) {
                        if (!$_value || $_value === array_values($_value)) {
                            $_value = []; // Empty.
                        } elseif (is_array($_merge[$_key])) {
                            $_value = $this->maybeEmptyNumericArrays($_value, $_merge[$_key]);
                        }
                    }
                } // unset($_merge); // Housekeeping.
            }
        } // unset($_key, $_value); // Housekeeping.

        return $array;
    }
protected function maybeEmptyNumericArrays ( array $ array , array ... $ merge ) : array { if ( ! $ merge ) { // Save time. Merge is empty? return $ base ; // Nothing to do here. } foreach ( $ array as $ _key => & $ _value ) { if ( is_array ( $ _value ) ) { foreach ( $ merge as $ _merge ) { if ( array_key_exists ( $ _key , $ _merge ) ) { if ( ! $ _value || $ _value === array_values ( $ _value ) ) { $ _value = [ ] ; // Empty. } elseif ( is_array ( $ _merge [ $ _key ] ) ) { $ _value = $ this -> maybeEmptyNumericArrays ( $ _value , $ _merge [ $ _key ] ) ; } } } // unset($_merge); // Housekeeping. } } // unset($_key, $_value); // Housekeeping. return $ array ; }
Empty numeric arrays.

@since 17xxxx Change recursive.

@param array $array    Base array.
@param array ...$merge Array to merge.

@return array w/ possibly-empty numeric arrays.
Empty numeric arrays .