Page MenuHomePhorge

PHPMailer: Remove use of each() function removed in PHP 8.0
ClosedPublic

Authored by aklapper on May 17 2024, 13:56.
Tags
None
Referenced Files
F2938396: D25659.1737994459.diff
Sun, Jan 26, 16:14
F2934712: D25659.1737798935.diff
Fri, Jan 24, 09:55
F2933021: D25659.1737750936.diff
Thu, Jan 23, 20:35
F2933020: D25659.1737750936.diff
Thu, Jan 23, 20:35
F2932935: D25659.1737746839.diff
Thu, Jan 23, 19:27
F2927380: D25659.1737647527.diff
Wed, Jan 22, 15:52
F2896587: D25659.1737242286.diff
Fri, Jan 17, 23:18
F2896557: D25659.1737242171.diff
Fri, Jan 17, 23:16

Details

Summary

each() has been deprecated since PHP 7.2 and got removed in PHP 8.0 per https://www.php.net/manual/en/function.each.php

Replace it with a foreach construction.

Closes T15833

Test Plan

Carefully read the code; locally testing that construction per D25659#18155; compare to similar rP9623e667458821f696eb92e9dac5a2c9720af7af

Diff Detail

Repository
rP Phorge
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Hmm, I also found this mentioned in https://secure.phabricator.com/T12404#256288 proposing a slightly different approach.

Thanks :3 It makes sense, and I've also tested that snippet in PHP 5.5 and PHP 8.1 obtaining same results (premising that each() is not available anymore in PHP 8 as already clarified)

This revision is now accepted and ready to land.May 18 2024, 13:17