Closed iluuu1994 closed 3 years ago
technically you can do $reflectionEnum->getMethod("has")->invoke(null, $someValue);
… And practically $reflectionEnum->getName()::has($value);
@bwoebi Sure, but is that generally considered enough? Many things in PHP can be done without reflection ($foo->{$bar}
) but they are generally also possible through reflection.
I don't care :-D I never use the reflection way unless I have access permission issues (which cannot happen here).
Honestly, I'm fine with these not being accessible through reflection directly. If you're in a reflection context you can always get from there to the actual case object and then call the appropriate methods. I'm also fine if Ilija wants to add it. I don't care much either way.
Well, let's leave it then :laughing:
From reflection it's currently not possible to get a case from a scalar. Reflection should probably be able to do that.