HH\Pair::concat
Returns an ImmVector
that is the concatenation of the values of the
current Pair
and the values of the provided Traversable
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
Traversable<mixed, Tu> $traversable
- TheTraversable
to concatenate to the currentPair
.
Returns
ImmVector<mixed, Tu>
- The concatenatedImmVector
.
Examples
This example creates a new ImmVector
by concatenating a Traversable
with the values in the Pair
.
$p = Pair {'foo', -1.5};
$v = $p->concat(array(100, 'bar'));
var_dump($v);
object(HH\ImmVector)#2 (4) {
[0]=>
string(3) "foo"
[1]=>
float(-1.5)
[2]=>
int(100)
[3]=>
string(3) "bar"
}