It is not competent, in any case, for any party to the cause who has been examined therein as a witness, to corroborate his testimony when impeached by proof of his own declaration or statement made to third persons out of the presence and hearing of the adverse party.