HH\Map::keys

Description

public function keys(): Vector<Tk>

Returns a Vector containing the keys of the current Map.

Return Values

Examples

<?hh

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

$m = Map {
  'red' => '#ff0000',
  'green' => '#00ff00',
  'blue' => '#0000ff',
  'yellow' => '#ffff00',
};
var_dump($m->keys());
Output
object(HH\Vector)#2 (4) {
  [0]=>
  string(3) "red"
  [1]=>
  string(5) "green"
  [2]=>
  string(4) "blue"
  [3]=>
  string(6) "yellow"
}