Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-06-01 Thread 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: >> >>

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-06-01 Thread 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

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-23 Thread Nikita Popov
On Thu, May 23, 2019 at 9:02 PM Dik Takken wrote: > 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,

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-23 Thread 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

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-21 Thread G. P. B.
On Tue, 21 May 2019 at 14:17, G. P. B. wrote: > I think I'll add a small note to the doc and an example showing the > difference in behaviour as it seems pretty berried in the examples (the 4th > one to be precise atm). > Added a note in the doc: http://svn.php.net/viewvc?view=revision=347462

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-21 Thread G. P. B.
On Tue, 21 May 2019 at 13:40, Christoph M. Becker wrote: > On 21.05.2019 at 12:54, G. P. B. wrote: > > > On Tue, 21 May 2019 at 10:29, Nikita Popov wrote: > > > >> On Sat, May 18, 2019 at 9:37 PM Dik Takken wrote: > >> > >>> Good point. I did a quick scan of the source code and came up with a

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-21 Thread Christoph M. Becker
On 21.05.2019 at 12:54, G. P. B. wrote: > On Tue, 21 May 2019 at 10:29, Nikita Popov wrote: > >> On Sat, May 18, 2019 at 9:37 PM Dik Takken wrote: >> >>> Good point. I did a quick scan of the source code and came up with a >>> list of possible candidates for a similar treatment: >>> >>>

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-21 Thread G. P. B.
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

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-21 Thread Nikita Popov
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

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-19 Thread G. P. B.
On Sat, 18 May 2019 at 21:37, 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

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-18 Thread Dik Takken
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() array_diff() & friends

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-17 Thread Levi Morrison
On Fri, May 17, 2019 at 1:53 PM Dik Takken wrote: > I just created a pull request that changes the array_merge / > array_merge_recursive functions such that they allow being called > without arguments: > > https://github.com/php/php-src/pull/4175 The change seems simple, and the idea is welcome.

Re: [PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-17 Thread G. P. B.
On Fri, 17 May 2019 at 21:53, Dik Takken wrote: > Hello, > > I just created a pull request that changes the array_merge / > array_merge_recursive functions such that they allow being called > without arguments: > > https://github.com/php/php-src/pull/4175 > > This is my first attempt to

[PHP-DEV] Calling array_merge / array_merge_recursive without arguments

2019-05-17 Thread Dik Takken
Hello, I just created a pull request that changes the array_merge / array_merge_recursive functions such that they allow being called without arguments: https://github.com/php/php-src/pull/4175 This is my first attempt to contribute, feedback is highly appreciated. please advise on how to