Description:
------------
When using iterator_to_array on a function that return a \Generator, if this function use both yield and yield from it will only put values of the yield from expression.
Test script:
---------------
<?php
function yield1() {
yield 'foo';
}
function yield2() {
yield 'bar';
yield from yield1();
}
// Will only display foo
var_dump(iterator_to_array(yield2()));
// will correctly display each value
foreach (yield2() as $data) {
var_dump($data);
}
Expected result:
----------------
It should create an array with all values and not only the one from the yield from expression.
Actual result:
--------------
Create an array only on the yield from expression

Oh, didn't see that, only search on open issue and not closed, sorry for the noise.
I made a patch to the documentation that add an exemple for this use case, warning on preserve keys was not so obvious for me, as in my head talking about keys is only relevant for string keys on not numeric ones.
Thanks again for the quick answer,