Anas bin Malik reported,

The Prophet ﷺ practiced continuous fasting toward the end of the month, and some people did the same. When this reached the Prophet ﷺ, he said, "If the month were extended for me, I would continue fasting in such a way that those who go to extremes would abandon their excess. I am not like you. I spend the night with my Lord feeding me and giving me drink."

Azami 4526

Sahih

عن أنس بن مالك، قال

واصل النبي ﷺ آخر الشهر، وواصل أناس من الناس، فبلغ النبي ﷺ، فقال: لو مد بي الشهر، لواصلت وصالا يدع المتعمقون تعمقهم، إني لست مثلكم، إني أظل يطعمني ربي ويسقين.

الأعظمي 4526صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Fasting
Chapter
Prohibited fasts
Section
Prohibition of continuous fasting
Numbering
Jami al-Kamil 4526 (2nd edition)
Azami 4526