Re: PHP 8.3 Processes Diferently Than 7.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10/4/2024 3:23 PM, Calvin Buckley wrote:
On Oct 4, 2024, at 3:44 PM, Steve Matzura <sm@xxxxxxxxxxxxxx> 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?



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux