
226 Kan. 526 (1979)
601 P.2d 1145
CITY OF JUNCTION CITY, Plaintiff-Appellant,
v.
VOYNE D. MEVIS, Defendant-Appellee.
No. 50,797
Supreme Court of Kansas.
Opinion filed October 27, 1979.
Michael P. McKone, city attorney, argued the cause and was on the brief for the appellant.
David P. Troup, of Weary, Davis, Henry, Struebing, and Troup, of Junction City, argued the cause and was on the brief for the appellee.
The opinion of the court was delivered by
PRAGER, J.:
This is a criminal proceeding brought by the city of Junction City against the defendant, Voyne D. Mevis, for an alleged violation of Junction City Ordinance 12-410 (d), which deals with the unlawful use of weapons. The defendant was found guilty in municipal court of Junction City and appealed to the district court. There the defendant filed a motion to dismiss the complaint on the grounds that the ordinance was unconstitutional. The district court sustained the defendant's motion, found the city ordinance unconstitutional, and dismissed the complaint. The city has appealed to this court.
There was no evidence presented in district court either by the city or by the defendant. For the purposes of his motion to dismiss, the defendant admitted the following facts: His automobile was stopped by the Junction City police on November 10, 1978; defendant exited the vehicle at the request of the police *527 officer; a search of the vehicle disclosed the pistol described in the complaint on the floor under the front seat; the defendant was alone in the automobile at the time it was stopped; and both the automobile and pistol were owned by the defendant. In his motion to dismiss, the defendant challenged the constitutionality of ordinance 12-410 on the basis that it deprived him of due process of law, contrary to the Fourteenth Amendment to the United States Constitution and Sections 1 and 2 of the Kansas Bill of Rights. The trial court, in sustaining the defendant's motion to dismiss, made the following findings of fact and conclusions of law:
"1. Junction City Ordinance No. 12-410(d) proscribes the carrying of any pistol, revolver, or other firearm on the person or in any land, water or air vehicle, except when on his land or in his abode, fixed place of business or in his office;
"2. That in the reading of that proscription, there is a clear and definite meaning as to what is outlawed by the terms of that ordinance;
"3. That other ordinances of the City of Junction City, Kansas, allow for the sale and purchase of certain weapons which this ordinance prohibits persons from transporting or carrying;
"4. That in an analysis of the general police powers of the City, the law allows the City to legislate in this area, but:
"(a) The prohibition in 12-410(d) is so general in scope that it prohibits certain acts that cannot be reasonably classified as unlawful;
"(b) that the general nature of the ordinance includes and makes unlawful activities in which the police power cannot operate;
"(c) that the ordinance severely limits the actions of dealers and purchasers of weapons, which are legal by themselves;
"(d) that Ordinance 12-410(d) provides no way to transport a weapon to and from a place of business;
"5. Although the City may have a valid purpose in legislation dealing with the control of weapons, it cannot achieve this goal when its legislation is so broad as to invade legal activities or protected freedoms;
"6. That the ordinance is so broad that it is an infringement upon lawful activities;
"7. With respect to the issue of waiver raised by the plaintiff, the Court finds that, although stipulated by the parties that this constitutional attack was not raised by the defendant in the Municipal Court, the Court finds that since the Municipal Court is not a court of record, and since this is a constitutional issue going directly to the essence of the Ordinance, this matter is properly presented to the District Court since this is a "de novo" hearing on appeal and has not been waived by the defendant;
"8. With respect to the issue of standing raised by the plaintiff, the Court finds that the Court simply need look to the Ordinance itself, and not place a different construction on the Ordinance, and overbreadth is such an issue that this defendant may raise."
*528 On appeal, the city contends that the district court erred (1) in holding Ordinance 12-410(d) was unconstitutionally overbroad; (2) in ruling that the defendant had not waived the defense of unconstitutionality by failing to assert that defense in the original proceeding in the municipal court; and (3) in ruling that the defendant had standing to attack the ordinance on constitutional grounds.
We shall first consider the contention by the city that the defendant waived his right to attack the constitutionality of the ordinance because he failed to raise that issue initially in the municipal court. It is well-settled law in this state that a constitutional challenge to a statute or city ordinance should be raised at the earliest possible opportunity or is considered to be waived. Willoughby v. Willoughby, 178 Kan. 62, 283 P.2d 428 (1955). Although we recognize that the defendant might well have raised the constitutional question in municipal court, we have concluded that his failure to do so here should not be fatal. His appeal to the district court was as a matter of right under K.S.A. 12-4601. In district court, the defendant was entitled to a trial de novo where he had the right to raise any defense to the charge. The situation is entirely different than in those cases where the constitutional question was never raised in the trial court but was first presented at the appellate level. We hold that the defendant did not waive his right to challenge the constitutionality of the ordinance by failing to assert that defense in municipal court.
The city contends that the defendant lacked standing to challenge the city ordinance as unconstitutionally overbroad, because his argument of unconstitutionality applies to other persons and he has made no showing that he falls into that category of persons whose rights are adversely affected by the ordinance. In support of its position, the city cites United States v. Raines, 362 U.S. 17, 4 L.Ed.2d 524, 80 S.Ct. 519 (1960); City of Junction City v. White, 2 Kan. App.2d 403, 580 P.2d 891 (1978); and State v. Thompson, 221 Kan. 165, 558 P.2d 1079 (1976). Here the defendant was convicted in municipal court of violating the ordinance and sentenced to a term in the county jail and a fine of $1,000. His constitutional attack on the statute was on the basis that the city ordinance is void on its face without consideration of the factual circumstances involved in the case. Defendant's position is that the ordinance, by its language, is unconstitutional on its face *529 because it is so broad in its application as to be beyond the legitimate exercise of the police power. He maintains that where a statute is void on its face, any allegations in a complaint, purporting to charge a public offense, cannot serve to validate an offense intended to be charged under the void statute. Citing, State v. Hill, 189 Kan. 403, Syl. ¶ 3, 369 P.2d 365 (1962). It cannot be denied that the defendant has been adversely affected by the application of the ordinance to him since he has been convicted under it and sentenced to a fine and imprisonment. Under the circumstances, we have concluded that the defendant has standing to raise the constitutional issue and it should be determined in this action.
We turn now to the primary issue raised in the case  the constitutionality of Ordinance 12-410(d). The predecessor to Ordinance 12-410 was before this court for consideration in City of Junction City v. Lee, 216 Kan. 495, 532 P.2d 1292 (1975). The former Junction City ordinance considered in Lee was enacted in 1973 and provided in part as follows:
"12-410 (1) Unlawful use of weapons is knowingly:
....
"(d) Carrying any pistol, revolver or other firearm on the person or in any land, water or air vehicle except when on his land or in his abode, fixed place of business or office; or
....
"(2) Exemptions. (a) Subsections (1) (a), (b), (c), (), and (g) of this section shall not apply to or affect any of the following: (i) Law enforcement officers, or any person summoned by any such officers to assist in making arrests or preserving the peace while actually engaged in assisting such officer; (ii) Wardens, superintendents and keepers of prisons, penitentiaries, jails and other institutions for the detention of persons accused or convicted of crime; (iii) Members of the armed services or reserve forces of the United States or the Kansas national guard while in the performance of their official duty; (iv) Manufacture of, transportation to, or sale of weapons to persons authorized under (i) through (iii) of this subsection to possess such weapons.
"(b) Subsection (1) (b) and (d) of this section shall not apply to or affect the following: (i) Watchmen while actually engaged in the performance of the duties of their employment; or (ii) Licensed hunters or fishermen while engaged in hunting or fishing and traveling in places to hunt and fish; or (iii) Persons licensed as private detectives by the state of Kansas, detectives or special agents regularly employed by railroad companies or other corporations to perform full-time security or investigative service.
....
"(d) Subsection (1) (d) shall not apply to persons carrying unloaded weapons directly from or to places where said weapons are to be or have been repaired or sold by a gunsmith or dealer.

