[php-src] Issue #8344: Attribute parameters cannot contain BackedEnum values
| From: | Crell | Date: | Tue, 12 Apr 2022 15:28:36 +0000 |
| Subject: | [php-src] Issue #8344: Attribute parameters cannot contain BackedEnum values | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-240904@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8344
Comment Author: Crell
I can't think of a good language argument to not allow En::Case->value (and I suppose also
En::Case->name) in constant expressions. I could argue that it's a design flaw in an API,
but that's a separate matter. If Nikita thinks it's safe them I'm fine with allowing
it.
I agree with others here that this sounds like an 8.2 feature. I also don't see a good reason
to limit it to enums, when enums are really just sugar over objects to begin with.
(new
Foo)->value is very close to what's actually going on anyway.
So yeah, my vote would be for allowing static -> de-references in constant expressions generally,
as of 8.2. That... probably requires an RFC.