Re: PHP 8.3 Processes Diferently Than 7.4

Steve Matzura <[email protected]> Fri, 4 Oct 2024 16:49:09 -0400
Newsgroups gmane.comp.php.general
Message-ID <[email protected]>
On 10/4/2024 3:23 PM, Calvin Buckley wrote:
>> On Oct 4, 2024, at 3:44 PM, Steve Matzura<[email protected]> wrote:
>> "each" is not a function. It's a list. What changed that affected the way this worked between 7.4 and 8.3? I looked through the manual sections on arrays and lists and didn't find anything that looked like it was the problem.
> each and the other manual array cursor functions were removed in 8.0:
>
> https://www.php.net/manual/en/function.each.php
>
> You'll need to change to using a different way to iterate, i.e. the foreach keyword.


Looks simple enough, unless I'm misunderstanding the change. so, should:


while (list ($key, $value) = each ($sorted_shows))

be:


foreach (list as ($key, $value) = each ($sorted_shows))


like that?