Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105772 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51239 invoked from network); 21 May 2019 13:47:35 -0000 Received: from unknown (HELO mail-vk1-f173.google.com) (209.85.221.173) by pb1.pair.com with SMTP; 21 May 2019 13:47:35 -0000 Received: by mail-vk1-f173.google.com with SMTP id r23so4639007vkd.12 for ; Tue, 21 May 2019 03:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RBIVA3HleSs3n6HpjVeigVIZRUrBUkJA75pjFsB4LMw=; b=a5bxzErMF6smG7YdIUceWNe5aNHgW8S1J1k1oO0Y3oZSWPzxypCKLWChFLAxo40NDR B636HWoI2eQxHGm7zjI6csBMQ3rzmP3sGvUnXpV+rYkD4jLiZnwzCF5f3gisLGMeJgI1 945LvlXnUf1NSfSgdk9uzOHLWM20E3g9HNkYxshfV10s3gG+enCOFE0MOmEZTleEIWTS bZb2mYPVOdBYakHUZ4L7Yj3sy0fXxI3Ds3+WsXoJNz0BmBccxpXgJaCbAKQ4HRusWkOL luQGiLqoHglXwB8zOoVg5lxHHmZf1r6gIz1ENS19zrA0EhQ5UJe1A+5BF8aGLa4AAba6 1o8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RBIVA3HleSs3n6HpjVeigVIZRUrBUkJA75pjFsB4LMw=; b=lf3NBL4hJ/W3Kw1XJr+08BFL1hdiaBAOPDUi+Bv7IU8TjZLexvnFo8qfHdY2+lFbh6 NzpR89RqJw0QjNIdkIcyR2EWD49OZ3xoDzoVmJkCApkYDOuF2q+YtGoWtY4A/ypVuzJ8 usP8n8X4tp++P2rbiUpC151CYSGdi8fIwEUIAc0JQ9aCZEbM7abJSSCuicSe157zTo2W DWirWbNBwoXRGlTy6NSpwT2QmuY/v6k8tykKgose3HvJ9XbFUZ+5KLadmB1OehzOZSYk pLLSSPGBV0vTY27Q6b884Dei4FRW9Aj8bS/IUpOWDMOpyFgl9sFKvAcJnCk2UUk4Ya6P oLDg== X-Gm-Message-State: APjAAAX6Dxtj8KjT/MOoJyISZNASMneC7vXD5PRBQuIS1Zs75Tom25nH H2+qiCgLKwvSR3dOrjQWFIHWMfMRWxYUf9HEuBU= X-Google-Smtp-Source: APXvYqwYIeWfhb8uLhf77X/QcXFDB2kmeUPAZss7pLxygruZmHZyUKZzwD0S87baFHL5B7Tg+P5GfJfP3LYArcE1HdQ= X-Received: by 2002:a1f:a249:: with SMTP id l70mr11583587vke.58.1558436098010; Tue, 21 May 2019 03:54:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 21 May 2019 12:54:49 +0200 Message-ID: To: Nikita Popov Cc: Dik Takken , PHP Development Content-Type: multipart/alternative; boundary="00000000000006f0b9058963ae06" Subject: Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments From: george.banyard@gmail.com ("G. P. B.") --00000000000006f0b9058963ae06 Content-Type: text/plain; charset="UTF-8" On Tue, 21 May 2019 at 10:29, Nikita Popov wrote: > On Sat, May 18, 2019 at 9:37 PM Dik Takken wrote: > >> On 17-05-19 22:52, G. P. B. wrote: >> > >> > So as a side note aren't there maybe some other array functions which >> > behave like this? >> > >> >> Good point. I did a quick scan of the source code and came up with a >> list of possible candidates for a similar treatment: >> >> array_map() >> > > 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?) > > Nikita > I'm not sure I totally understand the edge case, moreover this isn't currently documented. Mind sharing an example or explaining a bit more in detail such that I can update the documentation? Best regards George P. Banyard --00000000000006f0b9058963ae06--