HH\Map::setAll

For every element in the provided Traversable, stores a value into the current Map associated with each key, overwriting the previous value associated with the key

public function setAll(
  ?KeyedTraversable<Tk,Tv> $iterable,
): Map<Tk, Tv>;

This method is equivalent to Map::addAll(). If a key to set does not exist in the Map that does exist in the Traversable, it is created. This is inconsistent with, for example, the method Vector::setAll() where if a key is not found, an exception is thrown.

Future changes made to the current Map ARE reflected in the returned Map, and vice-versa.

Parameters

  • ?KeyedTraversable<Tk,Tv> $iterable

Return Values