Crell / enum-comparison

A comparison of enumerations and similar features in different languages
80 stars 7 forks source link

enum_exists? #38

Closed iluuu1994 closed 3 years ago

iluuu1994 commented 3 years ago

https://github.com/php/php-src/pull/6489#issuecomment-739237321

We have interfaces_exists and trait_exists, do we need enum_exists to check whether a given class is an enum?

Crell commented 3 years ago

I have no strong opinion at the moment. On the reflection-related side, I am mostly comfortable with whatever the consensus is.

It probably makes sense, although Dave's point about also wanting symbol_exists() is valid, if tangential.

iluuu1994 commented 3 years ago

We have the Enum interface now so I think this is unnecessary. class_exists will return true.