*530 "(3) It shall be a defense that the defendant is within an exemption." (pp. 499, 500.)
In Lee, the ordinance was attacked on the following grounds: (1) The ordinance violates the right of a citizen to bear arms provided for in the Kansas Constitution, § 4; (2) the city ordinance is in conflict with K.S.A. 21-4201, which prohibits only the carrying of concealed weapons and not unconcealed weapons; and (3) the state legislature, by enacting K.S.A. 21-4201 has preempted the field of weapons control to the exclusion of municipal regulations. On appeal this court reversed, rejecting each of the defendant's contentions, all three of which had been sustained in the district court. Following the decision in Lee, Ordinance 12-410 was amended to read in part as follows:
"12-410 DEADLY WEAPONS: Section 10. Unlawful use of weapons is knowingly:
....
"(d) Carrying any pistol, revolver or other firearm on the person or in any land, water or air vehicle except when on his land or in his abode, fixed place of business or office; or
....
"(2) (a) Subsections (1) (a), (b), (c) and (d or affect any of the following:

"(i) Law enforcement officers, or any person summoned by any such officers to assist in making arrests or preserving the peace while actually engaged in assisting such officers; (ii) Wardens, superintendents and keepers of prisons, penitentiaries, jails and other institutions for the detention of persons accused or convicted of crimes; (iii) Members of the armed services or reserve forces of the United States or the Kansas national guard while in the performance of their official duty; (iv) Manufacture of, transportation to, or sale of weapons to persons authorized under (i) through (iii) of this subsection to possess such weapons. (G-387; 3/21/75)
"(b) Subsection (1) (b) and (d) of this section shall not apply to or affect the following: (i) Watchmen while actually engaged in the performance of the duties of their employment; or (ii) Licensed hunters or fishermen while engaged in hunting or fishing and traveling to and from places to hunt and fish; those engaged in camping, scouting, trap, skeet or target shooting and instruction and training in safety and skillful use of weapons and traveling to and from places to engage in such activities; or (iii) Persons licensed as private detectives by the State of Kansas, detectives or special agents regularly employed by railroad companies or other corporations to perform full-time security or investigative service. (G-371; 4/16/74)"
The ordinance now before us differs from the ordinance considered in Lee in five specific respects:
(1) A former section (1) (g) dealing with automatic weapons was deleted in its entirety.

