Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105816 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99489 invoked from network); 1 Jun 2019 14:39:20 -0000 Received: from unknown (HELO lb2-smtp-cloud9.xs4all.net) (194.109.24.26) by pb1.pair.com with SMTP; 1 Jun 2019 14:39:20 -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 X2Vph93xCsDWyX2VrhoZN4; Sat, 01 Jun 2019 13:49:28 +0200 To: Nikita Popov Cc: "G. P. B." , PHP Development References: Message-ID: <4a6d20e3-76dd-c2e8-966d-96fd03775fa5@xs4all.nl> Date: Sat, 1 Jun 2019 13:49:25 +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: nl Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfJdhWgvBPtpgZK8nrVuKaiJtGN2EQwTuE92Ic+NUwbWSzC8hGPIs7AlCX2hg4tVmlkxn0jmf3EkV7BKvsBDDGi9c1vdeNPLkHN/YD+57kC9Njl5Cc3Z1 3iz8YHgEjxddolrYEeoQwPufSWFLRQ8dDeO4SBEFDDG05vSLPO6OJT7bGoK9MBT40RseCAPzxog5s1sIzbhIxWl8IHskeekvOIO6YC77jvzbOQDXapT4awL4 Q30bqP+yp3Gm9gafkf0lRDupa4bFFcNGhMYgR2Sg27Pp5uGwPgcgnJDpXH5bQF9qaz1oNDl9Y2iSARPD0hVZc1obP33O0qs9YcCMjChA3ps= Subject: Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments From: d.takken@xs4all.nl (Dik Takken) On 23-05-19 21:18, Nikita Popov wrote: > On Thu, May 23, 2019 at 9:02 PM Dik Takken wrote: > >> For array_intersect(), I was actually considering to allow zero >> arguments. The use case I have in mind is to determine the common >> elements in a set of zero or more arrays, like this: >> >> array_intersect(...$arrays) >> >> If that would just return an empty array when $arrays is empty, no >> additional empty check is needed and the above would do what I >> intuitively expect it to do. >> > > Common intuition, but not mathematically sound. Assuming we're intersecting > subsets of a certain universe U, then the intersection of no sets is U > itself, not the empty set. (A useful intuition is that intersecting > additional sets can only make the result smaller -- as such intersecting no > sets at all yields the largest possible result.) > > Nikita > You are completely right, thanks for pointing that out. Regards, Dik Takken