Re: [RFC][Under discussion] Fetch properties in const expressions
| From: | Larry Garfield | Date: | Sun, 29 May 2022 21:25:02 +0000 |
| Subject: | Re: [RFC][Under discussion] Fetch properties in const expressions | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-117833@lists.php.net to get a copy of this message | ||
May 29, 2022 11:55:56 AM Michał Marcin Brzuchalski <michal.brzuchalski@gmail.com>:
>
>
> niedz., 29 maj 2022 o 18:24 Larry Garfield <larry@garfieldtech.com> napisał(a):
>> On Sat, May 28, 2022, at 4:44 AM, Ilija Tovilo wrote:
>>> Hi everyone
>>>
>>> I'd like to start a discussion on a simple RFC to allow fetching
>>> properties in constant expressions.
>>>
>>> https://wiki.php.net/rfc/fetch_property_in_const_expressions
>>>
>>> The RFC proposes adding support for fetching properties in constant
>>> expressions using the -> operator. I'm looking forward to your
>>> feedback.
>>>
>>> Regards,
>>> Ilija
>>
>> The enum-in-attribute use case came up recently in Symfony. I'm in favor and the RFC
>> looks good to me.
>
> Personally, I'd start the discussion on
> https://wiki.php.net/rfc/object_keys_in_arrays instead as this might
> solve the need for
> fetching property in constant expressions.
>
> Cheers,
> Michał Marcin Brzuchalski
Objects as array keys would not help with the attribute use case. It may be useful on its own, but
it does not obviate the need for this rfc.
--Larry Garfield