Quran was revealed gradually in a period of 23 years. Prophet Muhammad (s.a.w) was very vigilant and keen about collection and preservation of Quran. That is why he used to call sahabaah as so as he got revelation, and ordered them to write down verses. Then he used to order them to recite the written verses as a cross check, in order to remove any ambiguity or mistake. More over, Muslims were advised to memorize and then recite these verses in salaah. How ever, compilation of Quran at one place in form of a single book or script was done later, after the demise of Holy Prophet Muhammad.
Some very interesting incident took place in these times. Idea of compilation of Quran originated when a great number of sahaaba went to participate in a battle during pious caliphat of Hazrat Abu Bakar Siddique. Muslims won the battle, there were less causalities but among those who embraced shahada, many were hafiz-e-quran. Observing this, Hazrat Umer Farooq got worried, “what if huffaz continued dying in same number ! we would be soon short of people who have learned Quran by heart and Quran would face similar situations what other divine books are facing today”(These are not exact words of Umer ). Umar shared his thought with Abu Bakkar and suggested compilation of Quran in form of a book or some sort of hard copy. Hazrat Abu bakkar was reluctant owing to the reason that if writing whole Quran in form of book was a correct decision, Prophet Muhammad (s.a.w) would have ordered so in his life. Both decided to get suggestion from Hazrat Ziad bin sabit, who used to write revelations on order of prophet Muhammad (s.a.w). Zaid was of the same opinion as Abu Bakar. But Umer bin Khattab insisted ” Even if prophet had not explicitly ordered it in his life, but he never forbade us too ! What is the harm in compilation of Quran ? but i do foresee great harm if we do not write it.”(not actual words)
Umar’s argument was quiet logical ! SO both of companions agreed and this grave mission of compilation of Quran initiated. Zaid bin sabit later told ” i felt compilation of quran such a heavy task that if i had to pick mountain in my hand, i would have been easier than compiling quran” (not exact words of zaid). When all of great companions agreed upon the decision, a proper strategy of compilation was formulated. Every person had to visit the committee of compilation with the evidence of the verses he/she had got. And he/she must bring two witness about authenticity of the text. People came, and brought the verses they had, some written on paper, some on leather, some on wooden barks etc. Services of huffaaz were recruited for verification. Cross validation from written texts, and memory of huffaz was done. In this way compilation of Quran went on. And with sweatning and sincere efforts of companions of prophet Muhammad (s.a.w) Quran was produced in written form. After producing compilation, it was read out aloud many times in front of shabah who had memorized quran , to eradicate any mistake left.
During compilation of Quran, a very interesting event took place. When compilation was in its final stages, Hazrat zaid bin sabit remembered one short verse which prophet Muhammad had once got as revelation. but he had no written proof of verse, he had only in his memory. As per rule of committee, two witness were required for this ayah to be included in main scripture. Hazrat zaid met many huffaz, discussed the matter, but no one knew the ayah so no one testified! At last he found one sahabi who knew the ayah and was ready to testify it. But where to get second witness from ? luckily, the sahabi who was witness was once blessed by prophet Muhammad (s.aw) on his act of righteousness that from the day onward, his witness would be equal to witness of two men !
In that way, that ayah was finally included in Quran.
Purpose of telling this whole long story was to put light on the efforts, vigilance and delicacy adopted by companions of prophet in this matter of grave concern. May ALLAH reward all these great people, who sincerely devoted their whole lives for love of prophet and deen.