
78 Cal.Rptr.2d 886 (1998)
67 Cal.App.4th 328
COUNTY OF ORANGE, Plaintiff and Respondent,
v.
William B. IVANSCO, Defendant and Appellant.
No. G018839.
Court of Appeal, Fourth District, Division Three.
October 16, 1998.
*887 Hosford & Hosford and Valerie Ryall Hosford, Tustin, for Defendant and Appellant.
Daniel E. Lungren, Attorney General, Roderick E. Walston, Chief Assistant Attorney General, Carol Ann White, Statewide Child Support Coordinator, and Mary A. Roth,
Deputy Attorney General, for Plaintiff and Respondent.

OPINION
SONENSHINE, Associate Justice.
William Ivansco appeals from a post-judgment order modifying his child support obligation. We reverse, finding Family Code section 4071.5 unconstitutional.[1]

I
In 1992, the court found Ivansco to be the father of twins, Jamie and Alexander, born to Loura Tyler on September 21, 1989. The court set child support at $512 per month, commencing May 15, 1992, and ordered Ivansco to reimburse the county for Aid to Families with Dependent Children (AFDC) payments it had advanced to Loura since August 1990.
On August 10, 1995, the County of Orange (the county) filed the underlying order to show cause seeking to increase the monthly child support order. Loura was still receiving AFDC. Ivansco's circumstances had changed; his 14-year-old son from a prior marriage now lived with him. Because the teenager's mother paid no support, Ivansco provided all of his living expenses. After a contested hearing, the court increased Ivansco's monthly child support order for the twins to $975.

II
Ivansco raises only one issue on appeal. He maintains the trial court erred in failing to consider deductions set forth in section 4059, subdivision (g) and section 4071, subdivision (a)(2) (formerly Civ.Code, § 4722, subds. (a) & (b)). He argues section 4071.5 (formerly Civ.Code, § 4722.5) is unconstitutional because it deprives the trial court of discretion to consider a payor's expenses for children living with him or her if the children for whom support is being determined are AFDC recipients.[2] As we will now explain, we agree.


*888 STATUTORY SCHEME
The Legislature enacted child support guidelines "to promote fair and adequate child support awards throughout the state of California and to avoid substantial variation of those awards among similarly situated families. [Citations.] In furtherance of its intent, the act provides for a system of standards and procedures which are used by the courts in determining [an] ... award of child support in each case." (County of San Diego v. Sierra (1990) 217 Cal.App.3d 126, 130-131, 265 Cal.Rptr. 749.)
Section 4055 sets forth the formula by which child support is determined. Parents' net disposable incomes, particularly the high earner's, are essential parts of the calculation. Section 4059, subdivision (e) delineates net disposable income as the parent's gross income, minus certain deductions. One such deduction is "any child support actually being paid" for children who do not reside with that parent. (Ibid., italics added.)
However, a court does not automatically deduct a parent's contributions towards basic living expenses for a child who does reside with the payor. Rather, the court may consider those expenses pursuant to sections 4059, subdivision (g) and 4071, subdivision (a)(2).
At issue here is a trial court's lack of discretion to consider a parent's contributions towards basic living expenses for children who reside with them when AFDC "payments are being made ... on behalf of a child ... of the parent seeking the deduction...." (§ 4071.5, italics added.) As a result, the trial court could not consider Ivansco's expenditures for his teenager because the twins are AFDC recipients.
Justice King observed the hardship deductions pursuant to sections 4059, subdivision (g) and 4071, subdivision (a)(2) are of great significance to "`solid, middle-class people. The cost of living ... for these people takes every penny they have.'" (In re Marriage of Paulin (1996) 46 Cal.App.4th 1378, 1382, 54 Cal.Rptr.2d 314.) Certainly, the results are impressive here. The court found Ivansco's net monthly income was $2,437. He testified he spent $680 for his teenager. Had Ivansco been paying $680 child support, his guideline net disposable income would have been reduced to $1,757 and the child support order correspondingly reduced from $975 to $703. Alternatively, had the twins not been AFDC recipients, the court could have considered at least part of the $680 Ivansco spent for his teenager residing with him.[3]

