Re: Unwrap reference after foreach
| From: | Nikita Popov | Date: | Sun, 14 Nov 2021 17:13:18 +0000 |
| Subject: | Re: Unwrap reference after foreach | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116347@lists.php.net to get a copy of this message | ||
On Wed, Nov 10, 2021 at 10:06 AM Nikita Popov <nikita.ppv@gmail.com> wrote:
> On Fri, Aug 13, 2021 at 3:28 PM Nikita Popov <nikita.ppv@gmail.com> wrote:
>
>> Hi internals,
>>
>> I'd like to address a common footgun when using foreach by reference:
>> https://wiki.php.net/rfc/foreach_unwrap_ref
>>
>> This addresses the issue described in the big red box at
>>
>> https://www.php.net/manual/en/control-structures.foreach.php. While
>> this
>> is "not a bug" (as our bug tracker can regularly attest), it's rather
>> unexpected, and we could easily avoid it...
>>
>
> As the discussion has died down, I plan to open voting on this RFC soon.
>
> I have to admit that I'm less convinced of this than I was originally,
> because there's a surprising number of edge cases involved. The behavior is
> more intuitive on the surface, but things get more complicated when you
> look at detailed language semantics.
>
I have ultimately decided to withdraw this proposal.
Regards,
Nikita