HH\Set::toVector

Description

public function toVector(): Vector<Tv>

Returns a Vector of the current Set values.

Return Values

Examples

<?hh

namespace Hack\UserDocumentation\API\Examples\Set\ToVector;

$s = Set {'red', 'green', 'blue', 'yellow'};

$v = $s->toVector();

var_dump($v);
Output
object(HH\Vector)#2 (4) {
  [0]=>
  string(3) "red"
  [1]=>
  string(5) "green"
  [2]=>
  string(4) "blue"
  [3]=>
  string(6) "yellow"
}