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
F3604881: D25659.1745239674.diff
Sun, Apr 20, 12:47
F3604874: D25659.1745239328.diff
Sun, Apr 20, 12:42
F3604865: D25659.1745237916.diff
Sun, Apr 20, 12:18
F3604861: D25659.1745237546.diff
Sun, Apr 20, 12:12
F3604517: D25659.1745207310.diff
Sun, Apr 20, 03:48
F3603868: D25659.1745172087.diff
Sat, Apr 19, 18:01
F3527534: D25659.1744840948.diff
Tue, Apr 15, 22:02
F3401597: D25659.1744564388.diff
Sat, Apr 12, 17:13

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