Back to Hhvm

Concat

hphp/hack/manual/apis/Classes/HH/Pair/concat.md

latest1.6 KB
Original Source

:::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. :::

Returns an ImmVector that is the concatenation of the values of the current Pair and the values of the provided Traversable

Hack
public function concat<Tu super mixed>(
  Traversable<mixed, Tu> $traversable,
): ImmVector<mixed, Tu>;

The values of the provided Traversable is concatenated to the end of the current Pair to produce the returned ImmVector.

Guide

Parameters

Returns

Examples

This example creates a new ImmVector by concatenating a Traversable with the values in the Pair.

basic-usage.hack
$p = Pair {'foo', -1.5};

$v = $p->concat(vec[100, 'bar']);
\var_dump($v);
<!-- HHAPIDOC -->