
42 Cal.Rptr.3d 184 (2006)
138 Cal.App.4th 1111
The PEOPLE, Plaintiff and Respondent,
v.
Rena Whitney CORBAN, Defendant and Appellant.
In re Rena Whitney Corban on Habeas Corpus.
Nos. A110662, A112528.
Court of Appeal, First District, Division One.
April 21, 2006.
*186 Rodney Richard Jones, (By appointment of the First District Appellate Project) Attorney for Defendant and Appellant  Rena W. Corban.
Office of the Attorney General, Bill Lockyer, Attorney General, Laurence K. Sullivan, Supervising Deputy Attorney General, Catherine A. Rivlin, Supervising Deputy Attorney General, Attorneys for Plaintiff and Respondent  The People of the State of California.
Certified for Partial Publication.[*]
*185 MARCHIANO, P.J.
Two-year-old Liam died from heat exposure after defendant, his mother, left him in a locked car with the windows closed on a hot day. Defendant pleaded no contest to involuntary manslaughter (Pen.Code, § 192, subd. (b))[1] and felony child endangerment (§ 273a, subd. (a)) of Liam, and to felony child endangerment of Jaden, defendant's four-year-old son, who was left in the car with Liam, but survived. Defendant admitted personally inflicting great bodily injury on Liam (§ 12022.7, subd. (d)), as an enhancement to the endangerment charge. She was sentenced to seven years four months in prison, representing the lower term of two years for endangering Liam, four years for personal infliction of great bodily injury on Liam, and one year four months (one-third the midterm) for endangering Jaden; sentence on the involuntary manslaughter count was stayed pursuant to section 654.
Defendant contends on appeal that she could not lawfully be charged with a section 12022.7, subdivision (d) great bodily injury enhancement because a more specific enhancement, the one provided in section 12022.95, applies in cases like this where the child endangerment results in death. In her related petition for habeas corpus, she contends that her counsel below was incompetent for failing to raise this issue before she was sentenced. Defendant's other claim on appeal is that failure to grant her probation was an abuse of discretion.
We hold that neither of the enhancements in question is more specific than the other, and thus the prosecution had discretion to allege either of them. We further conclude that the court acted within its discretion in denying probation. Accordingly, *187 we affirm the judgment and deny the petition.

