Issue #2946139 by bkosborne, malaynayak, mrgoodfellow: Remove usage of deprecrated each() function for PHP 7.2+ compatability