
16 Cal.App.3d 146 (1971)
93 Cal. Rptr. 786
GEORGE M. AMES, Plaintiff and Appellant,
v.
CITY OF HERMOSA BEACH et al., Defendants and Respondents.
Docket No. 34817.
Court of Appeals of California, Second District, Division Four.
March 19, 1971.
*148 COUNSEL
William W. Willens, Barrett, Stearns & Collins, and Robert F. La Scala for Plaintiff and Appellant.
J.B. Mirassou, City Attorney, and Center, Evans, Hilby, Sailors, Wegener & Mirassou, for Defendants and Respondents.
*149 OPINION
IRWIN, J.[*]
This is an appeal in an action seeking a declaration that certain loitering and housing, laws of the City of Hermosa Beach are unconstitutional on their face and are therefore void. Appellant, a taxpayer, brought this action pursuant to section 526a of the Code of Civil Procedure to enjoin respondents from expending public funds and from using public property for the purpose of administering or enforcing certain provisions of its Municipal Code, to wit, (1) sections 20-10 and 20-11, relating to loitering,[1] and (2) section 18-14, regulating the rental of housing accommodations to minors.[2] Although the complaint set forth two causes of action, the first attacking the housing section and the second the loitering sections, respondents filed a single general demurrer to the entire complaint which was sustained and the action was ordered dismissed after appellant *150 failed to amend his complaint within the time allowed. A preliminary injunction was denied. The appeal is from these orders.[3]
(1) Since perfection of this appeal, respondent city has amended section 20-10 by its ordinance No. NS 345 which also adds to the Municipal Code (new) section 20-12, relating to loitering in public ways. Appellant now asks us to pass upon the validity of all three loitering sections as presently constituted, arguing as to the first amended section that the slight change in phraseology should not prevent him from testing its constitutionality because that language did not, per se, validate the enactment. We agree.
The sole change effected by the amendment was to replace the bare phrase "in violation of" found in the old section with the new language "in such manner as unreasonably to violate." The constitutional problem raised by the former text is not removed by the amendment. Since the issue has not been eliminated, this court must pass upon it. (See Carter v. Stevens (1930) 208 Cal. 649, 651 [284 P. 217].)
(2) New section 20-12, however, presents an entirely new case, unrelated to either count of the action pleaded. It was never presented to or considered by the lower court and is therefore not properly before us.
(3) Respondents contend that the appellant taxpayer has no standing to enjoin the expenditure of public funds necessary to the enforcement of a statute which is penal in nature. In other cases courts have held that where government funds were employed so as to deprive others of constitutionally secured rights (Wirin v. Parker (1957) 48 Cal.2d 890 [313 P.2d 844]; County of Los Angeles v. Superior Court (1967) 253 Cal. App.2d 670 [62 Cal. Rptr. 435]; Wirin v. Horrall (1948) 85 Cal. App.2d 497 [193 P.2d 470]) or to enforce laws which are themselves unconstitutional and therefore void (Lundberg v. County of Alameda (1956) 46 Cal.2d 644 [298 P.2d 1]; Simpson v. City of Los Angeles (1953) 40 Cal.2d 271 [253 P.2d 464]), this use constitutes an "illegal expenditure" in the context of Code *151 of Civil Procedure, section 526a[4] and may be remedied under that section by an injunction sought in a taxpayer's suit. We have been cited to no authority, nor have we found anywhere a distinction drawn for the purpose of this rule between penal and nonpenal statutes. (See McKay Jewelers, Inc. v. Bowron (1942) 19 Cal.2d 595 [122 P.2d 543, 139 A.L.R. 1188].) Indeed, it would strain the plain meaning of the statute to construe it so that an expenditure to enforce an unconstitutional penal statute was not similarly "illegal."
In his complaint, appellant has alleged that public money has been appropriated and will continue to be appropriated and spent in the future to establish a system for enforcement of the challenged sections. He thus brings himself within the provisions of section 526a.
In Zeitlin v. Arnebergh (1963) 59 Cal.2d 901, 906 [31 Cal. Rptr. 800, 383 P.2d 152, 10 A.L.R.3d 707], the Supreme Court sanctioned a declaratory relief action by a bookseller and a prospective reader of a book, "Tropic of Cancer," to determine that sale of that book could not constitutionally be prosecuted under the obscenity statute, Penal Code section 311. The justification for the action was that the threat of prosecution operated to prevent the exercise of First Amendment rights. The ordinances challenged in the case before us likewise have the effect of preventing conduct which is arguably protected by the state and federal Constitutions. The rationale of the Zeitlin case thus adds justification for the determination of the constitutional questions by means of this taxpayer's suit. We therefore turn to a determination of the questions presented on their merits.