EQUAL PROTECTION
Section 4071.5 creates two classes of parents paying child support. Both groups support children who do not reside with them and children who do reside with them. The difference is some of the parents support noncustodial children who receive AFDC, while others support noncustodial children who do not receive AFDC. Not surprisingly, the child support orders of parents of AFDC recipients are greater than those of similarlysituated parents of non-AFDC children. As a result, the parents in the former group have less money available for the support of the children who reside with them.
"`The concept of the equal protection of the laws [under the Fourteenth Amendment] compels recognition of the proposition that persons similarly situated with respect to the legitimate purpose of the law receive like treatment.' [Citations.] Although this concept does not require absolute equality[,] ... or that a statute necessarily apply equally to all persons[,] ... a state may not provide for differences that amount to invidious discrimination. [Citations.] [¶] This clause `forbids the establishment of laws which arbitrarily and unreasonably create dissimilar classifications of individuals when, looking to the purpose of those laws, such individuals are similarly situated.' [Citations.]" (Hypolite v. Carleson (1973) 32 Cal.App.3d 979, 986-987, 108 Cal.Rptr. 751.)
Ivansco argues these classifications infringe upon his fundamental right to support the teenager who resides with him. He also argues the statute violates Welfare and Institutions Code section 11205, which mandates parents must "provide sufficient support and protection of [their] children...."[4]
*889 The county does "not dispute ...there is a fundamental right to rear one's own children in one's own household." Rather, it argues Ivansco's "fundamental right to raise his teenage son is [not] invidiously compromised by ... section 4071.5." (Italics added.) It contends "when all the columns are totted [sic] up, appellant is no worse off financially than he would be were his young sons not on AFDC."[5]
The county is correct to a point. The court would not have automatically deducted Ivansco's expenses for his teenage son even if the twins were not AFDC recipients. And assuming the court had considered the expense, the difference in the amount of the order may have been relatively insignificant. But this is not a case of "what would have happened if...." Harmless error has no place in the determination of a statute's underlying constitutionality.

STANDARD OF REVIEW
When "the classification involves a fundamental right[,] ... the legislation is looked at much closer and it is harder to uphold the act if there is a constitutional attack." (County of Los Angeles v. Patrick (1992) 11 Cal. App.4th 1246, 1252, 14 Cal.Rptr.2d 665.) Indeed, "under this very severe standard, a discriminatory law will not be given effect unless its classification bears a close relation to the promoting of a compelling state interest, the classification is necessary to achieve the government's goal, and the classification is narrowly drawn to achieve the government's goal by the least restrictive means possible." (Board of Supervisors v. Local Agency Formation Com. (1992) 3 Cal.4th 903, 913, 13 Cal.Rptr.2d 245, 838 P.2d 1198.)

GOVERNMENT GOAL
Section 4071.5 was enacted as part of an overall welfare reform package. Its legislative history does not shed much light on its intent.[6]" However, a review of similar legislation previously considered by the Legislature makes its goal crystal clear. The statute proposed "to discourage growth of family size while on AFDC by not paying for any additional children born 10 months after the family has been on AFDC ... or for any additional child conceived while either parent is receiving AFDC...."[7] (Assem. *890 Com. on Human Services, Aug. 5, 1992 Hearing of Sen. Bill No. 1834 (1992-1993 Reg. Sess.) as amended July 30, 1992.)

STATE INTEREST
We need not decide whether the Legislature's desire to reduce the number of children born to AFDC families constitutes a compelling state interest. Even if the answer is yes, the statute, as written, is too broad because it includes Ivansco, whose teenager was born before the twins became AFDC recipients.
The legislation is infirm even if we assume the Legislature intended to reduce welfare costs in general. The county pays $535 in monthly AFDC benefits for the twins.[8] Pursuant to Welfare and Institutions Code section 11450, subdivision (a)(1), any money Ivansco pays in child support goes first to the county as reimbursement for its contributions. Loura gets everything over that amount. "[T]he noncustodial parent ... shall be obligated to the county for an amount equal to ... [¶] ... [t]he amount specified in an order ... [¶] ... provided that any such amount in excess of the aid paid ... shall not be retained by the county, but disbursed to the family." (Welf. & Inst.Code, § 11350, subds. (a)(1) & (2).) Accordingly, permitting the court to reduce Ivansco's child support order based on the expense of raising his teenager does not affect welfare expenditures. As long as Ivansco's child support order is at least $535, the county gets back all that it pays out.