I. The Enhancement
Section 12022.7, subdivision (d) provides: "Any person who personally inflicts great bodily injury on a child under the age of five years in the commission of a felony or attempted felony shall be punished by an additional and consecutive term of imprisonment in the state prison for four, five, or six years."
Under section 12022.95: "Any person convicted of a violation of Section 273a, who under circumstances or conditions likely to produce great bodily harm or death, willfully causes or permits any child to suffer, or inflicts thereon unjustifiable physical pain or injury that results in death, or having the care or custody of any child, under circumstances likely to produce great bodily harm or death, willfully causes or permits that child to be injured or harmed, and that injury or harm results in death, shall receive a four-year enhancement for each violation, in addition to the sentence provided for that conviction...."
While the four-year sentence imposed here on the section 12022.7 enhancement was the same length as a sentence under section 12022.95, the 12022.7 enhancement makes the underlying endangerment conviction a "violent" and serious felony under sections 667.5, subdivision (c) and 1192.7, subdivision (c)(8). Thus, in contrast to the situation that would have existed if section 12022.95 had been applied, defendant is eligible only for 15 percent, rather than 50 percent worktime credit (§§ 2933, subd. (a), 2933.1, subd. (a)), and can henceforth be charged with a prior "strike" under section 667, subdivision (d)(1).
The People contend that defendant is procedurally barred from arguing that the section 12022.7 enhancement could not be used in her case. The principal contention is that defendant was required to obtain a certificate of probable cause. (§ 1237.5; Cal. Rules of Court, rule 30(b).) Courts have split on the certificate issue when the validity of an enhancement admitted by the defendant has been challenged.
In People v. Loera (1984) 159 Cal.App.3d 992, 206 Cal.Rptr. 60 (Loera), decided by Division Four of this Appellate District, the defendant pleaded guilty to receiving stolen property, and admitted a section 12022.6 enhancement as to the value of the property. He argued on appeal that his sentence for receiving stolen property could not be enhanced under section 12022.6. His arguments were "imprecisely framed and occasionally contradictory" (Loera, supra, at p. 997, 206 Cal.Rptr. 60), but boiled down primarily to the meaning of the word "takes" in the enhancement (Loera, supra, at pp. 999, 1002, 206 Cal. Rptr. 60). Because the defendant was "in effect contending that the sentence imposed was unlawful," the court held that the argument was not precluded by his failure to secure a certificate of probable cause. (Loera, supra, at p. 998, 206 Cal. Rptr. 60.) The holding was based on the principle that "imposition of a sentence which is unlawful, and consequently void, is a jurisdictional defect subject to correction whenever it comes to the attention of either a trial court or a reviewing court." (Loera, supra, at p. 998, 206 Cal.Rptr. 60.)
The Sixth Appellate District reached different conclusions in People v. Arwood (1985) 165 Cal.App.3d 167, 211 Cal.Rptr. 307 (Arwood), and People v. Breckenridge (1992) 5 Cal.App.4th 1096, 8 Cal.Rptr.2d 1 (Breckenridge) which involved admissions of prior serious felony enhancements.[2]*188 The defendant in Arwood argued that his prior conviction did not qualify as a serious felony; the defendant in Breckenridge argued that the admission was invalid because he was not fully informed of his rights. The court held that these arguments could not be raised without a certificate of probable cause because they challenged the validity of the plea. (Arwood, supra, at p. 172, 211 Cal.Rptr. 307; Breckenridge, supra, at p. 1098, 8 Cal.Rptr.2d 1.) The Arwood court reasoned in this regard that "imposition of the enhancement related back to [the defendant's] admission of the prior felony conviction, which occurred at the time he entered the plea." (Arwood, supra, at p. 172, 211 Cal. Rptr. 307.) In People v. Jones (1995) 33 Cal.App.4th 1087, 1092-1093, 39 Cal. Rptr.2d 530, a divided Sixth District panel reviewed Loera, Arwood, and Breckenridge, found Loera inconsistent with Arwood and Breckenridge, and reaffirmed the latter two cases.
"In determining whether section 1237.5 applies to a challenge of a sentence imposed after a plea of guilty or no contest, courts must look to the substance of the appeal: `the crucial issue is what the defendant is challenging, not the time or manner in which the challenge is made.' [Citation.] Hence, the critical inquiry is whether a challenge to the sentence is in substance a challenge to the validity of the plea, thus rendering the appeal subject to the requirements of section 1237.5. [Citation.]" (People v. Panizzon (1996) 13 Cal.4th 68, 76, 51 Cal.Rptr.2d 851, 913 P.2d 1061.) (Italics in original.) Deciding whether an appeal is in substance a challenge to the plea or the sentence can "involve[] difficult ... line-drawing." (People v. Buttram (2003) 30 Cal.4th 773, 790, 134 Cal.Rptr.2d 571, 69 P.3d 420.)
The Loera case, where no certificate of probable cause was required, can be distinguished from Arwood and Breckenridge on the ground that Loera addressed purely legal arguments about the applicability of an enhancement having nothing to do with the particular facts of the defendant's case. (See People v. Scott (1994) 9 Cal.4th 331, 354, 36 Cal.Rptr.2d 627, 885 P.2d 1040 (Scott) [unauthorized sentences involve error that is "`clear and correctable' independent of any factual issues"].) In contrast, the issues in Arwood and Breckenridge, as they related to the plea, were at least partially factual: whether the defendant had in fact committed a prior serious felony, or been properly advised of his rights. Here, as in Loera, defendant raises a purely legal argumentthat a particular enhancement could not be used in her case; although the People suggest otherwise, she is not disputing that the enhancements in question fit the facts of her offense. Defendant's reply brief concedes that "[s]he does not deny responsibility for having inflicted great bodily harm but only seeks to properly measure her liability for having done so." In these circumstances, the challenge is in substance more to the propriety or legality of the sentence than the plea, and no certificate of probable cause was required.
Even if a certificate were required, we could, on defendant's habeas petition, reach the issue presented. The People note that habeas corpus is generally unavailable where an appeal lies (In re Brown (1973) 9 Cal.3d 679, 682, 108 Cal. Rptr. 801, 511 P.2d 1153), and that a defendant generally cannot circumvent the certificate requirement by seeking a writ of habeas corpus (In re Chavez, supra, 30 Cal.4th at p. 651, 134 Cal.Rptr.2d 54, 68 P.3d 347). However, cases have held that *189 the legality of a sentence can be addressed on a petition for habeas corpus, even without a required certificate of probable cause, where there is no material dispute about the facts. (E.g., Arwood, supra, 165 Cal.App.3d at pp. 172-173, 211 Cal.Rptr. 307; People v. Jerome (1984) 160 Cal. App.3d 1087, 1094-1096, 207 Cal.Rptr. 199.) Here, as we have said, there is no dispute about the facts.
The People argue that, "a defendant, even with a certificate of probable cause, may not admit a charge and then argue that the factual basis for the charge establishes a lesser charge or the absence of an admitted element since the plea operates to remove the issue." However, defendant is not challenging the factual basis for her plea.
The People contend that defendant forfeited her argument by failing to raise it below. (People v. Borland (1996) 50 Cal. App.4th 124, 128, 57 Cal.Rptr.2d 562 [correctness of information cannot be challenged for first time on appeal].)[3] However, defendant is alleging legal error that resulted in an unauthorized sentence, a form of error that can be addressed in the first instance on appeal. (Scott, supra, 9 Cal.4th at p. 354, 36 Cal.Rptr.2d 627, 885 P.2d 1040.) Even if an appeal were precluded, the enhancement issue is before us in the petition for habeas corpus, which alleges that counsel was ineffective for failing to insure that defendant admitted the correct enhancement.
Turning to the merits, we note that "[t]he preemption doctrine provides that a prosecution under a general criminal statute with a greater punishment is prohibited if the Legislature enacted a specific statute covering the same conduct and intended that the specific statute would apply exclusively to the charged conduct. [Citations.] To determine the applicability of this doctrine in a particular case, the courts have developed two alternative tests. Under these tests, a prosecution under the general statute is prohibited if: (1) `each element of the general statute corresponds to an element on the face of the [specific] statute'; or (2) `it appears from the statutory context that a violation of the [specific] statute will necessarily or commonly result in a violation of the general statute.' [Citations.]" (People v. Jones (2003) 108 Cal.App.4th 455, 463, 133 Cal.Rptr.2d 358 (Jones); see also People v. Coronado (1995) 12 Cal.4th 145, 153, 48 Cal.Rptr.2d 77, 906 P.2d 1232 ["`special over the general' rule" applies to sentence enhancements, as well as substantive offenses].)
Neither test is met in this case. The elements of the enhancements are not coextensive. Whereas section 12022.7, subdivision (d) applies only when the victim is under age five, section 12022.95 applies when the victim is as old as 17 (see People v. Thomas (1976) 65 Cal.App.3d 854, 857-858, 135 Cal.Rptr. 644 [construing the word "child" in § 273d to mean a child under 18]; CALCRIM No. 821). Violation of section 12022.95 will not necessarily or commonly result in a violation of section 12022.7, subdivision (d) given the narrower age range of victims covered by the latter. "Consequently, as between [the two enhancements] we are unable definitively to denominate either as the more specific. . . ." (People v. Earnest (1975) 53 Cal. App.3d 734, 748, 126 Cal.Rptr. 107.)
An argument very similar to the one raised here was made in People v. Sainz (1999) 74 Cal.App.4th 565, 88 Cal.Rptr.2d 203 (Sainz). The defendant in Sainz *190 caused injury while driving under the influence (Veh.Code, § 23153), and his sentence was enhanced under section 12022.7, subdivision (a). (Sainz, supra, at pp. 568-569, 88 Cal.Rptr.2d 203.) The court rejected his argument that Vehicle Code statutes established a specific sentencing scheme for his offense that precluded imposition of the enhancement. The court found that the Legislature "clearly intended Penal Code section 12022.7 to have broad application" (Sainz, supra, at p. 573, 88 Cal.Rptr.2d 203), observed that certain crimes were expressly excluded from section 12022.7 (§ 12022.7, subd. (g) [excepting murder, manslaughter, and violations of §§ 451, 452]), and noted that the offense in question was not among those excluded (Sainz, supra, at p. 573, 88 Cal. Rptr.2d 203). "`". . . [L]egislative inclusion of the four crimes as exceptions necessarily excludes any other exceptions."'" (Sainz, supra, at p. 573, 88 Cal.Rptr.2d 203, quoting People v. Lewis (1993) 21 Cal.App.4th 243, 247, 25 Cal.Rptr.2d 827.) This reasoning applies equally here.
Thus, "we find no indication that the Legislature intended" section 12022.95 "to supplant, rather than supplement" section 12022.7, subdivision (d). (People v. Bertoldo (1978) 77 Cal.App.3d 627, 634, 143 Cal. Rptr. 675 (Bertoldo).) A contrary conclusion would be inconsistent with the general purpose of section 12022.95, which is to increase, not decrease, punishment (see People v. Valdez (2002) 27 Cal.4th 778, 789, 118 Cal.Rptr.2d 3, 42 P.3d 511), would "devalu[e] the dignity and bodily integrity of ... the class of persons the Legislature specifically sought to protect by enacting" section 12022.7, subdivision (d) (Jones, supra, 108 Cal.App.4th at p. 464, 133 Cal. Rptr.2d 358), and would prevent those who kill the young children protected by section 12022.7, subdivision (d) from being punished as severely as those who merely injure them. Accordingly, "[w]hich [of the two enhancements] is used in a given situation is a proper matter for prosecutorial discretion." (Bertoldo, supra, at p. 634, 143 Cal.Rptr. 675.)
Defendant submits that she is "similarly situated with others who suffered the distinction of neglecting their children to the point of death," and that the constitutional guarantees of equal protection require a uniform application of section 12022.95 to all section 273a violations where the victim dies. "In order to establish a meritorious claim under the equal protection provisions of our state and federal Constitutions [an] appellant must first show that the state has adopted a classification that affects two or more similarly situated groups in an unequal manner." (People v. Green (2000) 79 Cal. App.4th 921, 924, 94 Cal.Rptr.2d 355 (Green).) "If it is determined that the law treats similarly situated groups differently, a second level of analysis is required. If the law in question impinges on the exercise of a fundamental right, it is subject to strict scrutiny and will be upheld only if it is necessary to further a compelling state interest. All other legislation satisfies the requirements of equal protection if it bears a rational relationship to a legitimate state purpose." (People v. Goslar (1999) 70 Cal. App.4th 270, 277, 82 Cal.Rptr.2d 558 (Goslar).)
Even if we assume that the two groups involved herethose whose neglect causes death of children under age five, and those whose neglect causes death of children five and older"... `are sufficiently similar with respect to the purpose of the law in question that some level of scrutiny is required in order to determine whether the distinction is justified' ..." (Goslar, supra, 70 Cal.App.4th at p. 277, 82 Cal.Rptr.2d 558), and that strict scrutiny is necessary (see ibid. [when this test applies *191 to criminal legislation is a matter of dispute]), defendant's equal protection argument fails. The state has a compelling interest in the safety of very young children who, because of their age, are the most vulnerable to neglect, and those who endanger very young children must be exposed to punishment under section 12022.7, subdivision (d) to put the penalty for the death of such children on par with that for their great bodily injury. Defendant asserts that "[l]eaving it to the prosecutor's discretion to decide which of these enhancements to plead and prove ... is a constitutionally infirm practice," but the equal protection guarantee does not preclude that discretionary determination. "Equal protection applies to ensure that persons similarly situated with respect to the legitimate purpose of the law receive like treatment; equal protection does not require identical treatment." (Green, supra, 79 Cal.App.4th at p. 924, 94 Cal. Rptr.2d 355.) As explained below, the offense against Liam was egregious. The prosecution was not constitutionally required to charge defendant as if it were otherwise.

II.-III.[**]

IV. Disposition
The judgment is affirmed and the petition for writ of habeas corpus is denied.
We concur: STEIN and SWAGER, JJ.
NOTES
[*]   Pursuant to California Rules of Court, rules 976(b) and 976.1, this opinion is certified for publication with the exception of parts II and III.
[1]  Unless otherwise indicated, all further statutory references are to the Penal Code.
[2]  Breckenridge was disapproved on another ground in In re Chavez (2003) 30 Cal.4th 643, 657, fn. 6, 134 Cal.Rptr.2d 54, 68 P.3d 347.
[3]  Defense counsel belatedly raised the enhancement issue during the period for recall of the sentence (§ 1170, subd. (d)), but there is no record of a ruling on the point.
[**]   See footnote*, ante.
