HH\Pair::toVector

Returns a Vector containing the elements of the current Pair

Description

public function toVector(): Vector<mixed>;

The returned Vector will, of course, be mutable.

Return Values

  • Vector<mixed> - a Vector with the elements of the current Pair.

Examples

<?hh

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

$p = Pair {'foo', -1.5};

$v = $p->toVector();
var_dump($v);
Output
object(HH\Vector)#2 (2) {
  [0]=>
  string(3) "foo"
  [1]=>
  float(-1.5)
}