On 15 July 2015 20:39:05 GMT+01:00, Levi Morrison <le...@php.net> wrote:
>Do note that the union types RFC would also alleviate some of this
>pain for user-land functions, since `array | Traversable` would cover
>the required access pattern. I think this is a superior approach
>myself, but I may be a bit biased as I am authoring that proposal:
>https://wiki.php.net/rfc/union_types

I like the idea of union types in general, but have always felt that a typehint 
of Traversable should accept arrays as a matter of course. The only thing such 
a typehint guarantees is that foreach will work (there are no methods defined 
that can be called directly), and an array meets that condition. The only 
difference I can see is in the passing / mutability behaviour of objects vs 
non-objects.

Regards,
-- 
Rowan Collins
[IMSoP]


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

Reply via email to