Re: Making stdClass iterable

From: Date: Mon, 14 Jan 2019 13:23:24 +0000
Subject: Re: Making stdClass iterable
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-103729@lists.php.net to get a copy of this message
On Sat, 12 Jan 2019 at 20:13, Dan Ackroyd <Danack@basereality.com> wrote: > I think the correct long-term solution for this would be for us to > revisit the union type RFC (https://wiki.php.net/rfc/union_types) and > so be able to define a type like: > > type foreachable = object|iterable; > This argument makes sense to me in a pre-iterable world, but as we already have an iterable type I don't understand why it shouldn't accept stdClass as well as array. What about an array is more iterable than a stdClass object?

« previous php.internals (#103729) next »