Re: [PHP-DEV] Nullsafe array access can still emit a warning

2022-08-24 Thread Eugene Sidelnyk
I completely agree with Marco. We should not mix up nullsafe operator with array access. As for me, aforementioned code works as expected. As an improvement, we can think of access-safe operator (like `$arr[?0]`), however I'm not sure if introduction of such will make sense. Regards Yevhen On

Re: [PHP-DEV] PHP 8.2 branch cut

2022-08-24 Thread Alexandru Pătrănescu
On Wed, Aug 24, 2022 at 1:15 AM Jakub Zelenka wrote: > > > > If it fixes a bug, it should be merged before RC 1, > > if it's a new feature or behavior change without a good reason, it should > > probably put off until PHP 8.3. > > > > As it was noted by Christoph, this is specifically spelled in

Re: [PHP-DEV] Nullsafe array access can still emit a warning

2022-08-24 Thread Gert de Pagter
`$undefined?->bar()` does feel wrong, but `$arr[0]?->bar()` does not to me. But maybe i've just been using javascript too much lately On Wed, 24 Aug 2022 at 15:11, Marco Pivetta wrote: > > Hey Gert, > > On Wed, 24 Aug 2022 at 14:59, Gert de Pagter wrote: >> >> Hi Internals, >> >> I recently

[PHP-DEV] Nullsafe array access can still emit a warning

2022-08-24 Thread Gert de Pagter
Hi Internals, I recently learned that using null safe on an array access can still emit a warning when the array access is not defined. I kinda expected it to work like a null coalesce and just short circuit there,without the warning. Is there any chance this behaviour could be changed in a n

Re: [PHP-DEV] Nullsafe array access can still emit a warning

2022-08-24 Thread Marco Pivetta
Hey Gert, On Wed, 24 Aug 2022 at 14:59, Gert de Pagter wrote: > Hi Internals, > > I recently learned that using null safe on an array access can still > emit a warning when the array access is not defined. I kinda expected > it to work like a null coalesce and just short circuit there,without >

[PHP-DEV] Re: Nullsafe array access can still emit a warning

2022-08-24 Thread Christoph M. Becker
On 24.08.2022 at 14:58, Gert de Pagter wrote: > I recently learned that using null safe on an array access can still > emit a warning when the array access is not defined. I kinda expected > it to work like a null coalesce and just short circuit there,without > the warning. > > Is there any