*531 (2) The exemption in (2) (b) (ii) dealing with hunters and fishermen was enlarged to include, in addition to licensed hunters and fishermen while engaged in hunting or fishing and traveling to and from places to hunt and fish, "those engaged in camping, scouting, trap, skeet or target shooting, and instruction and training in safety and skillful use of weapons and traveling to and from places to engage in such activities."
(3) An exception in (2) (c), which permitted a barber or licensed doctor making house calls, to carry a knife or razor was eliminated.
(4) Former section (2) (d), which exempted from the application of (1) (d), "[P]ersons carrying unloaded weapons directly from or to places where said weapons are to be or have been repaired or sold by a gunsmith or dealer," was deleted in its entirety.
(5) Section (3) of the former ordinance was deleted. That section in the old ordinance provided that "it shall be a defense that the defendant is within an exemption."
Before turning to the issue of constitutionality, we should also note the provisions of another Junction City ordinance which prohibit the sale of firearms unless the purchaser first obtains a registration certificate issued by the chief of police. The ordinance referred to is 18-3a101 et seq., which is denominated the "Handgun Ordinance" and provides in part as follows:
"18-3a101  REGISTRATION. Section 1. From and after the effective date of this Ordinance, no pistol, revolver or other firearm with a barrel less than 10 inches in length shall be sold in the City of Junction City, Kansas, unless the purchaser thereof shall have first obtained a registration certificate to be issued by the Chief of Police of the City.
....
"18-3a103  PERSONS NOT ELIGIBLE FOR CERTIFICATE OF REGISTRATION. No certificate of registration shall be issued to any of the following classes of persons:
"a. Any person under the age of Eighteen (18) years.
"b. Any person convicted of a felony as defined in K.S.A. 21-3105 (1).
"c. Any person who is addicted to the use of narcotics or is mentally retarded or is a habitual drunkard. (G-418; 8/17/76)
"18-3a104  WAITING PERIOD. Section 4. No firearm as herein described shall be delivered into the possession of the purchaser thereof until a period of 48 hours shall have transpired from the time of issuance of such certificate of registration and said certificate shall have been presented to the seller.

