Busr bin Saeed reported,

Zayd bin Khalid al-Juhani sent him to Abu Juhaym to ask what he had heard from the Messenger of Allah ﷺ concerning someone passing in front of a person who is praying.Abu Juhaym said, "The Messenger of Allah ﷺ said, 'If the one who passes in front of a person praying knew what was upon him, standing still for forty would be better for him than passing in front of him.'"Abu Nadr said, "I do not know whether he said forty days, or months, or years."

Azami 2544

Sahih

عن بسر بن سعيد

أن زيد بن خالد الجهني أرسله إلى أبي جهيم يسأله: ماذا سمع من رسول الله ﷺ في المار بين يدي المصلي؟ فقال أبو جهيم: قال رسول الله ﷺ: لو يعلم المار بين يدي المصلي ماذا عليه، لكان أن يقف أربعين خيرا له من أن يمر بين يديه. قال أبو النضر: لا أدري قال أربعين يوما، أو شهرا، أو سنة؟

الأعظمي 2544صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Sutrah
Section
Sin of passing in front of one who is praying
Numbering
Jami al-Kamil 2544 (2nd edition)
Azami 2544