Imam al-Shafi'i (may Allah have mercy on him) said: "The saying of Allah, the Mighty and Majestic, 'from among your men' [Surah al-Baqarah: 282] indicates, and Allah knows best, that the testimony of children is not permissible in any matter; also because only adults, not those who have not reached puberty, are addressed with the obligations; and also because they are not among the witnesses who are approved of, and Allah Almighty has commanded us to accept the testimony only of those whom we approve of."
The Shaykh (Imam al-Bayhaqi) (may Allah have mercy on him) said: "And it has been narrated to us from the Prophet (peace and blessings be upon him) that: The pen has been lifted from three: from the child until he reaches puberty, from the insane until he recovers, and from the sleeper until he wakes up."
Imam al-Shafi'i (may Allah have mercy on him) said: "Then if someone says that Sayyiduna Ibn al-Zubayr (may Allah be pleased with him) declared it (the testimony of children) permissible, then (the reply is that) Sayyiduna Ibn Abbas (may Allah be pleased with them both) rejected it."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / Q20609