Re: [PHP-DEV] Make iterator_to_array() accept all iterables

2022-06-21 Thread Levi Morrison via internals
On Fri, Jun 17, 2022 at 9:28 AM G. P. B. wrote: > > On Fri, 17 Jun 2022 at 16:20, Tim Düsterhus wrote: > > > Hi Internals > > > > I've come across a case where it would've been useful if > > `iterator_to_array()` would accept iterable instead of Traversable to > > avoid checking whether the

Re: [PHP-DEV] Make iterator_to_array() accept all iterables

2022-06-20 Thread Guilliam Xavier
On Fri, Jun 17, 2022 at 7:21 PM Tim Düsterhus wrote: > > Hi > > On 6/17/22 18:06, Guilliam Xavier wrote: > >> https://github.com/php/php-src/pull/8819 > > > > Just so that it can't be said that it hasn't been asked: what about > > iterator_count(), and iterator_apply()? > > I also came across

Re: [PHP-DEV] Make iterator_to_array() accept all iterables

2022-06-17 Thread Tim Düsterhus
Hi On 6/17/22 18:06, Guilliam Xavier wrote: https://github.com/php/php-src/pull/8819 Just so that it can't be said that it hasn't been asked: what about iterator_count(), and iterator_apply()? I also came across those, while implementing the PR, but I intentionally did not touch them

Re: [PHP-DEV] Make iterator_to_array() accept all iterables

2022-06-17 Thread Guilliam Xavier
>https://github.com/php/php-src/pull/8819 Just so that it can't be said that it hasn't been asked: what about iterator_count(), and iterator_apply()? Regards, -- Guilliam Xavier -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php

Re: [PHP-DEV] Make iterator_to_array() accept all iterables

2022-06-17 Thread Larry Garfield
On Fri, Jun 17, 2022, at 10:20 AM, Tim Düsterhus wrote: > Hi Internals > > I've come across a case where it would've been useful if > `iterator_to_array()` would accept iterable instead of Traversable to > avoid checking whether the input variable already is an array. > > To not repeat what I've

Re: [PHP-DEV] Make iterator_to_array() accept all iterables

2022-06-17 Thread G. P. B.
On Fri, 17 Jun 2022 at 16:20, Tim Düsterhus wrote: > Hi Internals > > I've come across a case where it would've been useful if > `iterator_to_array()` would accept iterable instead of Traversable to > avoid checking whether the input variable already is an array. > > To not repeat what I've

[PHP-DEV] Make iterator_to_array() accept all iterables

2022-06-17 Thread Tim Düsterhus
Hi Internals I've come across a case where it would've been useful if `iterator_to_array()` would accept iterable instead of Traversable to avoid checking whether the input variable already is an array. To not repeat what I've already written in my proposed PR, please see: