> On 1.6.2023, at 09:18, Casper Langemeijer wrote:
>
> On Thu, Jun 1, 2023, at 01:19, Boro Sitnikovski wrote:
>> Thank you for the information and encouragement! I was a bit scared of this
>> one being rejected too, but still decided to give it a shot :)
>
> As a
> On 1.6.2023, at 01:13, Levi Morrison wrote:
>
> On Tue, May 30, 2023 at 5:35 AM Boro Sitnikovski wrote:
>>
>> Hello all,
>>
>> As per the How To Create an RFC instructions, I am sending this e-mail in
>> order to get your feedback on my proposal.
> On 1.6.2023, at 00:59, Larry Garfield wrote:
>
> On Wed, May 31, 2023, at 10:47 PM, Boro Sitnikovski wrote:
>
>> 1. The grouping that JavaScript/.NET/Lodash/Scala/etc. do (this should
>> be the default of `array_group`)
>> 2. The grouping that Haskell does, th
On 30.5.2023, at 15:13, Boro Sitnikovski wrote:Updated the patch: added a test about increasing subsequences example, and a minor bugfix.On 30.5.2023, at 13:34, Boro Sitnikovski wrote:Hello all,As per the How To Create an RFC instructions, I am sending this e-mail in order to get your feedback
> On 31.5.2023, at 09:03, naitsi...@e.mail.de wrote:
>
>
>
> Am 30-May-2023 18:34:19 +0200 schrieb andr...@dqxtech.net:
>> On Tue, 30 May 2023 at 18:27, Boro Sitnikovski wrote:
>>>
>>> Hi,
>>>
>>> Thank you for your thoughts.
>
> On 30.5.2023, at 21:56, Andreas Hennings wrote:
>
> On Tue, 30 May 2023 at 19:25, Boro Sitnikovski wrote:
>>
>> Here's some more examples:
>>
>> 1. Use `array_group` to create list of singleton list:
>> ```
>> $groups = array_gr
> On 30.5.2023, at 19:21, Larry Garfield wrote:
>
> On Tue, May 30, 2023, at 4:27 PM, Boro Sitnikovski wrote:
>> Hi,
>>
>> Thank you for your thoughts.
>>
>>> I would say the more common desired behavior is the one in your first
>>> example
Hi,
> On 30.5.2023, at 18:33, Andreas Hennings wrote:
>
> On Tue, 30 May 2023 at 18:27, Boro Sitnikovski wrote:
>>
>> Hi,
>>
>> Thank you for your thoughts.
>>
>>> I would say the more common desired behavior is the one in your first
>&
heers
> Andreas
>
>
> On Tue, 30 May 2023 at 17:08, Boro Sitnikovski wrote:
>>
>> Hey,
>>
>> Thanks for the suggestion.
>>
>> For the previous case in the code, I added these in a Gist to not clutter
>> here too much:
>>
>> 1.
value' => 'baz' ],
>> ];
>>
>> $groups = array_group( $array, function( $a, $b ) {
>> return $a['id'] == $b['id'];
>> } );
>> ```
>>
>> The disadvantage of the first approach is that we are only limited to using
>> equality check, and we cannot group by, say, `<` or other functions.
>> Similarly, the advantage of the first approach is that the keys are
>> preserved, and elements needn't be consecutive.
>>
>> In any case, I think a utility function such as `array_group` will be widely
>> useful.
>>
>> Please find attached a patch with a proposed implementation. Curious about
>> your feedback.
>>
>> Best,
>>
>> Boro Sitnikovski
>>
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php
Updated the patch: added a test about increasing subsequences example, and a minor bugfix.
array_group.patch
Description: Binary data
On 30.5.2023, at 13:34, Boro Sitnikovski wrote:Hello all,As per the How To Create an RFC instructions, I am sending this e-mail in order to get your feedback on
b['id'];} );```The disadvantage of the first approach is that we are only limited to using equality check, and we cannot group by, say, `<` or other functions.Similarly, the advantage of the first approach is that the keys are preserved, and elements needn't be consecutive.In any case, I think a utility function such as `array_group` will be widely useful.Please find attached a patch with a proposed implementation. Curious about your feedback.Best,Boro Sitnikovski
array_group.patch
Description: Binary data
12 matches
Mail list logo