On the day of Uhud, the people suffered great hardship, so the Prophet ﷺ said, "Dig the graves, make them wide, and bury two or three men in a single grave."They asked, "Messenger of Allah, whom shall we place first?"He replied, "Place first the one who knew the most of the Quran."
أخبرنا محمد بن عبد الله بن المبارك قال حدثنا وكيع عن سليمان بن المغيرة عن حميد بن هلال
لما كان يوم أحد أصاب الناس جهد شديد فقال النبي ﷺ احفروا وأوسعوا وادفنوا الاثنين والثلاثة في قبر فقالوا يا رسول الله فمن نقدم قال قدموا أكثرهم قرآنا
[Sahih]. Previously mentioned, no. 2012. Ahmad narrated it: 4/19, from Waki, with the same wording. It is also in al-Kubra, no. 2142. Abu Dawud narrated it, no. 3215, from the hadith of Sulayman bin Mughira, with the same wording.