HH\ImmMap::fromItems
Creates an ImmMap
from the given Traversable
, or an empty ImmMap
if null
is passed
public static function fromItems(
?Traversable<Pair<Tk, Tv>> $iterable,
): ImmMap<Tk, Tv>;
This is the static method version of the ImmMap::__construct()
constructor.
Parameters
?
Traversable<Pair<Tk,
Tv>> $iterable
Returns
ImmMap<Tk,
Tv>
- AnImmMap
with the key/value pairs from theTraversable
; or an emptyImmMap
if theTraversable
isnull
.
Examples
See [Map::fromItems
](</hack/reference/class/Map/fromItems/#examples>) for usage examples.