Various online services have different values for maximum year of expiry, when it comes to Credit Cards.
For instance:
While the second example runs twice as quickly as the first you are still getting the date and extracting the year from it 20 times rather than 40 times. A better unrolling of the loop is:
$StartDate=date('Y');
$EndDate=$StartDate+21;
for($i=$StartDate;$i<$EndDate;$i++){
echo "\n";
That will be about 20 times faster than the twice as fast example and also addresses a minor bug in the original code in that the year could change from one fetching of the date to the next leading to unexpected, though in this case harmless, results.