Hacker News new | past | comments | ask | show | jobs | submit login

Thanks for clearing that up.

There's one more thing not addressed by the RFC: how to check for a particular enum to exist. The way I see it, a new function "enum_exists" would be needed and validating a QCN would become this ugly:

class_exists($qcn) || enum_exists($qcn) || interface_exists($qcn) || trait_exists($qcn)




its implicitly addressed by saying enums map to objects and clarifying how "::class" works, i.e. enum_exists is not necessary, because its implementation would essentially be class_exists.


Ah, right. The assumption that "new ReflectionClass($qcn)" where "assert(class_exists($qcn))" works should still be valid as RefelctionEnum[sic] extends ReflectionClass.

I'm not completely certain on this, though. If not, it'd definitely break things.


its definitely a weak point of the RFC at the moment.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: