HH\Vector::keys

Description

public function keys(): Vector<int>

Returns a Vector containing the keys of the current Vector.

Return Values

Examples

<?hh

namespace Hack\UserDocumentation\API\Examples\Vector\Keys;

$v = Vector {'red', 'green', 'blue', 'yellow'};
var_dump($v->keys());
Output
object(HH\Vector)#2 (4) {
  [0]=>
  int(0)
  [1]=>
  int(1)
  [2]=>
  int(2)
  [3]=>
  int(3)
}