Ammar reported,

I asked Ibn Abbas, "How old was the Messenger of Allah ﷺ on the day he died?"He replied, "I would not have thought that this could be hidden from a man like you, from his own people."I said, "I have asked people about it, and they gave me differing answers, so I wanted to know your view on the matter."He asked, "Are you keeping count?"I said, "Yes."He said, "Hold forty, at which he was sent, then fifteen in Makkah, during which he knew both safety and fear, and ten from his emigration to Madinah."The hadith of Yazid bin Zuray.

Muslim 6101

Sahih

و حدثني محمد بن رافع حدثنا شبابة بن سوار حدثنا شعبة عن يونس بهذا الإسناد نحو حديث يزيد بن زريع

مسلم 6101صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Virtues
Chapter
How long the Prophet ﷺ stayed in Makkah and Madinah
Numbering
Darussalam 6101
Muslim 6101