Re: [PHP-DEV] [VOTE] Making stdClass iterable

2019-02-06 Thread Chase Peeler
On Tue, Feb 5, 2019 at 1:46 PM Rowan Collins wrote: > On Tue, 5 Feb 2019 at 17:25, Craig Duncan wrote: > > > The *iterable* type accepts a plain array, but not an object that is used > > to represent a plain array, that's surprising to me. > > > > > I think this notion of stdClass as "an object

Re: [PHP-DEV] [VOTE] Making stdClass iterable

2019-02-05 Thread Rowan Collins
On Tue, 5 Feb 2019 at 17:25, Craig Duncan wrote: > The *iterable* type accepts a plain array, but not an object that is used > to represent a plain array, that's surprising to me. > I think this notion of stdClass as "an object used to represent a plain array" is a peculiar one. The only

Re: [PHP-DEV] [VOTE] Making stdClass iterable

2019-02-05 Thread Craig Duncan
On Tue, 5 Feb 2019 at 16:39, Levi Morrison wrote: > I just wanted to pipe in to suggest an alternative approach to > accomplish some of the same goals: an external PropertyIterator. > I believe Nikita suggested something similar, and while it would certainly be useful it doesn't accomplish the

Re: [PHP-DEV] [VOTE] Making stdClass iterable

2019-02-05 Thread Levi Morrison
On Mon, Feb 4, 2019 at 11:58 AM Craig Duncan wrote: > > Hi all, > > Following the discussion it's now time to vote on whether we make the > stdClass iterable or not. > https://wiki.php.net/rfc/iterable-stdclass > > Note that while there is an implementation available, the vote is only on >

Re: [PHP-DEV] [VOTE] Making stdClass iterable

2019-02-05 Thread Michał Brzuchalski
wt., 5 lut 2019 o 10:24 Côme Chilliet napisał(a): > Hello, > > What is the usecase for this? > > The RFC does not explain what it would be useful for. > json_decode already provides an option for getting arrays instead of > objects. > > All in all the RFC does not provide enough information. As

Re: [PHP-DEV] [VOTE] Making stdClass iterable

2019-02-05 Thread Côme Chilliet
Hello, What is the usecase for this? The RFC does not explain what it would be useful for. json_decode already provides an option for getting arrays instead of objects. All in all the RFC does not provide enough information. As I understand it if stdClass is Traversable then all objects are,

[PHP-DEV] [VOTE] Making stdClass iterable

2019-02-04 Thread Craig Duncan
Hi all, Following the discussion it's now time to vote on whether we make the stdClass iterable or not. https://wiki.php.net/rfc/iterable-stdclass Note that while there is an implementation available, the vote is only on whether stdClass should fulfil the Traversable interface or not. Nikita had