HH\ImmSet::firstKey

Returns the first "key" in the current ImmSet

public function firstKey(): ?arraykey;

Since ImmSets do not have keys, it returns the first value.

This method is interchangeable with firstValue().

Returns

  • ?arraykey - The first value in the current ImmSet, or null if the current ImmSet is empty.

Examples

See [Set::firstKey](</hack/reference/class/Set/firstKey/#examples>) for usage examples.