
222 Cal.App.3d 996 (1990)
272 Cal. Rptr. 216
VEHICULAR RESIDENTS ASSOCIATION et al., Plaintiffs and Appellants,
v.
ARTHUR AGNOS, as Mayor, etc., et al., Defendants and Respondents.
Docket No. A045105.
Court of Appeals of California, First District, Division One.
August 6, 1990.
*997 COUNSEL
Sarge R. Holtzman for Plaintiffs and Appellants.
Louise H. Renne, City Attorney, Randy Riddle and Thomas J. Owen, Deputy City Attorneys, for Defendants and Respondents.
*998 OPINION
STEIN, J.
Vehicular Residents Association, Donald French, T. Allen Giles, Barry Johnson and Arlyss Gayle Kephart (hereafter VRA) filed a complaint for declaratory relief and injunction against the City and County of San Francisco, its mayor, Arthur Agnos and its police chief, Frank Jordan (hereafter, San Francisco). The purpose of the complaint was to test the constitutionality of section 97, subdivision (a) of San Francisco's Municipal Police Code which, as relevant, bans the use of "any house car, camper or trailer coach [hereafter, jointly, motor homes] for human habitation, including but not limited to sleeping, eating or resting, either single [sic] or in groups, on any street, park, beach, square, avenue, alley or public way, within the City and County of San Francisco between the hours of 10 p.m. and 6 a.m."[1] The superior court issued an order granting judgment on the pleadings in favor of San Francisco, rejecting VRA's claims of denial of equal protection and due process.

DISCUSSION
(1) A motion for judgment on the pleadings may be used "`to obtain a declaratory judgment on the merits in favor of the defendant rather than a dismissal of the plaintiff's suit.' (4 Witkin, Cal. Procedure (2d ed. 1971) Proceedings Without Trial, § 161, p. 2817, italics in original.)" (Fisher v. City of Berkeley (1984) 37 Cal.3d 644, 679, fn. 31 [209 Cal. Rptr. 682, 693 P.2d 261].) Review of such a judgment is confined to the face of the pleading under attack  here the complaint  and all facts alleged therein must be accepted as true. (Nunn v. State of California (1984) 35 Cal.3d 616, 620-621 [200 Cal. Rptr. 440, 677 P.2d 846]; April Enterprises, Inc. v. KTTV (1983) 147 Cal. App.3d 805, 815 [195 Cal. Rptr. 421].)
*999 (2a) VRA alleged that San Francisco adopted, and is enforcing, Municipal Police Code section 97 and that the named plaintiffs in the action are poor and unable to afford traditional housing.[2] From the premise that more poor than nonpoor persons attempt to inhabit motor homes, VRA contends that the ordinance is an unconstitutional denial of equal protection.
(3) "[T]he concept of equal protection of the laws means simply `that persons similarly situated with respect to the legitimate purpose of the law receive like treatment.' (Purdy & Fitzpatrick v. State of California (1969) 71 Cal.2d 566, 578 [79 Cal. Rptr. 77, 456 P.2d 645, 38 A.L.R.3d 1194].)" (People ex rel. Younger v. County of El Dorado (1971) 5 Cal.3d 480, 502 [96 Cal. Rptr. 553, 487 P.2d 1193].) "[T]he equal protection clause does not require `Absolute equality' [citation], is not `a demand that a statute necessarily apply equally to all persons' [citation] and permits a state to `provide for differences so long as the result does not amount to ... an "invidious discrimination."' [Citation.]" (In re Antazo (1970) 3 Cal.3d 100, 110 [89 Cal. Rptr. 255, 473 P.2d 999].)
(4) If a statute or ordinance is found to discriminate between similarly situated persons, its constitutionality is tested against one of two standards: "In ordinary equal protection cases not involving suspect classifications or the alleged infringement of a fundamental interest, the classification is upheld if it bears a rational relationship to a legitimate state purpose. [Citations.] But if the statutory scheme imposes a suspect classification ... or a classification which infringes on a fundamental interest ... the classification must be closely scrutinized and may be upheld only if it is necessary for the furtherance of a compelling state interest. [Citations.]" (Weber v. City Council (1973) 9 Cal.3d 950, 958-959 [109 Cal. Rptr. 553, 513 P.2d 601].) However, before either standard is invoked, the law must be shown to be, in fact, discriminatory.

