HH\Pair::toImmVector

Description

public function toImmVector(): ImmVector<mixed>

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

Return Values

Examples

<?hh

namespace Hack\UserDocumentation\API\Examples\Pair\ToImmVector;

$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)
}