Page 1 of 1

Unknown: The each() function is deprecated...

Posted: Wed Jan 06, 2021 2:08 am
by quintal
I get this message on a theme that I am using with my opencart 2.3.0.2:
Unknown: The each() function is deprecated. This message will be suppressed on further calls in /..../Number.php on line 293

This is what is writen on that line in that php file:

reset($units);
list($unit, ) = each($units);

return (string) $dimension . $unit;
}

I already understand it has to do with the PHP version, which is set at 7.2 (can't set it to older versions) and the part of 'each' should be rewriten to 'foreach', but I can't figure out how to do that correctly in this situation...
Can anybody help?

Re: Unknown: The each() function is deprecated...

Posted: Wed Jan 06, 2021 2:22 am
by IP_CAM
in What Theme ?
number.php is NOT a default OC 2.3.0.2 File.

Re: Unknown: The each() function is deprecated...

Posted: Wed Jan 06, 2021 3:34 am
by quintal
Does that matter?
It's a theme from a third party (theme Janzo) and it works fine so far. I only get that message above the page.
I already fix the same message from another page myself, because I had found a, as good as, same phrase to change and that worked, but I'm not able to figure out how to change it in this php...

Re: Unknown: The each() function is deprecated...

Posted: Wed Jan 06, 2021 3:47 am
by IP_CAM
Does that matter?
Not anymore, I already moved it into commercial Forum Section,
where such (obviously custom Code related) topics belong. :D

Re: Unknown: The each() function is deprecated...

Posted: Wed Jan 06, 2021 4:24 am
by quintal
Thanks, sorry I wasn't aware of that, thought genel section would do...