Rubai said, I asked Ibn Abbas, "How old was the Messenger of Allah ﷺ when he died?"He replied, "I would not have thought that someone like you among his people would be unaware of that."I said, "I have asked others and received conflicting answers, so I wished to know your view on it."He said, "Can you count?"I said, "Yes."He said, "Then keep track. Forty years before he was sent as a prophet, fifteen years he remained in Makkah experiencing both safety and fear, and ten years as an emigrant in Madinah."
حدثنا عفان حدثنا يزيد بن زريع حدثنا يونس
سألت ابن عباس كم أتى لرسول الله ﷺ يوم مات قال ما كنت أرى مثلك في قومه يخفى عليك ذلك قال قلت إني قد سألت فاختلف علي فأحببت أن أعلم قولك فيه قال أتحسب قلت نعم قال أمسك أربعين بعث لها وخمس عشرة أقام بمكة يأمن ويخاف وعشرا مهاجرا بالمدينة
Its isnad is sahih. Ibn Kathir cited this hadith in al-Tarikh 5:258-259 from this very passage, and said, "This is how Muslim narrated it, from the hadith of Yazid bin Zuray and Shuba bin Hajjaj, both of them from Yunus bin Ubayd, from Ammar, from Ibn Abbas, in similar wording." See 2242 and 2399, and also see 1846 and the hadiths we referred to there."Muhajiran" appears in H as "Muhajirah," and we have adopted what appears in K and in Ibn Kathir.