On 06/04/2025 19:06, Juris Evertovskis wrote:
> On 2025-04-05 18:51, Niels Dossche wrote:
> Do you think it would be hard or wrong to add `array_nth`? I've had more
> trouble with that as the in-place implementation is usually pretty
> unreadable, e.g.
>
> array_slice(array_values($array), $
On 4/8/25 10:53 AM, Daikaras wrote:
> On 4/5/2025 6:51 PM, Niels Dossche wrote:
>> Hi internals
>>
>> I'm opening the discussion for the RFC "array_first() and array_last()".
>> https://wiki.php.net/rfc/array_first_last
>>
>> Kind regards
>> Niels
>
>
> -1 because returning `null` for empty array
On 4/8/25 8:46 PM, Claude Pache wrote:
> Hi,
>
> I think that this argument is not convincing, and even counterproductive:
>
> * NULL is a rare legitimate value, so the potential for clashing is low
>
> First, it says that it is a “rare” legitimate value, which one can disagree
> with. (I do di
On 4/8/25 10:53 AM, Daikaras wrote:
> On 4/5/2025 6:51 PM, Niels Dossche wrote:
>> Hi internals
>>
>> I'm opening the discussion for the RFC "array_first() and array_last()".
>> https://wiki.php.net/rfc/array_first_last
>>
>> Kind regards
>> Niels
>
>
> -1 because returning `null` for empty array
On Sat, Apr 5, 2025, at 10:51 AM, Niels Dossche wrote:
> Hi internals
>
> I'm opening the discussion for the RFC "array_first() and array_last()".
> https://wiki.php.net/rfc/array_first_last
>
> Kind regards
> Niels
To add another argument: the reset() workaround doesn't work with a readonly
arra
> Le 5 avr. 2025 à 17:51, Niels Dossche a écrit :
>
> Hi internals
>
> I'm opening the discussion for the RFC "array_first() and array_last()".
> https://wiki.php.net/rfc/array_first_last
>
> Kind regards
> Niels
Hi,
I think that this argument is not convincing, and even counterproductive:
On Tue, 8 Apr 2025 at 18:38, Levi Morrison wrote:
>
> On Sat, Apr 5, 2025 at 9:51 AM Niels Dossche wrote:
> >
> > Hi internals
> >
> > I'm opening the discussion for the RFC "array_first() and array_last()".
> > https://wiki.php.net/rfc/array_first_last
> >
> > Kind regards
> > Niels
>
> I dislik
On Mon, 7 Apr 2025 at 02:48, Ayesh Karunaratne wrote:
>
> > On Mon, Apr 7, 2025 at 2:05 AM Bilge wrote:
> > ... [snip] I suggest first proving there is a
> > legitimate need.
>
> I did a quick GitHub search for a common pattern of accessing an array
> value by using the `array_key_first` and `arr
On Tue, Apr 8, 2025, at 10:53, Daikaras wrote:
> On 4/5/2025 6:51 PM, Niels Dossche wrote:
> > Hi internals
> >
> > I'm opening the discussion for the RFC "array_first() and array_last()".
> > https://wiki.php.net/rfc/array_first_last
> >
> > Kind regards
> > Niels
>
>
> -1 because returning `n
On Sat, Apr 5, 2025 at 9:51 AM Niels Dossche wrote:
>
> Hi internals
>
> I'm opening the discussion for the RFC "array_first() and array_last()".
> https://wiki.php.net/rfc/array_first_last
>
> Kind regards
> Niels
I dislike all the functions where `null` is a valid value, which can
also be confu
On 4/5/2025 6:51 PM, Niels Dossche wrote:
Hi internals
I'm opening the discussion for the RFC "array_first() and array_last()".
https://wiki.php.net/rfc/array_first_last
Kind regards
Niels
-1 because returning `null` for empty arrays is still wrong. Whatever
similar behavior exists should b
On 07/04/2025 01:47, Ayesh Karunaratne wrote:
On Mon, Apr 7, 2025 at 2:05 AM Bilge wrote:
... [snip] I suggest first proving there is a
legitimate need.
I did a quick GitHub search for a common pattern of accessing an array
value by using the `array_key_first` and `array_key_last` functions:
`
On Sun, Apr 6, 2025, at 7:47 PM, Ayesh Karunaratne wrote:
>> On Mon, Apr 7, 2025 at 2:05 AM Bilge wrote:
>> ... [snip] I suggest first proving there is a
>> legitimate need.
>
> I did a quick GitHub search for a common pattern of accessing an array
> value by using the `array_key_first` and `array
> On Mon, Apr 7, 2025 at 2:05 AM Bilge wrote:
> ... [snip] I suggest first proving there is a
> legitimate need.
I did a quick GitHub search for a common pattern of accessing an array
value by using the `array_key_first` and `array_key_last` functions:
```php
$value = $arr[array_key_first($resul
On 06/04/2025 18:06, Juris Evertovskis wrote:
I also suspect that an in-engine implementation might have more
performance gains compared to an userland one.
That applies to literally anything, obviously; one less layer of
abstraction is always more efficient. That's therefore not a reason to
On 2025-04-05 18:51, Niels Dossche wrote:
Hi internals
I'm opening the discussion for the RFC "array_first() and
array_last()".
https://wiki.php.net/rfc/array_first_last
Kind regards
Niels
Hi,
Do you think it would be hard or wrong to add `array_nth`? I've had more
trouble with that as th
On 05/04/2025 20:00, Claude Pache wrote:
> Hi Niels,
>
> It is reasonable. I have a userland implementation of that in my codebase
> since long ago.
>
> You missed the following point when discussing the behaviour for empty array:
>
> * Consistent with `array_shift()` and `array_pop()`, which a
> Le 5 avr. 2025 à 17:51, Niels Dossche a écrit :
>
> Hi internals
>
> I'm opening the discussion for the RFC "array_first() and array_last()".
> https://wiki.php.net/rfc/array_first_last
>
> Kind regards
> Niels
Hi Niels,
It is reasonable. I have a userland implementation of that in my c
18 matches
Mail list logo