HH\Pair::toImmVector

Returns an immutable vector (ImmVector) containing the elements of the current Pair

public function toImmVector(): ImmVector<mixed>;

Returns

  • ImmVector<mixed> - an ImmVector with the elements of the current Pair.

Examples

$p = Pair {'foo', -1.5};

$immutable_v = $p->toImmVector();

var_dump($immutable_v);
Output
object(HH\ImmVector)#2 (2) {
  [0]=>
  string(3) "foo"
  [1]=>
  float(-1.5)
}