HH\Set::keys
Returns a Vector
containing the values of the current Set
public function keys(): Vector<arraykey>;
Set
s don't have keys, so this will return the values.
This method is interchangeable with toVector()
and values()
.
Returns
Vector<arraykey>
- aVector
(integer-indexed) containing the values of the currentSet
.
Examples
This example shows that keys()
returns a Vector
of the Set
's values because Set
s don't have keys:
$s = Set {'red', 'green', 'blue', 'yellow'};
var_dump($s->keys());
object(HH\Vector)#2 (4) {
[0]=>
string(3) "red"
[1]=>
string(5) "green"
[2]=>
string(4) "blue"
[3]=>
string(6) "yellow"
}