I have been going through the entire documentation and stackoverflow Q&A and couldn't find any answer for this.
In php, are these two while the exact same or are there differences between them. And if so, which?
while (list($key, ) = each($array))
and
while (list($key) = each($array))
I know I can convert the first to
foreach (array_keys($array) as $key)
But can I do the same conversion to while (list($key) = each($array))?
each()function is deprecated and will be removed in a future PHP version.eachis deprecated and I am adapting the script to php 7.2, and thus don't want to make any mistakes while adapting the code to useforeach.