RE: [PHP-DEV] Introducing "Array Of" RFC
| From: | Robert Stoll | Date: | Mon, 20 Jan 2014 19:48:26 +0000 |
| Subject: | RE: [PHP-DEV] Introducing "Array Of" RFC | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-71340@lists.php.net to get a copy of this message | ||
>
> I would love to get generics as long as typed arrays. And when I say typed
> arrays I mean array which can hold only the elements of said class (not an
> interface). It's not just semantics, it's also optimization that can be
> done when you know that array will hold only elements of the said type.
> (You know how much memory element will take. It'll make a room for
> possible optimizations)
>
Hm.. I did not understand the RFC this way. It says, "allowing an array of that hinted type to
be passed as an argument", so I assumed it would work with interfaces as well.
And what about sub-types?