The Messenger of Allah ﷺ prescribed the zakat of Fitr as a purification for the fasting person from idle talk and indecent speech, and as food for the poor. Whoever pays it before the prayer, it is an accepted zakat, and whoever pays it after the prayer, it is merely one of the ordinary charities.
حدثنا عبد الله بن أحمد بن بشير بن ذكوان وأحمد بن الأزهر قالا حدثنا مروان بن محمد حدثنا أبو يزيد الخولاني عن سيار بن عبد الرحمن الصدفي عن عكرمة
فرض رسول الله ﷺ زكاة الفطر طهرة للصائم من اللغو والرفث وطعمة للمساكين فمن أداها قبل الصلاة فهي زكاة مقبولة ومن أداها بعد الصلاة فهي صدقة من الصدقات
[Its chain of transmission is hasan] Abu Dawud narrated it in the Book of Zakat, in the chapter on Zakat al-Fitr, hadith no. 1609, from the hadith of Marwan bin Muhammad, through him. Hakim and Dhahabi graded it sahih, while Nawawi and others graded it hasan.