OK after some thinking, the reason is that = operator has higher precedence than AND and lower precedence than && (see http://www.php.net/manual/en/language.operators.precedence.php). So it pays to be careful with this. To be safe put the whole expresion on the right into parentheses:
$all_confirmed = ((count($changed_coefs_ids) == 0) AND (!$payout_too_big));
$all_confirmed = ((count($changed_coefs_ids) == 0) && (!$payout_too_big));