Re: [PHP-DEV] [RFC] Iterable

2016-07-03 Thread Sara Golemon
On Sun, Jul 3, 2016 at 9:50 AM, Aaron Piotrowski wrote: >> Do you mean that this code: >> >> $a = json_decode('{"a": 1, "b": 2, "c": 3}'); >> foreach($a as $b) { >>var_dump($b); >> } >> >> will no longer work, or that it will still work, but stdClass would not >> be instanceof Iterable? > > Th

Re: [PHP-DEV] [RFC] Iterable

2016-07-03 Thread Aaron Piotrowski
Hi Stas, > On Jul 2, 2016, at 7:00 PM, Stanislav Malyshev wrote: > > Do you mean that this code: > > $a = json_decode('{"a": 1, "b": 2, "c": 3}'); > foreach($a as $b) { >var_dump($b); > } > > will no longer work, or that it will still work, but stdClass would not > be instanceof Iterable?

Re: [PHP-DEV] [RFC] Iterable

2016-07-02 Thread Stanislav Malyshev
Hi! > Generally when I've seen an object that did not implement Traversable > used with foreach it has been an error. The exception of course is > stdClass, particularly because of json_decode(). There was no > discussion on the list of allowing stdClass, but I did discuss it > with some people in

Re: [PHP-DEV] [RFC] Iterable

2016-07-02 Thread Jeremy Mikola
On Saturday, July 2, 2016, Aaron Piotrowski wrote: > > > There was no discussion on the list of allowing stdClass, but I did discuss > it with some people in chat. Our consensus was that a casting to an array > was a reasonable and simple requirement to allow an instance of stdClass to > be iterab

Re: [PHP-DEV] [RFC] Iterable

2016-07-02 Thread Aaron Piotrowski
Hi Jeremy, > On Jun 30, 2016, at 3:01 PM, Jeremy Mikola wrote: > > Was there any discussion about a special allowance being made for stdClass? > > I've noted the is_iterable(new stdClass) example and ensuing "Object > Iteration" section: > > PHP allows any object to be used with foreach. Howe

Re: [PHP-DEV] [RFC] Iterable

2016-06-30 Thread Nikita Popov
On Thu, Jun 30, 2016 at 10:01 PM, Jeremy Mikola wrote: > On Sat, Jun 18, 2016 at 11:34 AM, Aaron Piotrowski > wrote: > > > > > I plan on bringing the iterable RFC (https://wiki.php.net/rfc/iterable) > > to a vote in about a week, does anyone have any further feedback on this > > proposal? > > >

Re: [PHP-DEV] [RFC] Iterable

2016-06-30 Thread Jeremy Mikola
On Sat, Jun 18, 2016 at 11:34 AM, Aaron Piotrowski wrote: > > I plan on bringing the iterable RFC (https://wiki.php.net/rfc/iterable) > to a vote in about a week, does anyone have any further feedback on this > proposal? > Was there any discussion about a special allowance being made for stdClas

Re: [PHP-DEV] [RFC] Iterable

2016-06-20 Thread Dmitry Stogov
: Dan Ackroyd Cc: internals@lists.php.net; Dmitry Stogov Subject: Re: [PHP-DEV] [RFC] Iterable > On Jun 18, 2016, at 6:11 PM, Dan Ackroyd wrote: > > Hi Aaron, > >> does anyone have any further feedback on this proposal? > > What is the performance impact of the RFC on the st

Re: [PHP-DEV] [RFC] Iterable

2016-06-19 Thread Aaron Piotrowski
> On Jun 18, 2016, at 6:11 PM, Dan Ackroyd wrote: > > Hi Aaron, > >> does anyone have any further feedback on this proposal? > > What is the performance impact of the RFC on the standard performance > benchmarks? > > And can you comment on the performance of using iterable as a type for > par

Re: [PHP-DEV] [RFC] Iterable

2016-06-18 Thread Dan Ackroyd
Hi Aaron, > does anyone have any further feedback on this proposal? What is the performance impact of the RFC on the standard performance benchmarks? And can you comment on the performance of using iterable as a type for parameters/return types, compared to normal classes? cheers Dan -- PHP I

Re: [PHP-DEV] [RFC] Iterable

2016-06-18 Thread Aaron Piotrowski
Hi all, I plan on bringing the iterable RFC (https://wiki.php.net/rfc/iterable) to a vote in about a week, does anyone have any further feedback on this proposal? Thanks! Aaron Piotrowski -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] [RFC] Iterable

2016-06-10 Thread Aaron Piotrowski
Hello, 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/r