On 13/03/2019 21:10, Dik Takken wrote:
So in practice, I expect that using comprehensions as proposed in the new RFC will also require doing a lot of iterator_to_array(). A dual comprehension syntax could fix that.
At risk of complicating things further, might the solution to that be to have a shorter syntax for iterator_to_array in general?
It's a shame array-casts are defined for arbitrary objects, else we could have (array)$iterator - and therefore (array)[foreach ($users as $user) yield $user->firstName]
Regards, -- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php