Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105770 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8797 invoked from network); 21 May 2019 11:22:13 -0000 Received: from unknown (HELO mail-lj1-f194.google.com) (209.85.208.194) by pb1.pair.com with SMTP; 21 May 2019 11:22:13 -0000 Received: by mail-lj1-f194.google.com with SMTP id 188so847598ljf.9 for ; Tue, 21 May 2019 01:29:34 -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=UnQDeGdGMgmGFv414+mlChkLAxpGsgISvBFzscJ2VKg=; b=D2VtemR/PJMdSoNK8JljWaBkVr8I0LB2VsmFOv1UppxAG9ztBmJlM7bwuld+oNW2rT IGylaiFd+oE96xv/ifU5zHwC83sNQ6I8DbKD+vYuz5PoQtlMvnYsMGow+rNiXQ6QymRI +ao/MwBveLNLonlCdEtFsNf7lxmWbkOr+ppjQasko1JTbuLhI4+ZrZ8MpjlKbpOgDTx4 ilxjWU4b21FQ4JyRzyST+SP7YosX0mu5u5xZOObgLsLtquS9Cnf1FcdCzVgSeYThWSOQ 6aeYOCYPjNGGDG1QcnNAlUyMiyqybhGw4Up90Oox9tYxw1HKaQWOXLe9yBQSYqo5ljbM pJ3A== 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=UnQDeGdGMgmGFv414+mlChkLAxpGsgISvBFzscJ2VKg=; b=NKSwRQtA5JXFNcqrvIqjJCxe4RhTVfreEb+REPlZuwzFLl6ZrxcYpz1Ws2cEJBDZlD 3ufRDYFJJf6oa31yy5ZCSe6ZNLNx0UT6nZgnXnXv4iX8pAa3MgIq61OVjGwX/3+vdZMn E/wiMbSHODYXRJe5jagK56gv8iULRmI5kGxO6C3UEbyn1Molcv7SCxbLdvXA8FLbbP6o bvjd8yQRHO4A0eFocoD4xq7selfjS6YRa+C7sCbDbtXXfn+bzMA2mz75ho2VHSKWN96m yBV4xNWYnj+ma2/RsCiNrBT4RFOgvhOWX64LiVNQ+BpF6hxXcAqGaoDpgIB0RLHx4RBw AIlA== X-Gm-Message-State: APjAAAWE4IZZNrwWfzMoFWbI+p3YSwCEC8dgh2m9ovHq9tIHOidU2Lg/ xOg/8aQ7wcOj9OwnejAEzDivpMgStrqdAe7qim0= X-Google-Smtp-Source: APXvYqzS1B7VJu1QLIpuVDJ7Mz23GfYAJZYH6sQtLcoWlfU1+SBNRzgfP6Ja5eZwsuyH1/4/imny4UAEiAmJH9QP1q8= X-Received: by 2002:a2e:7411:: with SMTP id p17mr24300309ljc.24.1558427373861; Tue, 21 May 2019 01:29:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 21 May 2019 10:29:17 +0200 Message-ID: To: Dik Takken Cc: "G. P. B." , PHP Development Content-Type: multipart/alternative; boundary="00000000000006fe44058961a660" Subject: Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments From: nikita.ppv@gmail.com (Nikita Popov) --00000000000006fe44058961a660 Content-Type: text/plain; charset="UTF-8" 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?) > array_diff() & friends array_intersect() & friends These look like good candidates for allowing a single arg. Nikita --00000000000006fe44058961a660--