If you try to get the deposits of a round with only 1 deposit, it returns an empty list, not the first deposit.
Verify with code:
$deposits = $soapClient->getDeposits(array("round" => $r->Name))->getDepositsResult->_Deposit;
$lastConfirmedDeposit = end($deposits);
if ($lastConfirmedDeposit) {
$lastConfirmedPayoutAddr = $lastConfirmedDeposit->PaymentAddress;
echo "Last payment address: " . $lastConfirmedPayoutAddr . "
";
if ('bet bot ineededausername' == $bitcoin->getaccount($lastConfirmedPayoutAddr)) {
echo 'Bet bot is the last depositor
';
continue;
}
} else {
echo "Only 1 deposit.
";
}