Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115703 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 99110 invoked from network); 13 Aug 2021 13:12:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 Aug 2021 13:12:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 53F3F1804C8 for ; Fri, 13 Aug 2021 06:44:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,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-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 ; Fri, 13 Aug 2021 06:44:09 -0700 (PDT) Received: by mail-pl1-f180.google.com with SMTP id a5so12045448plh.5 for ; Fri, 13 Aug 2021 06:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=NbBmVI6C+M6p6ZoZV2i6DKXrN5cLKsEyqQUoyb+iOVI=; b=bmmsfZZ28Tz4ediTpFXkgx38M8ux5rHuXaRAfyIyKKtJVTnnTv3oOTvhI+jx/2fLfD SUowR8mca3cEBWCgKHAqu9fDZ01CUpiqpFEvaxNdDPaeJodb6nptaEeOTawmiqtjo1zn 4N1aKUp2SDSZ6krztZwbiW4+Z3OOsJDy/mj+oWQ19zkZxaMeks8RMEo/8HtqJNdBcrfr sfUwqni4X77IbQ0r71PigoawQh6v2rqD+D4Hg4izloXI8fRiW5AZeKzI4cKMx/ISGVmr RI5V5qKhFt890Q73HD6gKSe8q0wwen+tBa1Kp+sRzV64kC77hmTb7Bm7G6yLITdh4tw3 JcEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=NbBmVI6C+M6p6ZoZV2i6DKXrN5cLKsEyqQUoyb+iOVI=; b=nPUz9C8E+PpQMDDl4ia18o7Yr2iJH55HXKcGnXkTswzrVgxXT8bXHDbL6GH7RRKPow Iy6/WUm8PByK2bi6aXjdHOVuSocXm58vuCzHXKEDM4BEymZHnGYJpmOtcQ9896rdD1z9 cFPquOgOmZqN9DKfb36u77NS4oc2J95BQSg5SvwbYBDkQP0hLhei3Vjd90Bv5ZdOP2tl ordw3sZsu0PHdKfOqfs7JZWaDmlVf9W9DkMSOqccnUNGT6ZJnYFFhQt2rPD40Nkfe3vI tyGi2jjaVQ0fAFn5OhMZ9vb9faEdbvBswqxUjA2ufxeyU/YXj7uAh4Rk7FQn24nxyWLs gbFw== X-Gm-Message-State: AOAM530UWw4rAv35zu1sSZe/mgx8zmZmxvvaD37Fw1X+eJjOgqXcSOGF 742eAtnxpYYA5gqas1hKK/WA1Z0LOdOPd59If9k8pSa3/Hc= X-Google-Smtp-Source: ABdhPJz8yS4Tv2I9EbO0fL/msNUbpVl4tLm19iTpZ8OeQmOBz24FbV8jwqu4Dknl29duIInZsPp+sZfikbDjXl3B/F0= X-Received: by 2002:a05:6a00:1796:b029:3c4:25d6:9ee1 with SMTP id s22-20020a056a001796b02903c425d69ee1mr2605473pfg.21.1628862247263; Fri, 13 Aug 2021 06:44:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 13 Aug 2021 15:43:31 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="000000000000a2e10805c9710bad" Subject: Re: [PHP-DEV] Unwrap reference after foreach From: divinity76@gmail.com (Hans Henrik Bergan) --000000000000a2e10805c9710bad Content-Type: text/plain; charset="UTF-8" +1 from me, and yeah lets not care about that edge case, i hope the edge gets removed at some point.. (but that's an issue for another thread) FWIW if attempts at getting it in 8.2 fails, i would welcome another attempt at this for PHP9 On Fri, 13 Aug 2021 at 15:29, 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... > > Regards, > Nikita > --000000000000a2e10805c9710bad--