[PHP-DEV] [RFC] [Discussion] Change default for zend.exception_ignore_args INI setting

2025-04-08 Thread Andrew Lyons
Hi everyone, I've been working on a new RFC which proposes changing the default value for the zend.exception_ignore_args INI setting from Off to On. The intent of this change is to make PHP installations safer by default and prevent the accidental release of sensitive information in stack traces.

[PHP-DEV] Re: [RFC] [Discussion] Never parameters

2025-04-08 Thread Daniel Scherzer
On Mon, Mar 10, 2025 at 12:05 PM Daniel Scherzer < daniel.e.scher...@gmail.com> wrote: > Hi internals, > > I'd like to start discussion on a new RFC about allowing `never` for > parameter types when declaring a method. > > * RFC: https://wiki.php.net/rfc/never-parameters-v2 > * Implementation: htt

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-08 Thread Niels Dossche
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

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-08 Thread Niels Dossche
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

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-08 Thread Niels Dossche
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

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-08 Thread Larry Garfield
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

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-08 Thread Claude Pache
> 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:

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-08 Thread Andreas Hennings
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

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-08 Thread Andreas Hennings
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

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-08 Thread Rob Landers
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

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-08 Thread Levi Morrison
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

Re: [PHP-DEV] [RFC] [Discussion] array_first() and array_last()

2025-04-08 Thread Daikaras
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