HH\Set::add

Add the value to the current Set

public function add(
  Tv $val,
): Set<Tv>;

$set->add($v) is semantically equivalent to $set[] = $v (except that add() returns the Set).

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

Parameters

  • Tv $val

Return Values