The Loitering Ordinances
(4) The words "loaf or loiter" have more than one meaning, depending upon the context. Some statutes making it a crime to "loaf or loiter" are upheld by giving the words a restricted and sinister meaning. (See In re Cregler (1961) 56 Cal.2d 308 [14 Cal. Rptr. 289, 363 P.2d 305]; In re Huddleson (1964) 229 Cal. App.2d 618 [40 Cal. Rptr. 581].)
Hermosa Beach Municipal Code, section 20-11 forbids a person to loaf or loiter "for a period of time longer than reasonably necessary to transact ... business." A person who comes on city property to transact business with the city is not engaged in loafing or loitering in the restricted and sinister *152 sense intended by the statutes upheld in the Cregler and Huddleson cases. A broader meaning for "loaf or loiter" is necessarily indicated by a reading of the section as a whole, for otherwise the qualifying language would be unnecessary. The ordinance on its face appears to be aimed at anyone who is on city property except for the purpose of transacting business with the city; and as to such persons also, except for the period of time reasonably necessary for such business. In this form it is overbroad and a threat to the exercise of activities protected by the First Amendment, and is therefore unconstitutional and void. (In re Hoffman (1967) 67 Cal.2d 845, 852-853 [64 Cal. Rptr. 97, 434 P.2d 353].)
(5) Section 20-10 purports to give the owner of private property the arbitrary power to exclude anyone at his whim, under penalty of criminal prosecution. Such an ordinance is clearly an interference with the civil rights guaranteed by Civil Code sections 51 and 52. The ordinance is unconstitutional under the principles set forth in In re Bell (1942) 19 Cal.2d 488 [122 P.2d 22]; In re Cox (1970) 3 Cal.3d 205 [90 Cal. Rptr. 24, 474 P.2d 992]; and Diamond v. Bland (1970) 3 Cal.3d 653 [91 Cal. Rptr. 501, 477 P.2d 733]. The ordinance contains none of the exceptions which saved the ordinance considered in the Cox case. It is impossible to save the ordinance in this case by reading into it, by construction, the many exceptions which would be necessary to avoid conflict with the Civil Code and the Constitution. In its present form it is so overbroad that it stands as a serious threat to the exercise of civil and constitutional rights.

The Housing Ordinance
(6) Appellant in his first cause of action challenges the constitutionality of the housing law, which makes it unlawful to rent to anyone under the age of 18 without having some responsible adult as a co-tenant and makes it the duty of the owner or his agent to file with the chief of police certain information relating to minor rentals.
The problem created by unsupervised minors who flock to resort areas at vacation time is too well known to require elaboration. The City of Hermosa Beach has attempted to deal with the problem by means of an ordinance which places no difficult burden upon anyone. The apparent theory is to have at least one adult involved as co-tenant in any letting of housing or rooming accommodations to persons under 18. Co-tenancy brings into operation a number of legal powers, privileges, duties and liabilities which may reasonably be thought to have a salutary effect. A co-tenant is entitled to the use of the premises, and he is civilly liable to the lessor and to third parties in a variety of contingencies. It is not unreasonable to believe *153 that an adult who assumes such a legal relationship is likely to exercise some moral influence as well over his juvenile co-tenants.
An ordinance enacted for such a purpose is not invalid because it obviously will not operate as hoped for in every case, or because a court may be persuaded that it won't be successful at all in restraining the improper behavior of those juveniles who are disposed to misbehave.
It is not improper to classify minors or juveniles differently from adults. The law has long recognized the validity of classifications based upon age. (In re Weber (1906) 149 Cal. 392 [86 P. 809]; In re Spencer (1906) 149 Cal. 396, 401 [86 P. 896]; People v. Walton (1945) 70 Cal. App.2d Supp. 862, 867 [161 P.2d 498]; cf. Dept. of Mental Hygiene v. McGilvery (1958) 50 Cal.2d 742, 755 [329 P.2d 689].) It is of course true that some persons under 18 are more responsible and wiser than some adults, so that the age-based classifications do not always achieve the desired results. Nevertheless the classification is upheld upon the common belief that juveniles, as a class, are in need of a kind of supervision which can be provided only by persons over the age of 21.
Every juvenile is presumptively under the supervision of a parent or guardian who can readily assume the responsibility of co-tenant if the activity has his approval. The ordinance makes compliance even easier in that it does not require that the adult co-tenant be such a parent or guardian.
The requirement that names and addresses be obtained is neither unreasonable nor burdensome. Hotels traditionally have required their guests to register. There is no reason to believe that passing along the registration information to the police would be an undue burden. The possession of the information would be of real value in a great variety of emergency situations with which the police are required to deal  for example, in notifying the parents of a youngster who is injured.
We find no difficulty with the use of the term "responsible adult" in the ordinance. What is contemplated is an adult legally competent to undertake the responsibility imposed by law upon a co-tenant. There is nothing in the ordinance to substantiate plaintiff's expressed fear that the lessor must pass upon the moral or financial qualifications of the adult or his ability to supervise effectively the juveniles who are his co-tenants.
Appellant makes several constitutional arguments which require only brief mention.
The statutes which forbid discrimination upon the basis of color, race, religion or national origin do not forbid treating juveniles and minors *154 differently from adults in appropriate circumstances. Appellant speaks of "preemption," but cites no state statute which covers the field.
The ordinance does not prohibit, or impede, the free movement of persons from state to state, nor does it burden interstate commerce. It violates no one's privileges and immunities.
We conclude as to count I that section 18-14 is not on its face unconstitutional.
Despite our opinion that the housing ordinance attacked in the first cause of action is not unconstitutional, the order dismissing the complaint as a whole must be reversed because the general demurrer was to the entire complaint and should have been overruled because the second count states a valid cause of action. (Mills v. Mills (1956) 147 Cal. App.2d 107, 124 [305 P.2d 61].)
Accordingly the order dismissing the action is reversed and the cause remanded for further proceedings consistent with the views herein expressed; the order denying preliminary injunction is affirmed.
Files, P.J., and Jefferson, J., concurred.
NOTES
[*]   Retired judge of the superior court sitting under assignment by the Chairman of the Judicial Council.
[1]  "SECTION 20-10. Loitering on Commercial or Private Property.

