Am 04.02.20 um 19:17 schrieb Rowan Tommins:
> 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.

What else besides array access, counting and traversing is possible that
may differ from classes that implement those interfaces?

> 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".

I think that's too complicated and we should make it as easy as possible
for PHP developers.

Also, there's already an RFC for intersection types but it was never
adopted: https://wiki.php.net/rfc/intersection_types

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to