Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
tirmidhi:1034ʿAbdullāh b. Munīr > Saʿīd b. ʿĀmir > Hammām > Abū Ghālib > Ṣallayt Maʿ Anas b. Mālik > Janāzah a man Faqām Ḥiyāl Raʾsih Thum Jāʾūā Bijanāzah Āmraʾah from Quraysh Faqālūā Yā Abū Ḥamzah Ṣal ʿAlayhā Faqām Ḥiyāl And Saṭ al-Sarīr

"I prayed for the funeral of a man with Anas bin Malik, so he stood parallel to his head. Then they came with the body of a woman from the Quraish. They said: 'O Abu Hamzah perform the prayer for her.' So he stood parallel to her waist. Al-Ala bin Ziyad said to him: 'Is this how you saw the Messenger of Allah standing in the place for the funeral as you did for her, and for a place that you stood for the man?' He said: 'Yes.' When he was finished he said: 'Remember (this).'"  

الترمذي:١٠٣٤حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُنِيرٍ عَنْ سَعِيدِ بْنِ عَامِرٍ عَنْ هَمَّامٍ عَنْ أَبِي غَالِبٍ قَالَ صَلَّيْتُ مَعَ أَنَسِ بْنِ مَالِكٍ عَلَى جَنَازَةِ رَجُلٍ فَقَامَ حِيَالَ رَأْسِهِ ثُمَّ جَاءُوا بِجَنَازَةِ امْرَأَةٍ مِنْ قُرَيْشٍ فَقَالُوا يَا أَبَا حَمْزَةَ صَلِّ عَلَيْهَا فَقَامَ حِيَالَ وَسَطِ السَّرِيرِ فَقَالَ

لَهُ الْعَلاَءُ بْنُ زِيَادٍ هَكَذَا رَأَيْتَ النَّبِيَّ ﷺ قَامَ عَلَى الْجَنَازَةِ مُقَامَكَ مِنْهَا وَمِنَ الرَّجُلِ مُقَامَكَ مِنْهُ قَالَ نَعَمْ فَلَمَّا فَرَغَ قَالَ احْفَظُوا وَفِي الْبَابِ عَنْ سَمُرَةَ  

قَالَ أَبُو عِيسَى حَدِيثُ أَنَسٍ هَذَا حَدِيثٌ حَسَنٌ وَقَدْ رَوَى غَيْرُ وَاحِدٍ عَنْ هَمَّامٍ مِثْلَ هَذَا وَرَوَى وَكِيعٌ هَذَا الْحَدِيثَ عَنْ هَمَّامٍ فَوَهِمَ فِيهِ فَقَالَ عَنْ غَالِبٍ عَنْ أَنَسٍ وَالصَّحِيحُ عَنْ أَبِي غَالِبٍ وَقَدْ رَوَى هَذَا الْحَدِيثَ عَبْدُ الْوَارِثِ بْنُ سَعِيدٍ وَغَيْرُ وَاحِدٍ عَنْ أَبِي غَالِبٍ مِثْلَ رِوَايَةِ هَمَّامٍ وَاخْتَلَفُوا فِي اسْمِ أَبِي غَالِبٍ هَذَا فَقَالَ بَعْضُهُمْ يُقَالُ اسْمُهُ نَافِعٌ وَيُقَالُ رَافِعٌ وَقَدْ ذَهَبَ بَعْضُ أَهْلِ الْعِلْمِ إِلَى هَذَا وَهُوَ قَوْلُ أَحْمَدَ وَإِسْحَاقَ

See similar narrations below:

Collected by Ibn Mājah
ibnmajah:1494Naṣr b. ʿAlī al-Jahḍamī > Saʿīd b. ʿĀmir > Hammām > Abū Ghālib > Raʾayt Anas b. Mālik Ṣallá > Jināzah a man Faqām Ḥiyāl Raʾsih Fajīʾ Bijināzah Ukhrá Biāmraʾah Faqālūā Yā Abū Ḥamzah Ṣal ʿAlayhā Faqām Ḥiyāl And Saṭ al-Sarīr

“I saw Anas bin Malik offering the funeral prayer for a man, and he stood level with his head. Then another funeral was brought, that of a woman, and they said: ‘O Abu Hamzah! Offer the funeral prayer for her.’ So he stood level with the middle of the bed (the body was upon). ‘Ala’ bin Ziyad said to him: ‘O Abu Hamzah! Is this how you saw the Messenger of Allah ﷺ standing in relation to the body of a man and a woman as you have stood?’ He said: ‘Yes.’ Then he turned to us and said: ‘Remember this.’”  

ابن ماجة:١٤٩٤حَدَّثَنَا نَصْرُ بْنُ عَلِيٍّ الْجَهْضَمِيُّ حَدَّثَنَا سَعِيدُ بْنُ عَامِرٍ عَنْ هَمَّامٍ عَنْ أَبِي غَالِبٍ قَالَ رَأَيْتُ أَنَسَ بْنَ مَالِكٍ صَلَّى عَلَى جِنَازَةِ رَجُلٍ فَقَامَ حِيَالَ رَأْسِهِ فَجِيءَ بِجِنَازَةٍ أُخْرَى بِامْرَأَةٍ فَقَالُوا يَا أَبَا حَمْزَةَ صَلِّ عَلَيْهَا فَقَامَ حِيَالَ وَسَطِ السَّرِيرِ فَقَالَ

لَهُ الْعَلاَءُ بْنُ زِيَادٍ يَا أَبَا حَمْزَةَ هَكَذَا رَأَيْتَ رَسُولَ اللَّهِ ﷺ قَامَ مِنَ الْجِنَازَةِ مُقَامَكَ مِنَ الرَّجُلِ وَقَامَ مِنَ الْمَرْأَةِ مُقَامَكَ مِنَ الْمَرْأَةِ قَالَ نَعَمْ فَأَقْبَلَ عَلَيْنَا فَقَالَ احْفَظُوا