Busr bin Saeed reported that Zaid bin Khalid Juhani sent him to Sayyiduna Abu Juhaim (Abdullah) Ansari, may Allah be pleased with him, to ask him what he had heard from the Messenger of Allah, peace and blessings be upon him, regarding the one who passes in front of a person performing prayer. Sayyiduna Abu Juhaim, may Allah be pleased with him, said: The Messenger of Allah, peace and blessings be upon him, said: "If the one passing in front of the praying person knew how great a sin it is upon him, he would prefer to stand there for forty rather than pass in front of him." Abu Nadr said: I do not remember whether Busr bin Saeed said forty days, or a month, or a year.
Hadith Referenceسنن دارمي / من كتاب الصللاة / 1455
Hadith Takhrijاس حدیث کی سند صحیح ہے اور حدیث متفق علیہ ہے۔ دیکھئے: [بخاري 510] ، [مسلم 507] ، [أبوداؤد 703] ، [ترمذي 336] ، [نسائي 755] ، [ابن ماجه 945] ، [ابن حبان 2366] ، [الحميدي 836]
Brief Explanation
(Commentary on Hadiths 1453 to 1455)
From these hadiths, it is understood that passing in front of someone performing prayer is a very grave sin, and if the person passing were to know its punishment, then even if he had to stand for forty hours, this would be a very severe penalty. Therefore, one should not pass in front of someone who is praying.
There is a difference of opinion in this matter regarding how far away one must be to avoid passing in front. The most likely view is that one should not pass within the place of prostration (sajdah) or within three arm-lengths, but the hadith is absolute, so it is better not to pass at all.