HH\ImmMap::fromItems

Creates an ImmMap from the given Traversable, or an empty ImmMap if null is passed.

Description

public static function fromItems(
  ?Traversable<Pair<Tk,Tv>> $items,
): ImmMap<Tk,Tv>

Creates an ImmMap from the given Traversable, or an empty ImmMap if null is passed.

This is the static method version of the ImmMap::__construct() constructor.

Parameters

  • ?Traversable<Pair<Tk,Tv>> $items - any Traversable object from which to create an ImmMap (e.g., array). If null, then an empty ImmMap is created.

Return Values

Examples

See Map::fromItems for usage examples.