[PHP] Best practices: `array_find_key` on `Enum::cases`?

[email protected] (0xEAB)
Newsgroups php.general
Message-ID <[email protected]>
I’ve written an enum method as follows.

```
public function getPrefixBitCount(): int
{
	return array_find_key(self::cases(), function(CidrMaskIPv4 $value): bool {
		return $value === $this;
	});
}
```

Is this usage of `Enum::cases()` fine?
Can the order of cases in the returned array be relied on?
Can the numeric keys of the returned array be relied on?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.