Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Merge one or more arrays
<?php array_merge(array ...$arrays): array
<?php         if (get_class($this) !== get_class($that)) {

            throw new \Exception('CollectionTypeError::cannotMergeDifferentTypes');

        }

        return new static(array_merge($this->items, $that->items));

    }

    

    public function toArray(): array
<?php     public function flatMap(callable $f): self

    {

        return new static(array_merge(...array_map($f, $this->items)));

    }



    public function reduce(callable $f, $initial = null)