delivered the opinion of the court:
The People of the State, on the relation of Charles Heydenreich, Henry Rynberk, Willard Ellett, Lafayette D. Jennings and Milton Huntoon, charge in a petition filed in this court that they are poor and indigent persons, citizens of Illinois and residents of the city of Chicago, and that they have applied to the respondent, Leo M. Lyons, as relief officer of the city, for the necessaries of life or the means to procure them, but that he has denied their applications, asserting he is forbidden to grant assistance by section 16. of “an act to revise the law in relation to paupers.” As amended by an act effective July 26, 1939, (Ill. Rev. Stat. 1939, chap. 107, sec. 16, p. 2383,) section 16 provides, in part: “No city, village, incorporated town, county or township required by this act to provide relief and support to residents therein shall furnish such relief or support to any person who did not reside therein for a period of three years immediately preceding his application for relief and support.” Section 17, as amended, declares: “The term ‘residence/ for the purpose of this act, shall be taken and considered to mean the city, village, incorporated town, county or town, charged with the duty of furnishing pauper relief, in which a person has made his permanent home for a continuous period of three years, preceding his becoming chargeable as a pauper.” It is alleged, further, that the respondent has predicated his refusal to furnish relief or support to them solely on the first quoted statutory provision, maintaining that no one of them has resided in Chicago for a period of three years immediately preceding his application for aid. The prayer of the petition is for a writ of mandamus commanding the respondent to place the names of the relators on the relief roll of the city and to relieve, support, or employ them, provided that he shall find they are otherwise eligible for relief, support or employment. The respondent interposed a motion in the nature *560of a demurrer to dismiss the petition and upon these pleadings the cause is submitted. While there are facts in the five particular cases which tend to indicate that the relators comply with the requirements of the statute in that they are residents of the State and the particular municipality, nevertheless, counsel asks us to base our opinion solely upon a proposition of law, namely, the constitutionality of the amendatory enactment which appears as section 16 of the statute.
Of the five relators, Heydenreich, fifty-seven years of age, was born in Chicago and has been domiciled there his entire life with the exception of seven months, commencing in the summer of 1937 and continuing until April, 1938, when he was employed in the city of Capac, Michigan. He went to Capac because of his inability to obtain employment in Chicago and, when his work terminated in Michigan and he was unable to find other employment, returned to his-home where he has since resided. Rynberk was born in Chicago forty years ago and has been continuously domiciled in the city with the exception of eight months, from June, 1939, to February, 1940, when he went to Oak Forest, in Cook county, because of his wife’s impaired health and in order to pursue his occupation of interior decorator. Neither Rynberk nor his wife have ever resided outside the State, and, so far as the record discloses, beyond the boundaries of Cook county. The third relator, Ellett, thirty years old, was born in McLeansboro, Illinois. Thereafter, he went to Potomac where he lived and worked as a tenant-farmer for thirteen years. He then came to Chicago where he obtained and for two years pursued employment promised him by a friend. He was next employed by a steel company in Chicago until March, 1940, when he was laid off. With the exception of one week in May, 1940, when he returned to Potomac endeavoring to find work, Ellett has not been away from Chicago subsequent to November, 1937. Jennings, a native of Missouri, now fifty-six years of age, *561came to Chicago approximately thirty years ago and since then has never resided outside of Cook county. He and his wife lived in Chicago until 1928 when they moved to Brookfield. Subsequently, in 1931, they moved to Cicero where they resided until August, 1938, when they returned to Chicago. It further appears that Ellett was at one time a property owner and paid real estate taxes in Cook county for approximately fifteen or sixteen years. The fifth relator, Huntoon, was born in Evanston, in Cook county, in 1890, and lived there until December, 1936, when he went to Portland, Oregon, in search of work. Failing in his efforts to obtain employment there, the Portland relief authorities returned him to Cook county in June, 1937. He has since lived in Chicago where he had resided for almost three years immediately prior to the filing of the petition.
The respondent maintains that the relators have not resided in Chicago, within the contemplation of the applicable statutory provision, for three years, immediately preceding their applications for relief and support. Insisting that it was their duty to seek employment wherever there was a reasonable prospect of finding it, even if beyond the limits of the city, county or State of their residence, the relators contend that in leaving Chicago within the three-year period described as a condition of eligibility to relief and support, they were acting in the exercise of their constitutional guaranties. Accordingly, the relators assail section 16 on the grounds that it is discriminatory legislation not based upon any reasonable classification of the persons affected and, hence, transcends sections 1 and 19 of the Illinois constitution, the due process clauses of both the Federal and State constitutions, the equal protection of the laws guaranty of the fourteenth amendment to the Federal constitution, and also section 22 of article 4 of our own basic law. The respondent maintains, on the other hand, that section 16 is a valid exertion of the police power, and not vulnerable to the constitutional objections interposed.
*562It is settled that the police power may be exercised not only in the interest of the public health, morals, comfort and safety, but also for the promotion of the public convenience or the general welfare. (Triner Corp. v. McNeil, 363 Ill. 559; Fenske Bros. Inc. v. Upholsterers Union, 358 id. 239.) The General Assembly is vested with a large discretion in determining what measures are necessary to promote the public welfare, and such statutes are upheld, if possible, being declared invalid only when the legislature exceeds its power. (People v. City of Springfield, 370 Ill. 541.) The support of paupers is, admittedly, an accepted exercise of valid authority under the police power in promotion of the general welfare. (Town of Fox v. Town of Kendall, 97 Ill. 72; In re Opinion of the Justices, 85 N. H. 562, 154 Atl. 217.) This court, long ago, in County of McLean v. Humphreys, 104 Ill. 378, observed: “It is the unquestioned right and imperative duty of every enlightened government, in its character of parens patriae, to protect and provide for the comfort and well-being of such of its citizens as, by reason of infancy, defective understanding, or other misfortune or infirmity, are unable to take care of themselves. The performance of this duty is justly regarded as one of the most important of governmental functions, and all constitutional limitations must be so understood and construed as not to interfere with its proper and legitimate exercise.” There is, as respondent claims, and as the relators, in reply, concede, no constitutionally imposed obligation upon the State of Illinois or any local governmental unit to support poor persons. Nor is there a common law obligation upon any governmental unit to support the poor and destitute. In short, no legal obligation, in the absence of a statute creating the duty, rests upon either the State government or local units to relieve those in necessitous circumstances. (Cerro Gordo County v. Boone County, 152 Iowa, 692, 133 N. W. 132; Patrick v. Town of Baldwin, 109 Wis. 342, 85 N. W. 274; Town of *563Morristown v. Town of Hardwick, 81 Vermont, 31, 69 Atl. 152; State v. Burns, 132 Neb. 31, 270 N. W. 656; City of Auburn v. Inhabitants of Town of Farmington, 133 Me. 213, 175 Atl. 475.) As was pointedly observed in Town of Holland v. Village of Cedar Grove, 282 N. W. (Wis.) 111 : “The whole matter of poor relief is of statutory origin. * * * That was true at common law and is still true although relief has been furnished under statutory provisions so long that in the minds of the general public it is now regarded as a municipal duty.” The State may, of course, voluntarily assume the humanitarian obligation of supporting its needy citizens or impose the duty upon local governmental units. (Town of Fox v. Town of Kendall, supra; State v. Burns, supra.) The issue thus presented is not whether the State is constitutionally bound to provide for the relief of the needy but is, instead, whether the challenged statute, based on the exercise of its police power to provide for the relief of the poor, satisfies constitutional tests.
The legislative determination as to what is a proper exercise of the police power is not necessarily conclusive. Whether the means employed have any real, substantial relation to the public health, comfort, safety or welfare, or are essentially arbitrary and unreasonable, is a question which is subject to judicial review. (Carolene Products Co. v. McLaughlin, 365 Ill. 62; Triner Corp. v. McNeil, supra.) The extent of relief granted and the circumstances incident thereto, such as the place and the agencies by which poor persons shall be relieved at the expense of the public, are primarily legislative questions. (Patrick v. Town of Baldwin, supra; Town of Fox v. Town of Kendall, supra.) The North Dakota Supreme Court, in Mandan Deaconess Hospital v. Sioux County, 248 N. W. 924, said: “The function of providing for relief at the expense of the public is essentially a legislative function, and it is the duty of the courts to give effect to the intention expressed in legislation.” *564Unless the statutory condition that a person destitute and in necessitous circumstances be a resident of a designated local governmental unit for a period of three years, imposed as a condition precedent to obtaining relief, is an unreasonable exercise of the police power, it must stand.
Relators’ principal complaint is that the amendatory act of 1939 is discriminatory, first, because of the requirement of three years’ consecutive residence in a particular governmental unit, and, secondly, from the requirement that the requisite residence immediately precede the application for relief and support. Neither of these requirements, it is argued, bears a reasonable relation to the object of the statute. The argument is based upon the premise that section 16 denies assistance to a group of Illinois citizens who have diligently sought to obtain work even though their efforts took them temporarily to other communities and States and, at the same time, grants aid to another group, similarly situated but who have remained idle and stationary in one community. Based upon the fallacious premise that section 16 prohibits relief being furnished upon the basis of an equality of right, the argument must fall. The constitutional guaranty of equal protection of the laws is interposed against discriminations that are purely arbitrary. The fourteenth amendment does not purport to prevent a State from adjusting its legislation to differences in situation and to that end to make a justifiable classification. It merely requires that the classification shall be based on a real and substantial difference having a rational relation to the subject of the particular legislation. (Nebbia v. New York, 291 U. S. 502; Royster Guano Co. v. Virginia, 253 id. 412; People v. Ladwig, 365 Ill. 574; Michigan Millers Ins. Co. v. McDonough, 358 id. 575; People v. City of Chicago, 337 id. 100.) The classification need not, however, be accurate, scientific, logical or harmonious, so long as it is not arbitrary and will accomplish the legislative design. (Punke v. Village of Elliott, 364 Ill. 604; Stewart v. Brady, *565300 id. 425.) In particular, the classification of beneficiaries such as paupers, while not only permissible, but also necessary, must none the less be reasonable. (In re Opinion of the Justices, supra.) The judiciary will not interfere with such classification when made unless it is clearly unreasonable. Punke v. Village of Elliott, supra.
Supplementing the equal protection provision of the fourteenth amendment, section 22 of article 4 of the constitution of this State prohibits the passage of a special law granting to any corporation, association or individual any special or exclusive privilege, immunity or franchise whatever. The purpose of this provision has been held to be the prevention of the enlargement of the rights of one or more persons and the impairment of or discrimination against the rights of others. To avoid falling within the constitutional inhibition of local legislation, the classification of subjects or objects must be based upon some reasonable and substantial difference in kind, situation or circumstance bearing a proper relation to the purposes to be attained by the statute. Triner Corp. v. McNeil, supra; Michigan Millers Ins. Co. v. McDonough, supra.
Since there is no legal obligation upon the State, or any governmental unit, in the absence of legislative action, to support its poor, it follows, necessarily, that a large degree of discretion rests upon the State when it elects to furnish relief. The Pauper’s act has long imposed a burden upon local governments which, in recent years, has become increasingly heavy. The enactment under consideration reflects the attempt of our General Assembly to ameliorate the burden by reducing it to the care of those individuals who have resided a minimum of three years in a particular governmental unit. The manifest legislative intent is to furnish relief to residents of local communities who, by reason of unemployment or otherwise, are destitute and in necessitous circumstances. Section 16 thus mirrors an intention to assure relief to such citizens by discouraging a *566steady influx of unfortunate transients from other jurisdictions settling in Illinois for the primary purpose of qualifying as future recipients of the State’s benevolence. Apparently, the legislature concluded that the absence of any restrictions as to residence, or a less onerous requirement, might induce unemployed residents of and destitute persons from other States to avail themselves of the more generous provisions of our laws. In short, section 16 as amended in 1939, represents a legitimate attempt to prevent Illinois and our local governmental units from becoming a haven of the transient poor seeking the most advantageous statutory provisions granted those requiring assistance and, perhaps, thereby reducing the aid to which permanent residents of Illinois should justly have first claim. It cannot be said as a matter of law that the period of residence bears an unreasonable relation to the subject of poor relief.
To construe the statute so as to preclude a temporary departure from the particular governmental unit by persons who have long resided there would impute a harsh and unconscionable intent to the legislature. Residence for a period of three years immediately preceding an application for relief and support does not mean, and the law does not so ordain, that the applicant actually reside each day during the prescribed period in the governmental unit in order to be eligible for relief. The question of residence, this court has many times announced, is largely a matter of intention. (Park v. Hood, 374 Ill. 36; Bullman v. Cooper, 362 id. 469; Town of Dorr v. Town of Seneca, 74 id. 101.) Determination of whether a particular applicant for relief meets the residence qualifications of sections 16 and 17 necessarily requires an inquiry into the facts and circumstances, including the applicant’s own expressed intent, pertinent to the fact of actual residence. A “residence” or “settlement” for poor relief purposes once acquired is not necessarily lost or defeated by a voluntary absence for the purpose of obtaining work. Conformably to the plain legis*567lative intent to grant relief to Illinois citizens in preference to and to the exclusion of non-residents, we hold that the only classification made is a class of our own citizens who have resided three years in a particular subdivision of Illinois as provided by the statute, on the one hand, and a second group who have lived in such subdivision less than three years, and, further, that the classification bears a reasonable relation to the purpose for which it was made. A contrary construction would tend to defeat the benevolent purpose of the poor relief law. The wisdom of the requirement, obviously, rests with the General Assembly, and, if persons deeming themselves aggrieved by section 16 feel a shorter period is desirable resort must be had to the legislature and not to the courts.
From the pleadings before us it appears that some of the five relators may satisfy the requisite conditions of residence. Although alleging that no one of them lost his residence or domicile in Chicago, in Cook county, or the State of Illinois, when they made temporary departures from Chicago, as claimed by the respondents, the relators, nevertheless, in their motion for leave to file their petition for mandamus asserted that because of the difficulty and doubt attending the questions of law and fact incident to the issue of legal residence, “they therefore rest their case, in this proceeding, on the invalidity of the said amendment.” Their counsel, upon the oral argument, likewise announced that the relators’ case in this court was based solely on the asserted unconstitutionality of section 16. The question before us is one of law only, and not of fact. Even though one or more relators may be entitled to be placed on the relief roll of the city of Chicago, the prayer of the petition cannot be granted because they do not here claim to be entitled to the benefits of the statute assailed. The writ of mandamus is a summary writ issued from a court of competent jurisdiction commanding the officer or officers to whom it is addressed to perform some public duty which *568the relator is entitled of right to have performed and which the party owing the duty has failed to perform. One who petitions for the writ must show that he has a clear right to the relief which is demanded. (People v. Nelson, 349 Ill. 193.) This, the relators’ petition for the writ of mandamus failed to do.
The motion in the nature of a demurrer to dismiss the petition is sustained and the writ of mandamus denied.
Writ denied.