Re: [RFC][Under Discussion] Add functions array_key_first()and array_key_last()

From: Date: Wed, 20 Jun 2018 16:01:33 +0000
Subject: Re: [RFC][Under Discussion] Add functions array_key_first()and array_key_last()
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-102328@lists.php.net to get a copy of this message
On 20 June 2018 at 15:29, Levi Morrison <levim@php.net> wrote: > > Ah, OK, you learn something every day! For anyone else like me who was > unaware of this, list() apparently silently accepts any non-array value on > the right of the assignment, assigns all variables in the list() to null, > and evaluates to the assigned (but otherwise unused) value. So > $x=list($a,$b)=42; will set $a and $b to NULL, and $x to 42, without any > notices. > > This is changing as per this RFC: > https://wiki.php.net/rfc/notice-for-non-valid-array-container. > The > null case is kept. > Not according to the RFC: > Per discussion on the PR <https://github.com/php/php-src/pull/2031#issuecomment-238366706> I have limited this RFC to not raise warnings when setting any value by use of list(). It says nothing about treating NULL specially, it just implies list() will be out of scope of the RFC completely. Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#102328) next »