Abdullah bin Abbas reported,

I was standing among a group of people who were praying to Allah for Umar bin Khattab, whose body had been placed on his bier, when suddenly a man behind me rested his elbow on my shoulder and said, "May Allah have mercy on you. I always hoped that Allah would place you with your two companions, because I often heard the Messenger of Allah ﷺ say, 'I went with Abu Bakr and Umar,' 'I did such and such with Abu Bakr and Umar,' and 'I set out with Abu Bakr and Umar.' So I truly hoped that Allah would place you alongside them."I turned around, and there was Ali bin Abu Talib.

Bukhari 3677

Sahih

حدثني الوليد بن صالح حدثنا عيسى بن يونس حدثنا عمر بن سعيد بن أبي الحسين المكي عن ابن أبي مليكة

عن ابن عباس رضي الله عنهما قال

إني لواقف في قوم فدعوا الله لعمر بن الخطاب وقد وضع على سريره إذا رجل من خلفي قد وضع مرفقه على منكبي يقول رحمك الله إن كنت لأرجو أن يجعلك الله مع صاحبيك لأني كثيرا ما كنت أسمع رسول الله ﷺ يقول كنت وأبو بكر وعمر وفعلت وأبو بكر وعمر وانطلقت وأبو بكر وعمر فإن كنت لأرجو أن يجعلك الله معهما فالتفت فإذا هو علي بن أبي طالب

البخاري 3677صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Virtues of the companions of the Prophet ﷺ
Chapter
Prophet's ﷺ saying, "If I were to take a close friend" as narrated by Abu Saeed
Numbering
Darussalam 3677
Bukhari 3677