Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105815 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 96316 invoked from network); 1 Jun 2019 14:34:08 -0000 Received: from unknown (HELO lb2-smtp-cloud9.xs4all.net) (194.109.24.26) by pb1.pair.com with SMTP; 1 Jun 2019 14:34:08 -0000 Received: from [IPv6:2001:983:6fc5:1:1ce2:d87:c4d:ce69] ([IPv6:2001:983:6fc5:1:1ce2:d87:c4d:ce69]) by smtp-cloud9.xs4all.net with ESMTPA id X2Qnh92bSsDWyX2QphoYxO; Sat, 01 Jun 2019 13:44:16 +0200 To: Nikita Popov Cc: "G. P. B." , PHP Development References: Message-ID: Date: Sat, 1 Jun 2019 13:44:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfEuGFGkUI4zPzcyamrgGh9YdL1Fe2uTknQlzbvvhFwU/S60JWocWZxdAhm5wt/nm1uLbuMVIYNvktVz/CM29EBN+2St4BjuDmU4hPzjsFqlmturGe0bK 6EaoDf5zOcGPP/2qsdRWumk0qCAkBHVWfpIiSbNUh74ZXeu8zAmrzL+jMVtP3U8FalQ5vspOd1u45GiuDpZMMaG/2O+J3CJsGfY1n/U1hle6JVUf2/22cbvb D8l8NqWMsAZzxRKEv47RMxFswmzvtRFeHW2OSbh/d9BK7GoCF6hAfTEnPrR+CxdiXSA1fJ00umy0lAtxQMvNYttFCU8p0hkR7INLUVzJq+A= Subject: Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments From: d.takken@xs4all.nl (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