Re: Typed constants revisited
| From: | Alexandru Pătrănescu | Date: | Wed, 30 Mar 2022 04:34:58 +0000 |
| Subject: | Re: Typed constants revisited | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-117448@lists.php.net to get a copy of this message | ||
Hey Mark,
On Wed, Mar 30, 2022 at 6:03 AM Mark Niebergall <mbniebergall@gmail.com>
wrote:
>
> I have updated the RFC
> https://wiki.php.net/rfc/typed_class_constants with
> more details and examples from this thread, and updated the RFC status to
> Under Discussion. Hopefully the updated RFC helps answer questions and
> clarifies what the proposal includes.
>
Thanks for the RFC and the drive here.
I personally see the benefit and I think it would be a nice addition.
I think you should also update the "Supported types" section.
Starting with enums, constants can also be objects. Once a good technical
solution is found, any object would be supported probably
https://wiki.php.net/rfc/new_in_initializers#future_scope
I think that only void, never and callable types should not be supported,
just like on properties.
> Of note is the "Inheritance and variance" section, which details uses with
> abstracts and interfaces, plus the "Constant values" section which includes
> details about errors.
>
>
> >
> > --
> > Guilliam Xavier
> >
>
Thanks,
Alex