*532 "18-3a105  EXCLUSIONS. Section 5. The provisions of this Ordinance shall not apply to any duly authorized police officer, marshal, sheriff, constable, or other law enforcement officer designated by the federal, state, county or municipal governments, who purchase weapons to be used in the performance of their duties.
"18-3a106  PENALTY. Section 6. Any person who shall violate or fail to comply with the provisions of this Ordinance, or any person, firm or corporation who shall either directly or indirectly or by agent or employee, violate or fail to comply with any of the provisions of this Ordinance, shall upon conviction be fined not more than $100.00 or imprisoned in the City Jail for not more than 90 days, or both such fine and imprisonment."
This ordinance must be kept in mind in our consideration of the constitutionality of Ordinance 12-410.
In support of its position that 12-410 is unconstitutionally overbroad, defendant points out the provisions of 18-3a103 et seq. which permit the sale and purchase of handguns upon obtaining a registration certificate, and then directs our attention to the fact that under Ordinance 12-410 (d) it is unlawful to possess a firearm anywhere within the city limits of Junction City except in one's home or fixed place of business. The defendant argues that it is thus a criminal offense to transport a firearm from the place of purchase to the purchaser's home or between a person's office or place of business and his home. He suggests that even a licensed hunter or sportsman who purchases a gun can avoid a charge of unlawful possession only by immediately departing on his hunting trip from the gun dealer's place of business. This situation exists because the city, in enacting the new ordinance, failed to include therein former section (3) which specifically provided that subsection (1) (d) shall not apply to persons carrying unloaded weapons from or to places where weapons have been repaired or sold by a gunsmith or dealer. Applying the city ordinance literally, it appears that virtually every private citizen of Junction City who has purchased a firearm since the passage of 12-410 has committed a crime in possessing that firearm.
The defendant does not contend that weapons control in general is not an appropriate place for the exercise of the police power. He maintains, however, that Ordinance 12-410(d) is arbitrary, unreasonable, and oppressive, and that its prohibitions and exclusions are not reasonably related to its purpose and thus it is an unlawful exercise of the police power. In support of his position, the defendant cites a Colorado case, Lakewood v. Pillow, 180 Colo. 20, 501 P.2d 744 (1972), where a city ordinance *533 quite similar to the Junction City ordinance was held to be unconstitutionally overbroad. That case involved the constitutionality of an ordinance of the city of Lakewood which made it unlawful to carry and possess dangerous weapons. The Lakewood ordinance provided as follows:
"Unlawful to Possess, Carry or Use Dangerous or Deadly Weapons. (a) It shall be unlawful for any person to have in his possession, except within his own domicile, or to carry or use, a revolver or pistol, shotgun or rifle of any description, which may be used for the explosion of cartridges, or any air gun, gas operated gun or spring gun, or any bow made for the purpose of throwing or projecting missiles of any kind by any means whatsoever; provided that nothing in this section shall prevent use of any such instruments in shooting galleries or ranges under circumstances when such instruments can be fired, discharged or operated in such manner as not to endanger persons or property and also in such manner as to prevent the projectile from traversing any grounds or space outside the limits of such gallery or range; and provided further, that nothing herein contained shall be construed to prevent the carrying of any type of gun, when unloaded, or any bow, to or from any range, gallery or hunting areas. (b) Nothing in this section shall prevent the possession or use of any of said instruments by persons duly licensed for such purpose by the City of Lakewood. (c) Nothing in this section shall prevent the use of or possession of any said instrument by law enforcement personnel." (pp. 22-23.)
It should be noted that the Lakewood ordinance made it unlawful for any person to have a revolver or pistol in his possession except within his own domicile, making an exception in cases of shooting galleries or ranges or hunting or by persons duly licensed or when used by law enforcement personnel. The Supreme Court of Colorado held the Lakewood ordinance to be invalid on the grounds that it was unconstitutionally overbroad. Among other deficiencies, the Colorado court noted that the ordinance prohibited an individual from transporting guns to and from places of business such as gunsmiths, pawnbrokers, and sporting goods stores.
The city of Junction City, in its defense of the ordinance, contends that a validly passed statute or ordinance is presumed to be constitutional and should be construed to be constitutional, if possible. Counsel then argues that this court should, by judicial construction, add to the exceptions contained in Ordinance 12-410 to meet the objections raised by the defense. Under the listed exceptions, the city maintains that the ordinance is amenable to a construction which permits the use of weapons for all recreational or business purposes without the flat prohibitions or ineffective *534 licensing provisions often employed in other statutes and ordinances. In its brief, the city states that under the ordinance, the police do not usually find a violation by those citizens who can show that the purpose or reason for transporting the weapon was either for recreational or business purposes since the exemptions in Sections (2) (a) and (b) of 12-410 can be reasonably construed to permit the possession and transportation of the regulated weapons for all business or recreational purposes. In other words, the city maintains that the courts should read additional exceptions into the act which are not specifically contained therein.
We have concluded that the district court properly held Ordinance 12-410 to be unconstitutionally overbroad and an unlawful exercise of the city's police power. We, of course, recognize the basic principles which the courts must apply in determining the constitutionality of a statute or city ordinance. The basic principles are set forth in our recent opinion in City of Baxter Springs v. Bryant, 226 Kan. 383, 598 P.2d 1051 (1979), as follows:
"The constitutionality of a statute is presumed, all doubts must be resolved in favor of its validity, and before the statute may be stricken down, it must clearly appear the statute violates the constitution." (Syl. ¶ 1.)
"In determining constitutionality, it is the court's duty to uphold a statute under attack rather than defeat it and if there is any reasonable way to construe the statute as constitutionally valid, that should be done." (Syl. ¶ 2.)
"Statutes are not stricken down unless the infringement of the superior law is clear beyond substantial doubt." (Syl. ¶ 3.)
"The propriety, wisdom, necessity and expedience of legislation are exclusively matters for legislative determination and courts will not invalidate laws, otherwise constitutional, because the members of the court do not consider the statute in the public interest of the state, since, necessarily, what the views of members of the court may be upon the subject is wholly immaterial and it is not the province nor the right of courts to determine the wisdom of legislation touching the public interest as that is a legislative function with which courts cannot interfere." (Syl. ¶ 4.)
"Once a subject is found to be within the scope of the state's police power, the only limitations upon the exercise of such power are that the regulations must have reference in fact to the welfare of society and must be fairly designed to protect the public against the evils which might otherwise occur. Within these limits the legislature is the sole judge of the nature and extent of the measures necessary to accomplish its purpose." (Syl. ¶ 5.)
In State v. Pendarvis, 181 Kan. 560, 313 P.2d 237 (1957), at page 566, we stated that the fixed rule and basic standard by which the validity of all exercises of the police power is tested is that the *535 police power of the state extends only to such measures as are reasonable and that all police regulation must be reasonable under all circumstances.
In Delight Wholesale Co. v. City of Overland Park, 203 Kan. 99, 453 P.2d 82 (1969), the limitation on the police power of a city is stated as follows:
"While the police power is wide in its scope and gives a governmental body broad power to enact laws to promote the health, morals, security and welfare of the people, and further, a large discretion is vested in it to determine for itself what is deleterious to health, morals or is inimical to public welfare, it cannot under the guise of the police power enact unreasonable and oppressive legislation or that which is in violation of the fundamental law." (Syl. ¶ 4.)
See also Gilbert v. Mathews, 186 Kan. 672, 677, 352 P.2d 58 (1960), and Little v. Smith, 124 Kan. 237, 257 Pac. 959 (1927).
The difficulty with the city ordinance in question here is that it clearly and unequivocally prohibits any non-exempt person within the city limits of Junction City from having in his possession a firearm, except when he is on his own land or in his abode, fixed place of business or office. Anyone reading the ordinance could only conclude that, unless he fell within the category of exempted persons, he could not lawfully transport a firearm from the place where he purchased it or had it repaired or between his office and his home without being in violation of the ordinance. The fact that the Junction City police have taken the benign position that the ordinance should be enforced only against those who have no good reason to have a gun does not make the express language of Ordinance 12-410 any less unreasonable and oppressive. We have no doubt that the governing body of the city of Junction City can enact a valid gun ordinance, thus correcting the infirmities now existing. It is not up to the courts to engraft exceptions to legislative enactments which were not placed there by the legislative body which adopted the statute or ordinance. That is properly a legislative function and not for the courts. We have thus concluded that Junction City Ordinance 12-410(d) is constitutionally overbroad and that the district court was correct in so holding. The other sections of Ordinance 12-410 are not affected by this decision.
The judgment is affirmed.
FROMME, J., not participating.
