It is narrated from Sayyiduna Abdullah bin Umar (may Allah be pleased with them) that indeed the Messenger of Allah (peace and blessings be upon him) forbade continuous fasting. The noble companions (may Allah be pleased with them) submitted: Do you yourself observe continuous fasting? So he (peace and blessings be upon him) said: "My case is not like yours; indeed, I am given food and drink."
Hadith Referenceالسنن المأثورة / باب ما جاء في النهي عن الوصال في الصيام / 331
Hadith Takhrijصحیح بخاری، الصوم، باب الوصال ومن قال ليس في الليل صيام، رقم : 1962 ، صحیح مسلم، الصوم، باب النهي عن الوصال في الصوم، رقم : 1102
It is narrated from Sayyiduna Abu Hurairah, may Allah be pleased with him, that the Messenger of Allah ﷺ said: "Avoid continuous fasting, avoid continuous fasting." The noble Companions, may Allah be pleased with them, submitted: "O Messenger of Allah ﷺ, do you yourself observe continuous fasting?" He ﷺ replied: "My condition is not like yours. I spend the night in such a state that my Lord feeds me and gives me drink."
Hadith Referenceالسنن المأثورة / باب ما جاء في النهي عن الوصال في الصيام / 332
Hadith Takhrijصحیح بخاری، الصوم، باب التشكيل لمن اكثر الوصال، رقم : 1966 ، صحیح مسلم، الصيام، باب النهي عن الوصال في الصوم، رقم : 1103
It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that when the Messenger of Allah (ﷺ) practiced wisal (continuous fasting), the companions also practiced wisal. This news reached the Messenger of Allah (ﷺ) (it was the end of the month and the new moon was sighted), so he (ﷺ) said: "If this month had been prolonged for me (i.e., if there had been a few more days until Eid), I would have continued wisal in such a way that those who are extreme would have abandoned their extremism. (Did I not say that) I am not like you; my Lord feeds me and gives me drink."
Hadith Referenceالسنن المأثورة / باب ما جاء في النهي عن الوصال في الصيام / 333
Hadith Takhrijصحیح بخاری، الصوم، باب الوصال، رقم : 1961، صحیح مسلم، الصيام، باب النهي عن الوصال في الصوم، رقم : 1104