Section 97 Is Not Discriminatory
Not every law which tends to affect one class of persons more than another is discriminatory. In Thayer v. Madigan (1975) 52 Cal. App.3d 16 [125 Cal. Rptr. 28], the court upheld a statute which exempted from garnishment the earnings of a debtor for personal services rendered within 30 days of levy, except garnishment for debts incurred for "common necessaries of life." The statute was challenged on the grounds that it denied equal *1000 protection to the poor because they were more likely than others to use credit to purchase "necessaries of life." Thus, it was argued that the statute would permit the wages of poor persons to be garnished while exempting from garnishment the wages of the nonpoor. In rejecting this challenge the court said, "the statute does not discriminate against the `poor.' Those assertedly disadvantaged are a class which `cannot be identified or defined in customary equal protection terms' [Citation.] Undeniably, the affluent have little concern with the exemption of earnings for personal services in the limited conditions of the statute. But the differentiation of the statute is not between rich and poor. Rather, it is between that indeterminate, and doubtless varying, class of persons who use their earnings to pay for necessaries of life, reserving what credit standing they have for purchase of nonessentials, and those who reverse this practice." (Id. at p. 19.)
In Miller v. Murphy (1983) 143 Cal. App.3d 337 [191 Cal. Rptr. 740], the court followed a similar analysis with respect to an ordinance regulating pawn shops, which included the requirement that persons using pawnbrokers be fingerprinted and otherwise identified. The ordinance was challenged on equal-protection grounds "based on the fact that a substantial part of pawnshops' customers are poor, and that the law therefore gives an advantage to more affluent citizens who need not rely on pawnshops for their money." (Id. at p. 348.) Citing Thayer v. Madigan, supra, 52 Cal. App.3d 16, the court held, "Similar reasoning may apply in this case. The San Francisco statute does not distinguish between the rich and the poor, but instead between persons who use pawnshops and persons who do not. There is no requirement that a pawnshop customer must be below a certain income level. Poor persons are not the only ones who frequent pawnshops. The class of persons who do business with pawnshops is certainly `diverse and amorphous,' just as was the allegedly disadvantaged class in Thayer, supra." (Miller, supra, at p. 349.)
The laws at issue in the cases just discussed differ markedly from those in Serrano v. Priest (1971) 5 Cal.3d 584 [96 Cal. Rptr. 601, 487 P.2d 1241] (hereafter, Serrano I; and see also Serrano v. Priest (1976) 18 Cal.3d 728 [135 Cal. Rptr. 345, 557 P.2d 929]) and In re Antazo, supra, 3 Cal.3d 100, relied upon by VRA. The Serrano cases involved laws which determined the amount of money used to educate a particular child by the tax base of the child's school district. The result was that the wealthier the district the more money spent per child. The court found it "irrefutable" that the school financing system classified on the basis of wealth. (Serrano I at p. 598.) In re Antazo concerned a condition of probation which required a defendant to pay a fine plus a penalty assessment or, in lieu of payment, to be imprisoned in the county jail one day for each $10 of any unpaid amount. The court held at page 112: "We are satisfied that in the case at bench ... *1001 we are presented with an example of discrimination between different groups or classifications of convicted criminal defendants  those who are poor and those who are not  or, to put it another way, of discrimination based upon poverty." In each of these cases the law directly discriminated on the basis of wealth.
(2b) Municipal Police Code section 97, however, does not discriminate between the poor and the nonpoor; no person is permitted to inhabit a motor home during the specified hours and at the specified places. While, as in both Thayer v. Madigan and Miller v. Murphy the ordinance may affect poor persons, and possibly affects more poor than nonpoor persons, the actual class of persons affected is diverse and amorphous. Motor homes are not used exclusively by the poor. Indeed, it is common knowledge that many persons inhabiting motor homes are economically advantaged and use their vehicles for recreational purposes rather than out of economic necessity.

CONCLUSION
Having determined that Municipal Police Code section 97 is not discriminatory, we find it infringes upon no equal protection guaranties.
The judgment is affirmed.
Racanelli, P.J., and Newsom, J., concurred.
NOTES
[1]  Complete text of section 97 follows: "USE OF VEHICLES FOR HUMAN HABITATION PROHIBITED.

"(a) No person shall use or occupy or permit the use or occupancy of any house car, camper or trailer coach for human habitation, including but not limited to sleeping, eating or resting, either single [sic] or in groups, on any street, park, beach, square, avenue, alley or public way, within the City and County of San Francisco between the hours of 10:00 p.m. and 6:00 a.m.
"(b) No person shall use or occupy or permit the use or occupancy of any motor vehicle for human habitation, either single [sic] or in groups, on any street, park, beach, square, avenue, alley or public way, within a residential neighborhood of the City and County of San Francisco between the hours of 10:00 p.m. and 6:00 a.m. For the purposes of this Section, `motor vehicle' shall mean any self-propelled vehicle other than a house car, camper or trailer coach. `Residential neighborhood' shall mean any area of the City zoned for R-H, R-M or R-C use under the City Planning Code, and `habitation' shall mean the use of a motor vehicle as a dwelling place, and shall not mean the use of a motor vehicle for allevation [sic] of sickness or temporary physical inability to operate such motor vehicle."
[2]  That the named plaintiffs "must" sleep in their motor homes is no more than a legal conclusion unsupported by factual allegation, as is the allegation that in enacting the law San Francisco "adopted a policy" of removing economically disadvantaged residents from the Haight-Ashbury community. (See, generally, 4 Witkin, Cal. Procedure (3d ed. 1985) Pleading, § 338, pp. 390-392.)
