
29 Cal.App.3d 623 (1972)
105 Cal. Rptr. 736
In re EUGENE W. et al., Minors.
MARY ELLEN VANDER SLUIS, Plaintiff and Respondent,
v.
BETTY W., Defendant and Appellant.
Docket No. 31136.
Court of Appeals of California, First District, Division Two.
December 26, 1972.
*626 COUNSEL
Leonard L. Leuschner and John T. Rossi for Defendant and Appellant.
Stephen W. Hackett, County Counsel, and Henry E. McNeely, Deputy County Counsel, for Plaintiff and Respondent.
Evelle J. Younger, Attorney General, Elizabeth Palmer, Acting Assistant Attorney General, Sheridan H. Brown, Deputy Attorney General, as Amici Curiae on behalf of Plaintiff and Respondent.
OPINION
KANE, J.
Defendant Betty W. appeals from the trial court's judgment freeing her four minor children from parental custody and control pursuant to Civil Code, section 232, subdivision (g).[1]
These proceedings were initiated by Mary Ellen Vander Sluis, a child welfare worker in the Public Welfare Department of Napa County, who petitioned the Napa County Superior Court to declare appellant's four minor children free from parental custody and control under section 232, subdivisions (a), (b), (c) and (g). Appellant, represented by counsel and claiming various defects in the petition, filed a request to set it aside. The court treated the request as a demurrer, as a result of which the petition was amended on its face to allege that the action was being brought under section 232, subdivision (g), only. The demurrer was in all other respects overruled. Thereafter a motion to compel appellant to submit to a mental examination was granted. Appellant was examined by two physicians who testified that she was suffering from a simple type of schizophrenia rendering her unable to take care of herself, her economic needs and incapable of taking care of and controlling her four minor children. Upon this and other evidence the trial court decreed appellant's four minor children to be free from parental control and custody. Appellant does not question the sufficiency of the evidence to support the judgment.


*627 Constitutionality of Civil Code Section 232, Subdivision (g)