"No person shall linger, loiter, sit, stand, or otherwise use for business or social purposes any parking or open space serving area on any commercial or private property in violation of the expressed wish of the owner, legal tenant or manager of such commercial or private property."
"SECTION 20-11. Loitering in Buildings or on Property Owned, Leased or Operated by the City of Hermosa Beach.
"It shall be unlawful for any person to loaf or loiter in any waiting room, lobby, or other portion of any building or property owned, leased or operated by the City of Hermosa Beach for a period of time longer than reasonably necessary to transact such business as such person may have to transact with any City officer, employee or department using or occupying such building or property owned, leased or operated by the City of Hermosa Beach."
[2]  "SECTION 18-14. Responsibility of Owners in Renting to Minors.

"1. It shall be unlawful for any owner, manager, operator, or employee to lease, rent or let any apartment, house, room or rooms to any person or persons under the age of eighteen (18) without having some responsible adult as the co-tenant.
"It shall be the duty and requirement of such owner, manager, operator or employee to file with the Chief of Police of the City of Hermosa Beach the following information:
"A. Name, age, business or occupation, and address of business or occupation of all persons, including the responsible adult, to whom he leases, rents or lets such premises.
"B. Names and addresses of parents, or guardians, of all the persons under the age of eighteen (18) years.
"2. It shall be unlawful for any owner, operator, manager or employee to lease, rent or let any apartment, house, room or rooms to any person or persons between the ages of eighteen (18) and twenty-one (21) without first having filed with the Chief of Police of the City of Hermosa Beach the following information:
"A. Name, age, business or occupation, and the address of business or occupation of all persons between the ages of eighteen (18) and twenty-one (21).
"B. Names and addresses of the parents, or guardians, of all said persons."
[3]  The notice of appeal filed by plaintiff purports to appeal from the orders sustaining the demurrer and denying a preliminary injunction. The order sustaining the demurrer is not appealable, but is reviewable on an appeal from the ensuing order of dismissal. The record shows that such a dismissal was entered. We may therefore liberally construe the notice as a valid appeal from the judgment. (Rule 1(a), Cal. Rules of Court; Smith v. Smith (1954) 126 Cal. App.2d 194 [272 P.2d 118].)

The order denying an injunction is separately appealable. (Code Civ. Proc., § 904.1, subd. (f).) The record on appeal shows that plaintiff failed to make any attempt to prove by affidavits or otherwise that there was any urgency requiring temporary relief while this action is pending. Thus, the order denying the preliminary injunction must be affirmed.
[4]  Code of Civil Procedure, section 526a reads, in part, as follows: "An action to obtain a judgment, restraining and preventing any illegal expenditure of, waste of, or injury to, the estate, funds, or other property of a county, town, city or city and county of the state, may be maintained against any officer thereof, or any agent, or other person, acting in its behalf, either by a citizen resident therein, or by a corporation, who is assessed for and is liable to pay, or, within one year before the commencement of the action, has paid, a tax therein."
