Argued October 12, 1926, Appellee is mistaken in suggesting that under Clifford v. Clifford, 65 Pa. Super. 110, our review is limited to the consideration of the record as on certiorari. The act of July 11, 1917, P.L. 817, passed since the decision of that case, provides that any party aggrieved by an order in any habeas corpus proceeding involving the custody of children may appeal to this court "who shall consider the testimony and make such order upon the merits of the case either in affirmance, reversal, or modification of the order appealed from, as to right and justice shall belong." *Page 303 The act of June 26, 1895, P.L. 316, amended by the act of May 13, 1925, P.L. 638, provides that in disputes between father and mother about the custody of their children, the court shall decide which, if either, parent shall have such custody, "regard first being had to the fitness of such parent and the best interest and permanent welfare of said child.": Com. v. Kelley,83 Pa. Super. 17; Com. v. Faxstein, 84 Pa. Super. 243; Com. v. Butler, 84 ib. 291; see also Com. v. Hart, 14 Phila. 352; Com. v. Strickland, 27 Pa. Super. 309.
The suit was begun by petition of appellant, father of two young children, for a writ of habeas corpus directed to their mother, in whose custody they were, requiring their production in the court below. The writ was issued and the children were brought in. The record shows that after some testimony was taken, the court said: "We cannot do anything here," and ended the hearing. The record does not show that an order was made remanding the children to the custody of the mother, though the subsequent proceedings show that they remained with her. The only indication that any order was made, appears in the docket entries in these words, "after hearing in open court petition dismissed." The entry of an order dismissing the petition was obviously an error; the petition for the writ had been granted, and the writ had been issued, and the mother had complied with its mandate by bringing the children into court. The function of the petition for a writ of habeas corpus is to secure the issuance of the writ (Williamson's Case, 26 Pa. 9); when the writ is issued the petition has accomplished its purpose: 12 R.C.L. 1231, sec. 47. If the court below intended to remand the children to the custody of the mother, after hearing, a formal order remanding them should have been made.
So the case stood for some time, when the father *Page 304 filed what he entitled a "petition for rehearing," on which, we assume, the court ordered a rehearing to be held, although no such order appears in the record brought up. The record does not indicate whether any evidence was received on the rehearing, in addition to what was heard on the original hearing, and the disposition of the case on rehearing appears only in the docket entries, again, apparently, without formal order; the entry is as follows: "Jan. 27 ...... after hearing in open court, the court order that petitioner ...... shall see his children ...... on Sundays between the hours of two and three P.M. at the Municipal Court Building." The next day, however, and without any hearing, the following formal order was made: "The Court order that the order of court of Jan. 27, 1925, be revoked, the case to stand upon the agreement between the petitioner and the defendant which is now on file in the Recorder of Deeds' office." We understand that was intended to be the final order disposing of the case. This appeal comes from that order.
The evidence shows that the parties, with two children (now about 7 and 9 years old) separated, and by deed of separation, inter alia, provided: "...... and he, the said George Manning, covenants and agrees in consideration of the execution and delivery of this indenture and agreement that he shall and will not at any time hereafter sue or prosecute her, the said Sylvia Manning in any court of any jurisdiction in the Commonwealth of Pennsylvania, or elsewhere, for living separate and apart from him, or compel her to cohabit with him, or sue or molest or trouble her or any other person, child or children of the said marriage, for living separate and apart from him or any other person whatsoever, for harboring or receiving her, nor will he at any time during her lifetime, without her express consent, visit her or knowingly come *Page 305 to or visit any house or place where she or said children may dwell, or where she may be engaged in business." As the agreement purported to deal also with real estate, it was recorded, and it was that agreement to which the court referred in the order complained of.
While the agreement gave the custody of the children to their mother, it does not deprive the father of the privilege of seeing and conversing with his children from time to time in such circumstances as the court may deem proper, if the interests and welfare of the children will be promoted by such access. It is against public policy to destroy or limit the relation of parent and child save as provided by law: "It has declared, the parent can apprentice his child; can, by certain proceedings in court, permit its adoption by another, and that it can take away, for misconduct, the right of testamentary guardianship": Enders v. Enders, 164 Pa. 266; also see the statutes cited above. A contract like appellant's is not conclusive; the test is whether it is favorable or unfavorable to the "best interest and permanent welfare" of the child: Enders v. Enders, supra; 14 R.C.L. 273, sec. 44. The application of that rule necessarily demands inquiry into the facts. Normally both parents should see their children; estrangement of parent and child should be avoided whenever possible; the death of the parent having custody of such children may require the performance of parental obligations of the surviving parent which can be better performed if the parental relation has not been wholly severed, and it may also give the survivor a prima facie right to custody.
In this case the question is, whether appellant is so unfit by character, or by conduct in their presence, as to enable the court, in the wise exercise of judicial discretion, to say that the interest and welfare of the children will not be promoted by permitting him to *Page 306 see and converse with them for periods and in surroundings which evidence may show to be reasonable. An order permitting such access to them is not depriving the wife of their custody. Such an inquiry was not had in this case, doubtless because the court determined as matter of law that the agreement settled the point; as that conclusion was wrong, the case should go back for hearing on the merits. We, of course, do not now say that appellant must be permitted to see his children; that will depend on the evidence.
The order is reversed; the record is remitted with instructions that the court fix a time for hearing and determine the case on the evidence then to be offered; the costs of this appeal to be paid by the appellant.