behind an imam who is praying ’Isha, and he prays Fajr behind an imam who is praying Fajr, and so on. The proof is the Prophet’s ﷺ saying: “The imam has only been appointed to be followed, so do not disagree with him.”
Some scholars, however, maintain that matching prayers is not a prerequisite. According to them, you may pray ’Asr behind someone performing Zuhr, or Zuhr behind someone performing ’Asr, or even ’Asr behind someone performing ’Isha, because the validity and completion of the follower’s prayer are unaffected. If it is permissible to offer an obligatory prayer behind someone who is engaged in a voluntary one—despite the clear difference in legal ruling—then a mere difference in the prayer’s name should certainly pose no problem. This latter view is the sounder position.
Suppose someone says, “I came for the ’Isha prayer after the adhān, and when the iqāmah was called I remembered that I had performed Zuhr without wudu. How can I now make up Zuhr behind an imam who is leading ’Isha?” We reply: Enter the congregation and pray Zuhr. Your intention is Zuhr, while the imam’s intention is ’Isha; this does no harm. “Actions are only by intentions, and each person will have only what he intended.”
As for the Prophet’s statement, “The imam has only been appointed to be followed, so do not differ with him,” it does not mean you must match him in intention. He himself clarified the point, saying, “When he pronounces the takbīr, pronounce the takbīr; when he prostrates, prostrate; and when he rises, rise with him”—meaning: follow him and do not precede him. The Prophet’s words explain one another.
This discussion gives rise to another: when the two prayers are identical in the number of units and in outward form, there is no difficulty, such as offering Zuhr behind an imam praying ’Asr—their unit-count and form are the same.