ConstMap::zip

Returns a ConstMap where each value is a Pair that combines the value of the current ConstMap and the provided Traversable.

Description

public function zip(
  Traversable<Tu> $traversable,
): ConstMap<Tk,Pair<Tv,Tu>>

Returns a ConstMap where each value is a Pair that combines the value of the current ConstMap and the provided Traversable.

If the number of values of the current ConstMap are not equal to the number of elements in the Traversable, then only the combined elements up to and including the final element of the one with the least number of elements is included.

The keys associated with the current ConstMap remain unchanged in the returned ConstMap.

Parameters

  • Traversable<Tu> $traversable - The Traversable to use to combine with the elements of the current ConstMap.

Return Values