Simply replacing it with a foreach wouldn't work, as the code depends on the state of the internal array pointer of $this->_arguments. I've attempted to preserve that behavior by explicitly splitting the array into the two sections that would be iterated over.
each() is deprecated as of PHP 7.2: https://wiki.php.net/rfc/deprecations_php_7_2#each
Simply replacing it with a foreach wouldn't work, as the code depends on the state of the internal array pointer of
$this->_arguments
. I've attempted to preserve that behavior by explicitly splitting the array into the two sections that would be iterated over.