Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111826 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 23363 invoked from network); 3 Sep 2020 16:47:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Sep 2020 16:47:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A1ED418054D for ; Thu, 3 Sep 2020 08:52:44 -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=-2.1 required=5.0 tests=BAYES_00,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-Virus: No X-Envelope-From: Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.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 ; Thu, 3 Sep 2020 08:52:44 -0700 (PDT) Received: by mail-il1-f180.google.com with SMTP id t13so3012223ile.9 for ; Thu, 03 Sep 2020 08:52:44 -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 :cc; bh=n79L7tHVB4dvuyrqMEzVNXU3Vdv0xQzvQUHICC7swGI=; b=Vhs+gWbgjwPzbVfU9fsopFfDEP1s3Sks7gZ8D3IRdxklNGpBBl4bKEwgjSkjsxGOw6 boOAu2aMJx3DLsw6eFJKdQoAFwsjbZ5Gp+2ZIaq1bnST4J+Fz43ylxrQ/KngTG62cagM q3xbj3S+AsUaqVfi23uQAYaA54V7HJItY061/lqsTFTKGQhXGREF2GgtGVfo1Zt1LJUY ecX6paFt06e2A/PFeANlliQwfXO4bWwDvBvPiAbURXdGKVspSbZO8PEeRXtgtbjgZM0T sJ02RRpPflk5Z8RBoTK1lISyZOslzTbJXdnNaCRYZLb9y8hW08rkZINTlpVf7I53ObpM ZIUA== 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:cc; bh=n79L7tHVB4dvuyrqMEzVNXU3Vdv0xQzvQUHICC7swGI=; b=B6IiOkfgUfLrci7bpPtSxxFLAH+aMtY+chFL+rIe5dAIdt3NXVCbdXEU8VP0Gxph6P 7IOzVRFtDFOww+mWWSJs+il3yhQEFfJtTP6QHSJyaJk+CkKHiIBiTI6aNbi1gEyB4iPt iwi8l+TR2W3wW+nI35UAryqlDufXIGIWRfG6321/cGgvxE0WFfo3GBiV+L8rL7XSfIpn qWBcKfnb/kqpMRZMEgf4HvPXo9zWIVfEisatJzz3LRbooyKxRAkX/icw3dV2pVL2cIJf XJCqElUFRaH7JXeSFCIQHtfgiCOMUISRGD8+6mI2KHnH66ENBJDXYxpZ82OsdO9SDLgw 5+sQ== X-Gm-Message-State: AOAM533BjVNO4GZQgT/C0Md2TVzn7bSxWjTeHaU7CCIQ/ZGrBMn5Xi5P W2gzJI0GvdqJG6jCqnH6+5/JuBLB31xtmeTDM2k= X-Google-Smtp-Source: ABdhPJy4WIDAJprilO+vwtkWLuAVxZPheu75iV4Jd+c3N5BX2OKZauZjH3n7DcrqqEqqmkuUzFDWRn0Q05iShUNhLTM= X-Received: by 2002:a05:6e02:d01:: with SMTP id g1mr2236875ilj.282.1599148361732; Thu, 03 Sep 2020 08:52:41 -0700 (PDT) MIME-Version: 1.0 References: <89FF9360-609A-439F-BDBE-B3B4C141E00F@newclarity.net> <20200903095840.4b83640d@mcmic-probook.opensides.be> In-Reply-To: Date: Thu, 3 Sep 2020 17:52:30 +0200 Message-ID: To: David Rodrigues Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000000b579005ae6abe72" Subject: Re: [PHP-DEV] Draft RFC: foreach iteration of keys without values From: ocramius@gmail.com (Marco Pivetta) --0000000000000b579005ae6abe72 Content-Type: text/plain; charset="UTF-8" On Thu, Sep 3, 2020 at 5:35 PM David Rodrigues wrote: > > Question for those who know about opcache optimizations: is it > > feasible to avoid fetching the current value if the value is otherwise > > unused and the variable-variable features are not used either? > TBH, this sounds like the best approach: optimizing the `foreach (\array_keys($input) as $key) {` structure, when detected. That would make it zero impact from an RFC/userland perspective, and the OP by John is in fact about a performance concern, while we already have a very expressive way to do key iteration. Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --0000000000000b579005ae6abe72--