RATIONAL RELATIONSHIP
The result is the same if we conclude the statute does not infringe upon a fundamental right. The rational relationship test is used when the legislation involves economic issues. In such cases, the legislation is "presumed valid and the party attacking the legislation [has] the burden of showing that it is unconstitutional." (County of Los Angeles v. Patrick, supra, 11 Cal.App.4th at p. 1252, 14 Cal.Rptr.2d 665.)
Hypolite v. Carleson, supra, 32 Cal.App.3d 979, 108 Cal.Rptr. 751 is instructive. There, the court found unconstitutional a regulation depriving AFDC to a child who did not reside with his parents, but whose parents lived together.[9] The court explained, "[T]he AFDC program must be measured by federal standards.... Congress intended to provide programs for the economic security and protection of all children and [] it did not arbitrarily intend to leave one class of destitute children entirely without meaningful protection." (Id. at p. 984, 108 Cal.Rptr. 751.) It concluded, "[T]he Regulation, insofar as it draws distinctions of eligibility based solely upon whether or not the parents who have abandoned children reside together, creates a classification which violates the equal protection clause of the Fourteenth *891 Amendment." (Id. at p. 986, 108 Cal.Rptr. 751.)
Likewise, in Jacobson v. Department of Public Aid (1996) 171 Ill.2d 314 [216 Ill.Dec. 96, 664 N.E.2d 1024], the Illinois Supreme Court found a statute unconstitutional because it imposed financial responsibility on parents whose 18- to 20-year-old children resided with them, but exempted parents from liability if their children lived elsewhere. The court concluded there was no rational basis for the distinction.
Vincent v. State of California (1971) 22 Cal.App.3d 566, 573, 99 Cal.Rptr. 410, is also helpful. The Vincent court found Welfare and Institutions Code section 13700 void insofar as it prohibited attendant care payments to a wife whose husband received Aid to the Totally Disabled. It noted although there was "no requirement that the state provide aid to the aged, blind or needy disabled, once it undertakes to do so the state may not `invidiously discriminate' between persons similarly situated." (Ibid.; see also Lee v. Smith (1977) 43 N.Y.2d 453 [402 N.Y.S.2d 351, 373 N.E.2d 247].)
We are mindful of other cases, decided by California and out-of-state courts, upholding the constitutionality of seemingly similar child support statutes. But, as we explain, they are clearly distinguishable.
The courts in City and County of San Francisco v. Thompson (1985) 172 Cal. App.3d 652, 218 Cal.Rptr. 445, County of Los Angeles v. Patrick, supra, 11 Cal.App.4th 1246, 14 Cal.Rptr.2d 665, and Sigler v. Sigler (Wash.App.1997) 85 Wash.App. 329, 932 P.2d 710, considered classifications consisting of noncustodial payor parents who paid support for AFDC recipients and noncustodial payor parents whose children did not receive AFDC.[10] Moreover, the deductions in question related to expenses for children for whom child support was being determined. Finally, the courts addressed the constitutionality of placing a greater burden on parents whose children received AFDC rather than of those who did not.
The classifications we consider consist of parents who support children other than those receiving AFDC. The deduction relates to expenses for those other children and not to the children for whom support is being determined. The issue we address is the constitutionality of the resulting burden on those other children. These distinctions make the difference. It is one thing to find constitutional a statute which differentiates between noncustodial parents whose children receive AFDC benefits and noncustodial parents whose children do not receive such benefits. (Ohio v. Barron (1997) 52 Cal.App.4th 62, 60 Cal.Rptr.2d 342.) It is something else to uphold a statute which discriminates against siblings of the AFDC recipients by placing the burden on them. The county has failed to suggest, and we have not found, a rational basis or purpose for this classification. Accordingly, we conclude section *892 4071.5 is unconstitutional to the extent it deprives a trial court of discretion to consider a parent's expenses for children in his or her custody.[11]
There is one additional issue we need to address. We have concluded the trial court does have discretion to make a maximum hardship deduction for children residing with the payor parent, even when the payor's noncustodial children receive AFDC. However, as with all judicial discretion, it must be exercised within certain confines. In cases such as we now consider, i.e., where the payor supports AFDC and non-AFDC children, the court must take into account both classes as well as the public's AFDC reimbursement rights.
The matter is remanded to the trial court with directions to reconsider the child support order in light of the discretion available under section 4059, subdivision (g) and section 4071, subdivision (a)(2). Ivansco shall recover his costs on appeal.
WALLIN, Acting P.J., and RYLAARSDAM, J., concur.
NOTES
[1]  Unless otherwise specified, all further statutory references are to the Family Code.
[2]  Ivansco concedes he did not raise the statute's constitutionality below. However, "courts have several times examined constitutional issues raised for the first time on appeal, especially when ... the asserted error fundamentally affects the validity of the judgment ... or important issues of public policy are at issue..." (Hale v. Morgan (1978) 22 Cal.3d 388, 394, 149 Cal.Rptr. 375, 584 P.2d 512.) Such is the case here.
[3]  Pursuant to section 4071, subdivision (b), the deduction is limited to the support allocated to one twin, i.e., one-half of $975, or $487.50. In any event, the result could have been an order for a lower amount of support.
[4]  Ivansco also cites section 4053, which delineates the public policy underlying the child support guidelines. "In implementing the statewide uniform guideline, the courts shall adhere to the following principles:

"(a) A parent's first and principal obligation is to support his or her minor children according to the parent's circumstances and station in life.
". . . . .
"(e) The guideline seeks to place the interests of children as the state's top priority.
". . . . .
"(i) It is presumed that a parent having primary physical responsibility for the children contributes a significant portion of available resources for the support of the children."
[5]  The County argues if Loura were earning $753 a month rather than receiving AFDC, the court would have discretion to disallow some or all of the teenager's expenses and Ivansco would be responsible for some portion of Loara's child care expenses incurred as a result of her employment. (§§ 4061 & 4062.) Moreover, it explains if Ivansco were paying child support for the teenager, his income taxes would increase because he would no longer qualify as head of household and perhaps would not be entitled to claim the teenager as a dependent. Finally, the county alleges Ivansco would not be entitled to the hardship deduction if the teenager lived in a foster home.
[6]  In the legislative history of Senate Bill No. 35, there is only one specific reference to the matter we address. Senate Bill No. 35, as amended June 23, 1993, by the Senate Rules Committee states, in part: "This bill makes changes to Medi-Cal and other health programs and to social services programs including Aid to Families with Dependent Children (AFDC), Greater Avenues for Independence (GAIN), Food Stamps, Supplemental Security Income/State Supplementary Program (SSI/SSP), and county administration of those programs to support the budget bill. Specifically, the bill:

". . . . .
"... Prevents a parent from claiming a child support hardship deduction when a child of that parent is receiving AFDC. Unknown General Fund savings."
[7]  Other documents in the legislative history confirm this goal. (1) An April 29, 1992, memorandum to the bill's author indicates no hardship deduction for "additional children born to or adopted by the parent." (Memorandum to Sen. Mike Thompson from Sara McCarthy regarding Amendments to Sen. Bill No. 1834.)(2) The memorandum further stated the bill's purpose is to "[p]rovide that if a parent's children are receiving AFDC, he or she is prohibited from claiming a hardship deduction which would reduce that parent's child support payments, when the hardship is based on the existence of additional children born to or adopted by the parent." (Ibid.) (3) A proposal by the Senate Democrats states, "Hardship Deduction: Disallow `hardship deduction' for fathers with children receiving AFDC. This deduction now allows noncustodial parents a deduction in child support to children of a first relationship, based on support obligations to children of a second relationship.'' (Assem. Com. on Human Services, Aug. 4, 1992 Republican Analysis of Sen. Democrats' Welfare Reform Proposal, Sen. Bill No. 1834 (1992-1993 Reg. Sess.).) (4) A March 30, 1992, memorandum to the Members of the Senate Democratic Caucus from Chairperson Diane E. Watson with a "Preliminary Analysis of Welfare Proposal" indicates, "This concept of a maximum family grant is predicated on the notion that an AFDC family has a `social contract' with government to aid only those children in the family at the time aid is approved. Any adult who behaves `irresponsibly' after that time and has additional children has violated the contract, and the state is not obligated to pay aid for these children." (5) "Cap Maximum Family Grant. Cap the maximum family grant to exclude any children born 9 months after the family has been on aid. Note: the child support disregard will be increased to allow child support payments to make up the difference. (Savings: $16 million GF; $34 million total funds.)" (Assem. Com. on Human Services, Aug. 4, 1992 Republican Analysis of Sen. Democrats' Welfare Reform Proposal, Sen. Bill No. 1834 (1992-1993 Reg. Sess.).)
[8]  The County pays Loura aid for herself and four children. But for Ivansco's child support order, her total AFDC entitlement would be $723. However, pursuant to Welfare and Institutions Code section 11450, the difference between the child support award and the AFDC allotment for the twins is subtracted from her total entitlement.
[9]  Specifically, the court found unconstitutional Regulation No. 41-450.12 of the State Department of Social Welfare Eligibility and Assistance Standards.
[10]  In City and County of San Francisco v. Thompson, supra, 172 Cal.App.3d 652, 218 Cal. Rptr. 445, a noncustodial parent of an AFDC child argued it was unconstitutional to hold him responsible for AFDC payments made prior to the issuance of a child support order when noncustodial parents were retroactively liable for child support from only the time of filing of the support request. The court saw no problem. "[T]he Legislature intended recoupment of benefit payments to alleviate the burden on taxpayers and to ensure that as the number of needy children rose, benefits to each child would not be reduced." (Id. at p. 658, 218 Cal.Rptr. 445.) "In seeking recoupment of AFDC benefits from noncustodial parents with the ability to pay[,] the state is acting to enforce parental support duty and to recover welfare money it has spent because the noncustodial parent has not met that support duty." (Id. at p. 659, 218 Cal.Rptr. 445.)

The Sigler court came to this same conclusion. It concluded, "Since the taxpayers financially support children receiving AFDC rather than the noncustodial parents, reasonable grounds exist for Washington's Legislature to distinguish between noncustodial parents whose children receive AFDC from those whose children do not. Thus, the Legislature had a reasonable basis to create the classification. The classification is not arbitrary, unreasonable, inequitable or unjust." (Sigler v. Sigler, supra, 932 P.2d at p. 714.)
In Counts of Los Angeles v. Patrick, supra, 11 Cal.App.4th 1246, 14 Cal.Rptr.2d 665, a child support paying father argued former Civil Code section 4727, subdivision (a) was unconstitutional because it prohibited visitation credit for an AFDC recipient. The court upheld the statute concluding, "[T]here is a legitimate purpose for distinguishing between noncustodial parents of AFDC children and noncustodial parents generally in allowing a reduction in support based upon visitation.'' (Id. at p. 1254, 14 Cal.Rptr.2d 665.)
[11]  The significance of the trial court's lack of discretion should not be underestimated. In County of Lake v. Antoni (1993) 18 Cal.App.4th 1102, 22 Cal.Rptr.2d 804, the county sought modification of a child support order. The court found the presumptive guideline amount $494, but reduced it to $294 after considering the father's support of two stepchildren living with him and his high monthly debt payments. The Court of Appeal affirmed. The panel acknowledged the cited factors did not qualify for a hardship deduction but noted section 4057 (former Civ.Code, § 4721, subd. (e)(6)) "effectively vests trial courts with considerable discretion to approach unique cases on an ad hoc basis." (Id. at pp. 1105-1106, 22 Cal.Rptr.2d 804.)
