Re: Draft RFC: foreach iteration of keys without values

From: Date: Thu, 03 Sep 2020 15:52:30 +0000
Subject: Re: Draft RFC: foreach iteration of keys without values
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to internals+get-111826@lists.php.net to get a copy of this message
On Thu, Sep 3, 2020 at 5:35 PM David Rodrigues <david.proweb@gmail.com> 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/

« previous php.internals (#111826) next »