If before zakat becomes obligatory for a person he gives something to the poor as zakat, he cannot count it as zakat. However, if afterwards when zakat becomes obligatory for him the thing that he gave to the poor has not perished and the poor person has remained poor, he can count the thing that he gave him as zakat.