[Machine] The Messenger of Allah ﷺ said: "If one of you has doubt about whether he has prayed three or four units (rak'ahs), then let him pray a complete unit (rak'ah) and then make two prostrations while sitting. If that unit of prayer was the fifth, then he should make those two prostrations as a supplication. And if it was the fourth, then they serve as a deterrent to the devil." 'Uyad bin Hilal differed in his wording of the hadith.
أَنَّ رَسُولَ اللهِ ﷺ قَالَ «إِذَا شَكَّ أَحَدُكُمْ فَلَمْ يَدْرِ أَصَلَّى ثَلَاثًا أَمْ أَرْبَعًا فَلْيُصَلِّ رَكْعَةً تَامَّةً ثُمَّ يَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ فَإِنْ كَانَتِ تِلْكَ الرَّكْعَةُ خَامِسَةً شَفَعَ بِهَاتَيْنِ السَّجْدَتَيْنِ وَإِنْ كَانَتْ رَابِعَةً كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ» خَالَفَهُ عِيَاضُ بْنُ هِلَالٍ فِي لَفْظِهِ