On Tue, 4 Feb 2020 at 18:06, Aimeos | Norbert Sendetzky <norb...@aimeos.com>
wrote:

> Am 04.02.20 um 18:18 schrieb Larry Garfield:
> > The more I think on it, the less I like `arrayable`.  PHP arrays are
> > a terrible data structure from a type system point of view, with too
> > much functionality crammed into one variable type.
>
> The array internals are outside the scope of this proposal and are not
> affected in any way by this proposal.
>


I think Larry's point was that the flexibility of PHP's array type makes it
really hard to pin down whether a given object is "array-like" or not, and
which attributes a particular function actually cares about.

A general "intersection type" system might be more useful, because then you
could require the parts you specifically needed, such as
"traversable&ArrayAccess" or "traversable&countable".

Regards,
-- 
Rowan Tommins
[IMSoP]

Reply via email to