Appellant's main contention in that section 232, subdivision (g), is unconstitutional and violative of the equal protection clause of the Fourteenth Amendment because (a) it discriminates on the basis of poverty and mental illness which is an invidious discrimination as a matter of law; and (b) the parent-child relationship is a fundamental one which can be interfered with only by showing a compelling state interest, appellant contending that the only state interest here presented is monetary. Appellant also argues that the implied distinction drawn between physical and mental illness is arbitrary. We find no substance in any of these arguments.
(a) Section 232 provides that "An action may be brought for the purpose of having any person under the age of 21 years declared free from the custody and control of either or both of his parents when such person comes within any of the following descriptions: ... (g) Whose parent or parents are, and will remain incapable of supporting or controlling the child in a proper manner because of mental deficiency or mental illness ..." (italics added).
Preliminarily, we point out that the language of the statute demonstrates on its face that the statutory classification is based solely on mental deficiency or mental illness, not on poverty. It is also patently discernible that the statute speaks in a disjunctive manner, making the inability to support and the inability to control singularly and separately a cause for the severance of parental ties. However, as will be seen later, mental deficiency or mental illness, by its very definition, inherently affects the sick parent's ability to control. Therefore, the mentally deficient or ill parent, even if otherwise able to support his child, will be deprived of his parenthood under the statute because of his inherent inability to control the child in a proper manner, and the disparity between a poor and rich parent as envisioned by appellant simply cannot occur. This, in turn, narrows the issue to whether the mental deficiency or mental illness constitutes a valid reason for classification.
(1) Under well established principles of constitutional law, the mandate of equal protection cannot be equated with equal treatment. On the contrary, that the Legislature is empowered to make a proper classification is firmly rooted in our law. In order to be constitutional, such classification may not be arbitrary, i.e., made for the mere purpose of classification, but must rest on a reasonable basis. The classification is deemed reasonable if it is based on some natural, intrinsic or constitutional distinction and is germane to a legitimate purpose within the power of the Legislature (Bilyeu *628 v. State Employees' Retirement System (1962) 58 Cal.2d 618, 623 [24 Cal. Rptr. 562, 375 P.2d 442]; City of Santa Barbara v. Modern Neon Sign Co. (1961) 189 Cal. App.2d 188, 193 [11 Cal. Rptr. 57]). (2) The courts exhibit great deference toward the acts of the Legislature and emphasize that wide discretion is vested in making the classification; every presumption is in favor of the validity of the statute; and the decision of the Legislature as to what is a sufficient distinction to warrant the classification will not be overthrown by the courts unless it is palpably arbitrary and, beyond rational doubt, erroneous (Patton v. La Bree (1963) 60 Cal.2d 606, 609 [35 Cal. Rptr. 622, 387 P.2d 398]; Bilyeu v. State Employees' Retirement System, supra). As an invariable rule, a distinction in legislation is not arbitrary if any set of facts can be conceived that would sustain it; and the burden of overcoming the presumption of constitutionality is cast upon the assailant (Dribin v. Superior Court (1951) 37 Cal.2d 345, 352 [231 P.2d 809, 24 A.L.R.2d 864]).
(3) When viewed in light of the foregoing premises, it appears unquestionable that the statutory classification at hand, which draws a distinction between parents who are mentally ill or deficient and those who are not, does have a reasonable factual basis. Under statutory definition[2] mentally deficient or ill persons are those who are incapable of managing themselves and their affairs independently and who require supervision, control, care, etc., for their own welfare or the welfare of others. Thus, by statutory definition, it clearly appears that persons determined to be mentally deficient or ill are ipso facto unable to take care of or exercise proper control over their children. It follows that the statutory classification which permits the severance of the parental ties in this type of situation is fully justified and supported by reason and cannot be regarded as arbitrary.
(4) (b) Appellant's next argument  that the only interest of the state is monetary  is obviously based on a misreading of the intent of the Legislature in enacting the statute. The legislative intent underlying the Freedom *629 From Parental Custody and Control Act, of which section 232, subdivision (g), is a part, has been stated in the following: "It is the intention of the Legislature in enacting this act to extend adoption services for the benefit of children residing in foster homes at public expense by facilitating legal actions required for adoption so that these children may be placed in adoptive homes where they will have the benefits of stability and security." (Stats. 1970, ch. 583, § 1, p. 1160; italics added.)
It is plain from the quoted language that the intent of the Legislature was not to save money but rather to secure the welfare and best interest of the child by freeing him from parental care when adoptive homes would provide stability and security otherwise missing from his life. The legislative intent has been made even more explicit by the adoption of section 232.5, which sets forth that the provisions of the act shall be liberally construed to serve and protect the interests and welfare of the child.
Indeed, contrary to the previous feudalistic view which claimed a parental property right in the child (cf. Turner v. Turner (1959) 167 Cal. App.2d 636, 642 [334 P.2d 1011]; Shea v. Shea (1950) 100 Cal. App.2d 60, 65 [223 P.2d 32]), the modern trend of cases and authorities places a growing emphasis on the paramount interest of the child. Thus, in In re Neal (1968) 265 Cal. App.2d 482, 490 [71 Cal. Rptr. 300], the court emphatically pointed out that in applying the provisions of section 232 the trial court must consider the best interest and welfare of the child. The authorities likewise urge that the dominant parent-right doctrine should be replaced by a broadened, best-interests-of-the-child test, so that the court's inquiry will focus on the needs of the child rather than the rights of the parents. (Kay & Philips, Poverty and the Law of Child Custody (1966) 54 Cal.L. Rev. 717, 720.) The foregoing discussion leaves no doubt that the legislative intent behind section 232, subdivision (g), is to promote the welfare of the child. Thus, it seems indisputable that, in order to facilitate this goal, the state as a parens patriae not only has a compelling interest but also a duty to sever the parental bonds once the situation contemplated by the statute arises.
(5) Appellant's final constitutional contention, i.e., that the distinction drawn between physical and mental illness is capricious, is refuted by common knowledge and everyday experience. It requires no detailed discussion to demonstrate that the support and, even more, the control of the child is primarily a mental function to which soundness of mind is a crucial prerequisite. It is also well known that physical handicaps generally have no adverse effect upon mental functions. It is obvious therefore that, by reason of the differing nature of the two disabilities, a physically handicapped *630 individual might well be able to carry out certain functions which the mentally deficient or ill person is per se incapable of performing. It is also a matter of common knowledge that many persons with physical handicaps have demonstrated their ability to adequately support and control their children and to give them the benefits of stability and security through love and attention. The distinction between physical and mental illness, therefore, is amply warranted.
Accordingly, we conclude that the classification on the grounds of mental deficiency and mental illness is reasonable and serves a legitimate state interest which is germane to the purpose of the statute. Consequently, the attack on section 232, subdivision (g), must be held unfounded and its constitutionality upheld.

Procedural Errors
Appellant also assails the judgment below on procedural grounds. Thus she complains that petitioner Mary Ellen Vander Sluis, who brought the action in her individual capacity and not on behalf of any agency authorized to sue under section 232.9,[3] lacked standing to sue which, in turn, deprived the court of jurisdiction. Appellant further contends that the petition did not state facts sufficient to state a cause of action and that respondent failed to show good cause for the mental examinations of appellant. We see no merit in any of these contentions.

A) Jurisdiction and Standing to Sue

