Refactoring PHP Code: Transitioning from each() to foreach() Loops

Sooner or later, you inherit a PHP codebase that still leans on each(). You bump the server to PHP 8, hit