I think it useful, despite that it could be done by using array_push() as
Woortmann said. Anyway, I think valid a new proposal for thinks like that.

But I will suggests this:

$arr[] = ... $items;


Atenciosamente,
David Rodrigues


Em sáb., 28 de mar. de 2020 às 20:07, Michael Voříšek - ČVUT FEL <
voris...@fel.cvut.cz> escreveu:

> Hi all PHP gurus!
>
> This is a feature request / RFC for the following use-case:
>
> $res = [];
> foreach ($arr as $i) {
> foreach (make_res($i) as $v) {
> $res[] = $v;
> }
> }
>
> Array_merge in loop is very sloop so it is not a solution.
>
> which I propose to shorten to:
>
> $res = [];
> foreach ($arr as $i) {
> $res[...] = make_res($i);
> }
>
> Appending multiple elements to an array is very common use-case.
>
> With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem,
>
> Michael Voříšek

Reply via email to