Mishkat al-Masabih 1662
وَعَنْ أَنَسٍ قَالَ: مَرُّوا بِجَنَازَةٍ فَأَثْنَوْا عَلَيْهَا خَيْرًا. فَقَالَ النَّبِيُّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «وَجَبَتْ» ثُمَّ مَرُّوا بِأُخْرَى فَأَثْنَوْا عَلَيْهَا شَرًّا. فَقَالَ: «وَجَبَتْ» فَقَالَ عُمَرُ: مَا وَجَبَتْ؟ فَقَالَ: «هَذَا أَثْنَيْتُمْ عَلَيْهِ خَيْرًا فَوَجَبَتْ لَهُ الْجَنَّةُ وَهَذَا أَثْنَيْتُمْ عَلَيْهِ شَرًّا فَوَجَبَتْ لَهُ النَّارُ أَنْتُم شُهَدَاء الله فِي الأَرْض» . وَفِي رِوَايَةٍ: «الْمُؤْمِنُونَ شُهَدَاءُ اللَّهِ فِي الْأَرْضِ»
From Anas, who said: They passed by a funeral and praised [the deceased] with good. The Prophet ﷺ said: "It has become due." Then they passed by another and spoke of it with evil. He said: "It has become due." ʿUmar said: "What has become due?" He said: "This one you praised with good, so Paradise became due for him; and this one you spoke of with evil, so the Fire became due for him. You are the witnesses of Allah on the earth." And in a narration: "The believers are the witnesses of Allah on the earth."