Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116347 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93774 invoked from network); 14 Nov 2021 16:19:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Nov 2021 16:19:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 215371804C6 for ; Sun, 14 Nov 2021 09:13:36 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 14 Nov 2021 09:13:35 -0800 (PST) Received: by mail-ed1-f46.google.com with SMTP id z10so34521010edc.11 for ; Sun, 14 Nov 2021 09:13:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=la6gCUFh3zLbj3gpz7tyVQ3qV9IwWjiQce8lygGwM1o=; b=cxyfiWS/dztvggEkT1mLLN19VmLDWj+607n2FZNfoLxcm8i6qRAu1yitlzJfZNg79p C2QBslzBF/RZ/ODrGdFttVugKitscxNKtN/rxkChidnEqwALW2+rd9hRchtlbZxEc9Or deAgSyYKZwWJGJEWExdjO9LlXu9NFI6y3sV+JucyrfJB6IMzvV+rFawnFNNuzdX3Hlzd E5eWHDtRdNh7Q6PvsLziIAMdob2Rd8oj14qeqmnFW1bN2qTflTGX0HZmJRRqcfYjip1j JNx9mGc1MF1uQwSFv9dplKZExAvFFHbH98ygKni1/1VLw3MyKQU7MhFPSnb3gWx4pPCT 362A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=la6gCUFh3zLbj3gpz7tyVQ3qV9IwWjiQce8lygGwM1o=; b=3RhTk3X2aF59aP1C7XJWRK7QtDoN3e+0owrojLhOvKFYyzA7qlaFL8hbCMoOdGj1SO g5DWiqPaowHjJ+DkNFbp8UKLEhOAvsEGHgjgOJ4z0NjhSz9+E+gGK+5A6qcIWhRwngoX IMAgU0KqNeNorHxo5d+nw/pQq6DBZcOobZAdn+gB6OrBA2MqeEe2WCJ6zMBu454FMnwD Lcvf0zXpda9vJGm793bednYatNC7miEX0kjxLSuxTWbzTetl9oYWql/1xGbBK50gmw/n w1JQpD2UeqZUr+0jcRuorYh1ao1M+dLMM/qBLjMJCzYsAq2gAWZbiL4K0uxiwgYQkKvA M5Yw== X-Gm-Message-State: AOAM531sOfrcajwQDN5+eUVZhZnfIjqGtooRV/gQjZ5ZNdfbdi29EW7m 4Nzh/QLUfy9p5JJ0agcJuv5DWHmSOK1SleKuxGKsD1mj X-Google-Smtp-Source: ABdhPJxm4gvrAHu7zkiy/U3ZiPXt0soQ6g9mqK8ft8IVNV5Bx+8SJE/cVVV9tpaBiwaCv//fcqteHPj1NkhrCIxVLMw= X-Received: by 2002:a17:907:6d07:: with SMTP id sa7mr40899086ejc.339.1636910014206; Sun, 14 Nov 2021 09:13:34 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 14 Nov 2021 18:13:18 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000ed160105d0c2cfef" Subject: Re: Unwrap reference after foreach From: nikita.ppv@gmail.com (Nikita Popov) --000000000000ed160105d0c2cfef Content-Type: text/plain; charset="UTF-8" On Wed, Nov 10, 2021 at 10:06 AM Nikita Popov wrote: > On Fri, Aug 13, 2021 at 3:28 PM Nikita Popov 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 --000000000000ed160105d0c2cfef--