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
F3004827: D25659.1740500559.diff
Mon, Feb 24, 16:22
F3004826: D25659.1740500557.diff
Mon, Feb 24, 16:22
F3004825: D25659.1740500547.diff
Mon, Feb 24, 16:22
F3004823: D25659.1740500540.diff
Mon, Feb 24, 16:22
F3002548: D25659.1740448658.diff
Mon, Feb 24, 01:57
F2995985: D25659.1740361181.diff
Sun, Feb 23, 01:39
F2995981: D25659.1740361175.diff
Sun, Feb 23, 01:39
F2995898: D25659.1740357272.diff
Sun, Feb 23, 00:34

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