Re: Re: [RFC] Iterable

From: Date: Mon, 13 Jun 2016 15:59:29 +0000
Subject: Re: Re: [RFC] Iterable
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-93941@lists.php.net to get a copy of this message
On Mon, Jun 13, 2016 at 5:42 AM, Christoph Becker <cmbecker69@gmx.de> wrote: > On 11.06.2016 at 01:37, Aaron Piotrowski wrote: >> I would like to propose a new iterable pseudo-type that accepts both arrays and objects >> implementing Traversable. Values accepted by iterable can then be used with foreach and yield from, >> or help to reduce type-checking logic in general. >> >> Please review the RFC here: >> https://wiki.php.net/rfc/iterable >> <https://wiki.php.net/rfc/iterable> > > Thanks, Aaron! I definitely like this idea (I'm not sure about the > details yet – would have to thoroughly investigate), as it is apparently > solving a long-standing issue, and is in my opinion a cleaner solution > than (explicitly) having to resort to a union type. My opinion is contrary: the union type is the cleaner solution as it does not require special casing machinery in the engine.

« previous php.internals (#93941) next »