In any civil action or proceeding, whether or not it is brought or defended by a person representing the interests of a deceased or lunatic assignor of any thing or contract in action, a party to the record, or a person for whose immediate benefit such proceeding is prosecuted or defended, or any director or other officer of a person which is a party to the record, or for the immediate benefit of which such action or proceeding is prosecuted or defended, or any other person whose interest is adverse to the party calling him as a witness, may be compelled by the adverse party to testify as if under cross-examination, subject to the rules of evidence applicable to witnesses under cross-examination, and the adverse party calling such witnesses shall not be concluded by his testimony, but such person so cross-examined shall become thereby a fully competent witness for the other party as to all relevant matters whether or not these matters were touched upon in his cross-examination, and also, where one of the several plaintiffs or defendants, or the person for whose immediate benefit such proceeding is prosecuted or defended, or such director or officer, or such other person having an adverse interest, is cross-examined under this section, his coplaintiffs or codefendants, or fellow directors or officers, shall thereby become fully competent witnesses on their own behalf, or on behalf of the person of which they shall be directors or officers, as to all relevant matters, whether or not these matters were touched upon in such cross-examination.