Re: Consolidation of Traversable and array operations
| From: | Michael Wallner | Date: | Thu, 16 Jul 2015 10:38:45 +0000 |
| Subject: | Re: Consolidation of Traversable and array operations | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-87195@lists.php.net to get a copy of this message | ||
On 16/07/15 11:26, Rowan Collins wrote:
> Benjamin Eberlei wrote on 15/07/2015 21:19:
>>
>> But instanceof and anything related to Reflection or get_class or
>> relevant code will fail on array.
>
>
> Ah, yes, I hadn't thought of reflection type things. I don't think
> instanceof would be a problem, because checking for any class or
> interface other than Traversable would correctly return false; not sure
> if it would make sense for "array() instanceof Traversable" to return
> true or not...
>
Maybe some pseudotype like callable (e.g. iteratable) makes more sense then?
--
Regards,
Mike