When any minor is a material witness, any other person may be allowed to recognize for the appearance of such witness, or the magistrate may, in his or her discretion, take the recognizance of such minor in a sum not exceeding fifty dollars which shall be valid and binding in law, notwithstanding the disability of minority.