Opinion by
Mr. Justice Potter,
By the Act of June 1,1915, P. L. 670, Section 1, the following was added to Section 1402 of the School Code (Act of May 18,1911, P. L. 309) : “Provided, that where any orphans’ home or other institution which furnishes free support for children of school age owns' contiguous real estate, which is situate in two or more school districts, all pupils having a residence on such real estate shall have the right (irrespective of where the dwelling house or other buildings may be located) to attend the public schools in any of the school districts in which any part of such real estate may be situate.”
The court below held that this act was a special law and unconstitutional, because, as he said in his opinion, “it gives to children who are inmates of orphans’ homes, &c., rights which no other children in the State outside of the homes have. They are given the choice of attending school in any district in which the home of which they are inmates owns contiguous real estate which is situate in two or more districts, irrespective of where the dwelling house or other buildings are located......The provisions of this section do not apply to all members of the class, the subject-matter of the legislation, to wit: school children, but they apply to persons of a class, to wit: children of orphans’ homes, &c. It gives to the children of orphans’ homes,. &c., a right not enjoyed by the other children of the Commonwealth similarly located.” We think the position of the court below is well taken. In Com. v. Casey, 231 Pa. 170, where an act limiting the hours of mechanics, workingmen and laborers employed by the State or by municipal corporations, or en*70gaged on public works, was pronounced unconstitutional as special legislation, Mr. Justice Stewart said: “In the matter of legislative classification, regard is always to be bad to the subject to which it relates. Notwithstanding the act embraces all of a particular class, yet if the subject is one not within the purposes of classification, the law is special. Such is the doctrine of our cases, especially emphasized and expounded in Ayars’ App., 122 Pa. 266, and In re Wyoming Street, 137 Pa. 494......The basis of all classification is a difference in conditions. When difference ill conditions exists to an extent that certain political subdivisions would be oppressed by general laws required for the welfare or convenience of certain other subdivisions, classification may be resorted to, to provide proper legislation for each. When no such difference exists, classification is never allowed.” In Ayars’ App., 122 .Pa. 266, a leading case on the subject, Mr. Justice Sterrett said (p. 281) : “The underlying principle of all the cases is, that classification, with the view of legislating for either class separately, is essentially unconstitutional, unless a necessity therefor exists, — a necessity springing from manifest peculiarities, clearly distinguishing those of one class from each of the other classes, and imperatively demanding legislation for each class, separately, that would be useless and detrimental to the others.” In the recent case of Chalmers v. Philadelphia, 250 Pa. 251, we said (p. 254) : “In the absence of real and genuine distinctions, classification is not permitted. This is the settled doctrine of our cases.” And on p. 256: “Between those who stand in the same relation to the law, there can be no discrimination. The operation of a rule must extend to all the members of the class to which it fairly applies, without unnecessary exemption or restriction. In White on the Constitution of Pennsylvania, 252, the rule is well stated as follows: ‘Even though the subject of the legislation is such that separate laws for separate classes are demanded, if the class to which it applies is unnecessarily *71restricted or improperly selected, still the law is special, since a more enlarged class or other Objects similar in character should also have had the benefit of its remedial force.’ ” And on p. 257: “The act also discriminates, to a certain extent, between persons engaged in the same trade or pursuit in the same' city. No substantial difference in conditions appears which seems to be sufficient to constitute ány real or genuine basis for classification in this respect.” So in the Act of 1915 now before us there is an attempt to segregate, and place in a class by themselves, school children who are inmates of orphans’ homes which own contiguous real estate in two or more districts. It is apparent that a distinction in this respect between such children and the other school children of the Commonwealth, cannot be based upon .real or genuine differences, but is merely arbitrary. While the act is drawn in general terms, it is evidently intended to apply to a particular and very unusual case. The class which it attempts to create is so limited that it does not embrace all children in orphans’ homes, nor does it include all such homes; it includes only the inmates of homes which own contiguous pieces of real estate, situated in two or more school districts. The restriction is unnecessarily narrow, and the difference in conditions of the children in the orphans’ homes to which the privilege is extended, and in those from which it is withheld, is not substantial enough to warrant the classification attempted. The law therefore is special. The statute is also objectionable from the standpoint of the school districts, in that it attempts to classify them in a'purely arbitrary way. Contiguous districts having within their limits orphans’ homes, owning real estate situated partly in each district, are subjected to a liability from which other districts are exempt.' No genuine basis for such a distinction, so narrowly restrictive, is apparent.
The assignments of error are overruled, and the order of the court below, refusing a writ of mandamus, is affirmed.