Re: [RFC] Typed array declarations
| From: | Rowan Tommins [IMSoP] | Date: | Fri, 17 Jul 2026 16:11:49 +0000 |
| Subject: | Re: [RFC] Typed array declarations | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-131999@lists.php.net to get a copy of this message | ||
On 17 July 2026 14:20:42 BST, Wendell Adriel <wendelladriel.ti@gmail.com> wrote:
>Yeah, I think that we have two paths from here:
>
>1. Doing only Implementation Level 1 for this RFC, it's simple enough to be
>on PHP 8.7 IMO, and then deferring Level 2 and 3 to a new RFC after the
>generics design.
>2. Defer the whole RFC after the generics design and aim for Implementation
>Level 2 or 3 (3 as preferred one).
Your "level 1" sounds similar in spirit to the "bound-erased generics" RFC which
was just declined: https://wiki.php.net/rfc/bound_erased_generic_types
Reserving the syntax without directly enforcing it was not popular, and could actually make it
*harder* to add an enforced version later, because you'd be changing the behaviour of existing
code.
I think this is one of those cases where just talking about the abstract design doesn't get us
very far without a concrete plan of implementation - there's plenty of support for the feature
*in theory*, but the reason it hasn't happened is that it's really hard to do well within
PHP's runtime type model.
Regards,
Rowan Tommins
[IMSoP]