src/GeneratorCollection.php
public function combine($values): CollectionInterface
    {
        if ($values instanceof IteratorAggregate) {
            $values = $values->getIterator();
        } elseif (is_array($values)) {
            $values = new ArrayIterator($values);
        }

        return $this->wrap(function (Iterator $keys) use ($values) {
            foreach ($keys as $key) {
                yield $key => $values->current();
                $values->next();
            }
        });
    }
public function combine($values): CollectionInterface
    {
        if ($values instanceof IteratorAggregate) {
            $values = $values->getIterator();
        } elseif (is_array($values)) {
            $values = new ArrayIterator($values);
        }

        return $this->wrap(function (Iterator $keys) use ($values) {
            foreach ($keys as $key) {
                yield $key => $values->current();
                $values->next();
            }
        });
    }
public function combine ( $ values ) : CollectionInterface { if ( $ values instanceof IteratorAggregate ) { $ values = $ values -> getIterator ( ) ; } elseif ( is_array ( $ values ) ) { $ values = new ArrayIterator ( $ values ) ; } return $ this -> wrap ( function ( Iterator $ keys ) use ( $ values ) { foreach ( $ keys as $ key ) { yield $ key => $ values -> current ( ) ; $ values -> next ( ) ; } } ) ; }
Create a collection by using this collection for keys and another for its values.

@param  mixed $values
@return CollectionInterface
Create a collection by using this collection for keys and another for its values .