(6a) Section 233 provides in part that any interested person may petition the superior court of the county in which a minor person described in section 232 resides or in which such minor person is found, for an order or judgment declaring such minor person free from the custody and control of either or both of his parents. (7) The case law makes it clear that an "interested person" as used in the statute is one who has a direct, and not merely consequential, interest in the action (Associated Boat Industries v. Marshall (1951) 104 Cal. App.2d 21, 22 [230 P.2d 379]), or putting it another way, one who has a real interest in the ultimate adjudication (cf. California Water & Telephone Co. v. County of Los Angeles (1967) 253 Cal. App.2d 16, 22-23 [61 Cal. Rptr. 618]).
*631 (6b) The record here reveals that although petitioner filed the action in her individual capacity, she expressly stated in her petition that she was a child welfare worker of the Napa County Welfare Department. This allegation on its face indicated that she had a direct interest in the adjudication of the case. Consequently, the finding of the trial court that she was a proper person to bring the action in question is manifestly correct. Additionally, it ought to be pointed out that appellant's contention notwithstanding, under well settled law the lack of authority to sue (i.e., the person is not the real party in interest) is equivalent only to a failure to state a cause of action and the defect is not jurisdictional (1 Witkin, Cal. Procedure (2d ed. 1970) Jurisdiction, § 183, p. 712; 3 Witkin, Cal. Procedure (2d ed. 1971) Pleading, §§ 760, 814, at pp. 2379 and 2424). (8) Although a failure to state a cause of action may be raised at any time during the trial and also on appeal (3 Witkin, Cal. Procedure (2d ed. 1971) Pleading, § 808, p. 2418), reversal of the judgment on this ground is justified and required only if the error complained of was of prejudicial nature resulting in a miscarriage of justice (Tupman v. Haberkern (1929) 208 Cal. 256, 263 [280 P. 970]; 6 Witkin, Cal. Procedure (2d ed. 1971) Appeal, § 290, p. 4277). (6c) Appellant has clearly failed to establish such prejudice. Contrariwise, the record divulges that appellant, who was represented by counsel, did receive proper notice, attend all hearings, and all the procedural requirements prescribed by statute were complied with throughout the proceedings.

B) The Petition Adequately States a Cause of Action

Appellant's argument that the petition did not state a cause of action due to a failure to allege ultimate facts in the petition and to specify the proper code section, etc., is obviously misplaced. (9) Under well settled law, any error in overruling appellant's demurrer based upon technical defects in the pleading, such as misjoinder, uncertainty, allegations in the form of conclusions of law or evidentiary matters, etc., is cured by going to trial on the merits. After trial and judgment such matters are not grounds for reversal (Miller v. Lantz (1937) 9 Cal.2d 544, 547 [71 P.2d 585]; 6 Witkin, Cal. Procedure (2d ed. 1971) Appeal, § 310, subd. (2) at p. 4291; and 3 Witkin, Cal. Procedure (2d ed. 1971) Pleading, § 837, p. 2443).

C) The Mental Examination Was Properly Ordered

(10) Appellant's last contention that her mental examination was ordered by the trial court without first showing facts constituting a good cause therefor is also fatally defective.
In the first place the statute impliedly, at least, requires the examinations to be carried out since the granting of a petition under section 232, subdivision *632 (g), can be ordered only "if there is testimony ... from two medical examiners certified under Section 6750 of the Welfare and Institutions Code." Thus, the allegations of the petition itself (under § 232, subd. (g)) are sufficient to constitute good cause for ordering the examinations (cf. Greyhound Corp. v. Superior Court (1961) 56 Cal.2d 355, 388-390 [15 Cal. Rptr. 90, 364 P.2d 266]).
Secondly, the record reveals that even before filing the notice of motion for mental examination on July 27, 1971, in support of the petition to free from parental custody, the probation officer filed a detailed report setting forth the reasons which necessitated such action. This report also contains ample grounds for ordering appellant's mental examination.
The judgment is affirmed.
Taylor, P.J., and Rouse, J., concurred.
NOTES
[1]  Subdivision (g) was redesignated (f) by a 1971 amendment. All references to code sections hereafter will pertain to the Civil Code unless otherwise indicated.
[2]  At the time of the enactment of Civil Code, section 232, Welfare and Institutions Code, section 5590, provided that "mentally deficient persons" mean those persons who are incapable of managing themselves or their affairs independently, with ordinary prudence, and who require supervision, control and care for their own welfare, or for the welfare of others or for the welfare of the community. At the same time, Welfare and Institutions Code, section 5550, defined "mentally ill persons" as those who come within either or both of the following descriptions: (a) who are of such mental condition that they are in need of supervision, treatment, care or restraint; (b) who are of such mental condition that they are dangerous to themselves or to the person or property of others, and are in need of supervision, treatment, care or restraint. As the court pointed out in In re Baby Boy T. (1970) 9 Cal. App.3d 815, 820 [88 Cal. Rptr. 418], in using the terms "mental deficiency" and "mental illness" in Civil Code, section 232, the legislative intent was to embody the concept then set forth in Welfare and Institutions Code, sections 5590 and 5550, respectively.
[3]  Section 232.9 provides in pertinent part that "The State Department of Social Welfare, a county welfare department, a county adoption department, or a county probation department which is planning adoptive placement of a child with a licensed adoption agency, or the State Department of Social Welfare acting as an adoption agency in counties which are not served by a county adoption agency, may initiate an action under Section 232 to declare a child free from the custody and control of his parents."
