Re: [RFC] Iterable
| From: | Sara Golemon | Date: | Sun, 03 Jul 2016 20:47:22 +0000 |
| Subject: | Re: [RFC] Iterable | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-94367@lists.php.net to get a copy of this message | ||
On Sun, Jul 3, 2016 at 9:50 AM, Aaron Piotrowski <aaron@trowski.com> 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?
>
> That code will continue to work just as it always has. stdClass will not be accepted by the
> iterable type.
>
As, it's worth noting, it was never accepted for Traversable.
https://3v4l.org/XJnNi
-Sara