View Issue Details

IDProjectCategoryView StatusLast Update
0019178phplist applicationAll Otherpublic11-04-18 10:34
Reporterduncanc 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version3.3.2-RC3 
Target VersionFixed in Version 
Summary0019178: In php 7.2 the each() function is deprecated
DescriptionSee http://php.net/manual/en/migration72.deprecated.php

I suggest changing all uses of each() to the equivalent foreach construct.
TagsNo tags attached.

Activities

michiel

11-04-18 10:29

manager   ~0060375

Yes, good idea. Are we still using each() anywhere? I can't remember using it, so it must be rather old code if we still do.

michiel

11-04-18 10:30

manager   ~0060376


Maybe one for xheni?. This will need thorough testing though.

michiel

11-04-18 10:30

manager   ~0060377

Ah, Duncan already did it :-)

duncanc

11-04-18 10:34

developer   ~0060379

I did some spot testing of arbitrary pages that have changed, but not every single page or function.

But the code changes were automated using sed, so there's not really any possibility of "finger problems".

# replace "while (list(" by "foreach ("
grep -rl '= each(' | xargs sed -i -E 's/while \(list\((.+?), (.+?)\) = each\((.+?)\)\) \{/foreach (\3 as \1 => \2) {/'