Zayd bin Aslam (may Allah have mercy on him) said: A man committed zina and confessed, so the Prophet (peace and blessings be upon him) called for a whip. A broken whip was brought, and he (peace and blessings be upon him) said: "Bring one better than this." Then a new whip was brought whose tip had not yet been broken, and he (peace and blessings be upon him) said: "Bring one between these two." Then such a whip was brought, and he (peace and blessings be upon him) had the punishment carried out with it and said: "O people! The time has come for you to refrain from what Allah has forbidden. Whoever falls into any of these (foul deeds), let him conceal it; if (his matter) is exposed to us, we will apply the punishment of the Book of Allah to him."
Imam al-Shafi'i (may Allah have mercy on him) said: This hadith is munqati' (broken), not of the kind that is itself established as proof; but I have seen among the people of knowledge here those who know it and act upon it, so we hold by it.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأشربة والحد فيها / 17574