hphp/hack/manual/apis/Classes/HH/ImmSet/zip.md
:::info[Note] This is a point-in-time snapshot of the API documentation from January 2026. Going forward, we will not be maintaining a public copy of these references, and recommend users to refer to the built-in signature helpers available in the Hack LSP instead for complete and up-to-date information. :::
Throws an exception unless the current ImmSet or the Traversable is
empty
public function zip<Tu>(
Traversable<Tu> $traversable,
): ImmSet<HH\nothing>;
Since ImmSets only support integers or strings as values, we cannot
have a Pair as an ImmSet value. So in order to avoid an
InvalidArgumentException, either the current ImmSet or the
Traversable must be empty so that we actually return an empty ImmSet.
Traversable<Tu>$traversable - The Traversable to use to combine with the
elements of the current ImmSet.ImmSet<HH\nothing> - The ImmSet that combines the values of the current ImmSet
with the provided Traversable; one of these must be empty or
an exception is thrown.See Set::zip for usage examples.