Re: [PHP-DEV] Calling array_merge / array_merge_recursive withoutarguments

This is only part of a thread. view whole thread
June 1, 2019 11:44 (Dik Takken)
On 21-05-19 10:29, Nikita Popov wrote:
> This one makes sense in theory, because array_map(null, ...$arrays) is a > way to perform a zip operation in PHP. Unfortunately there is an ugly > special case if there is only a single array, which makes this not actually > usable in practice, unless you know that there are at least two arrays. As > such, accepting zero arrays wouldn't be very useful unless we also want to > fix that issue (PHP 8 maybe?)
How about moving this zip functionality out of array_map() into a newly introduced zip() method? That sounds like something that would be feasible for me to do, given my limited knowledge of PHP internals. What would be the proper path, in terms of PHP releases, for making this change? Maybe something like: 1. Add zip() and deprecate null callbacks in array_map() in PHP 7.4 2. Remove null callbacks support in array_map() in PHP 8 3. Allow passing zero arrays to array_map() in PHP 8 Do these changes require an RFC? Regards, Dik Takken