into an array?
Example, given:
function gen() : Generator
{
yield 1;
yield 2;
yield 3;
}
I'm looking for something along the lines of:
$gen = gen();
$array = $gen::resolve();
Or
$gen = gen();
$array = resolve_generator($gen);
Yes, iterator_to_array https://3v4l.org/J4Shh
Обсуждают сегодня