Opinion by
Mr. Justice Williams,The business of peddling has been treated as a proper subject for police regulation and control in this state since 1784. The legislature has forbidden it to all unlicensed persons, and has prescribed the conditions on which licenses may be obtained from the courts. The necessity for such legislation is a question for the lawmakers. The validity of any particular statute, relating to the subject, is a question for the courts. The act of 1784, and the supplementary acts relating to the business of peddling, have been held to be valid, as an exercise of the police power, in many cases, among the more recent of which are Warren Borough v. Geer, 117 Pa. 207; Borough of Sharon v. Hawthorne, 123 Pa. 106; Commonwealth v. Gardner, 133 Pa. 284; Titusville v. Brennan, 143 Pa. 642. By the organization of a city or borough within its borders, the state imparts to its creature, the municipality, the powers necessary to the performance of its functions, and to the protection of its citizens in their persons and property. The police power is one of these. Ordinances of cities and boroughs, passed in the legitimate exercise of this power, are therefore valid. An ordinance prohibiting the business of peddling within the municipal limits, without a license from the proper municipal officer, would seem to be as clearly justified by the police power as a statute prohibiting the same business throughout the commonwealth. But it is very clear that a police regulation must be directed against the business or practice that is harmful, not against one or some of the persons who may be engaged in it. The laws of the state are so framed. They are directed against the business of peddling. The ordinances of cities and boroughs must, in order to be supported as an exercise of the police power residing in the municipality, be directed in like manner at the business. If a statute, or a municipal ordinance, is in reality directed only against certain persons who are engaged in a given business, or against certain commodities, in such manner as to dis*489criminate between the persons who are engaged in the same trade or pursuit, in aid of some at the expense of others, such statute or ordinance is not a police, but a trade regulation; and it has no right to shelter itself behind the police power of the state or the municipality.
A law that should prohibit all persons peddling goods manufactured or produced in other states, and permit the same persons to peddle goods of the same character manufactured or produced in this state, would be a trade regulation discriminating between the productions of this and sister states, and would be incapable of enforcement, because in violation of the constitution of the United States. So a law that should forbid the court to grant a peddler’s license to any person resident in any other state, but should authorize the granting of licenses to citizens of this state, would be bad for the same reason. When the state creates a city or borough it cannot confer upon the municipality powers that the state does not possess. It cannot give its creature immunity from the settled limitations that bind its own action. The municipality remains a part of the state after its creation, as truly as the town or village was a part of the state before it acquired a corporate character. Only in matters of local government is its situation changed. It can have no better right to adopt discriminating trade regulations than the state has.
W e come now to consider the ordinance on which this case depends. It professes to prohibit all persons from engaging in the business of peddling or selling goods from house to house, by sample or otherwise, without a borough license, and it fixes the price of a license at a figure that makes, as it was evidently intended to make, the ordinance amount to prohibition. So long, however, as it bears upon all persons impartially, it may fairly claim to be a police regulation intended to destroy a business that was regarded as injurious; but at the end of the prohibiting section of the ordinance a proviso may be found which exempts all residents of the borough of Sayre from its operation. The proviso converts the police regulation into a trade regulation. The ordinance, taken as a whole, does not prohibit an injurious business, bnt injurious competition. That the resident dealer and peddler may enjoy a larger trade, the nonresident peddler is shut out. If the borough authorities *490may lawfully regulate the business of peddling for the benefit of residents, we see no reason why they may not lay their hands in like manner on every department of trade and of professional labor, and protect the village lawyer and doctor as well as the village grocer and peddler.
We are reminded by the appellant that this ordinance is like that which came into notice in Warren Borough v. Geer, supra; and it is urged that the question now under consideration ought, therefore, to be regarded as ruled by that case. That case was well decided on the only issue presented by it.
The plaintiff set out in the declaration the ordinance of the borough, and charged that the defendant had violated it by canvassing from house to house within the borough. The defendant demurred, thus admitting the acts charged, and denying the power of the borough to require one engaged in canvassing to take a license. The court below held that the defendant was entitled as of common right to pursue his business, and that the borough was without the power to forbid it. The question came to this court in the form that it had been disposed of in the court below, as a question of power in the borough to require a license from peddlers and canvassers, and we held that the power existed under the act of incorporation, and under the general borough law of 1851. Our brother Green, who delivered the opinion of this court, stated the point in controversy thus : “ The only question, therefore, is, whether the borough of Warren possesses, by either express grant or necessary implication, the right to enact the ordinance,” forbidding the exercise of defendant’s employment without a license. We adhere to the doctrine of that case. The present question is whether, under the pretence of police control, trade may be regulated in the interest of resident dealers by making the same business a lawful one to all who live on one side of a municipal line, and an unlawful one to all who live on the other side. We are very clear in our convictions that this cannot be done, and for this reason the judgment is affirmed.