HH\Map::toKeysArray
Returns an array
whose values are the keys of the current Map
public function toKeysArray(): varray<Tk>;
Returns
varray<Tk>
- an integer-indexedarray
containing the keys from the currentMap
.
Examples
$m = Map {
'red' => '#ff0000',
'green' => '#00ff00',
'blue' => '#0000ff',
'yellow' => '#ffff00',
};
$keys_array = $m->toKeysArray();
var_dump(is_array($keys_array));
var_dump($keys_array);
bool(true)
array(4) {
[0]=>
string(3) "red"
[1]=>
string(5) "green"
[2]=>
string(4) "blue"
[3]=>
string(6) "yellow"
}