Hi,
On 03.09.20 09:58, Côme Chilliet wrote:
foreach ($iterable as $key => $_) { ... }
I currently use foreach (array_keys($array) as $key) { ... }
to avoid complains from code analysers on unused var, is it slower?
one argument brought forward initially (sorry, can't find the email
right now) is the resource management: array_keys() has to create a copy
[*] which might be an issue depending on the size of data.
- Markus
[*] I now about shallow-copy, I'm just trying to cite the initial
argument as best as I can :)
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php