HH\Vector::toImmMap
Returns an immutable, integer-keyed map (ImmMap
) based on the values of
the current Vector
public function toImmMap(): ImmMap<int, Tv>;
Returns
ImmMap<int,
Tv>
- AnImmMap
that has the integer keys and associated values of the currentVector
.
Examples
$v = Vector {'red', 'green', 'blue', 'yellow'};
$imm_map = $v->toImmMap();
\var_dump($imm_map is \HH\ImmMap<_, _>);
\var_dump($imm_map->keys());
\var_dump($imm_map);