The petitioner is confined in the workhouse of the city of St. Louis, and in his petition sets forth such grounds as make a prima facie case, and accompanies the petition with a copy of the . original complaint and order of commitment.
It appears from the return made to our writ of habeas corpus by Nicholas Karr, superintendent of the workhouse, that he holds petitioner by virtue of two executions issued and delivered to the marshal of the city of St. Louis on the twenty-ninth day of April, 1896, by the clerk of the first district police court; one of said executions being for the sum of $10, with $3 costs, and the other for the sum of $500 with $3 costs, and copies of said executions were subsequently delivered on the same day by the marshal to the superintendent of the workhouse, which said executions were based on two judgments rendered against petitioner for infractions of certain ordinances of the city of St. Louis.
The execution for the smaller sum need not be discussed, since the validity of the ordinance on which it is grounded stands unquestioned. But it is necessary just here, however, to say that under the ordinances of the city of St. Louis, a prisoner committed to the workhouse is allowed to work out his fine and costs at fifty cents per day, and is charged meanwhile thirty cents per day for his board. Rev. Ord. 1887, chap. 47, *226secs. 1772, 1760. So that petitioner’s time under the smaller execution will last sixty-five days, - and will expire on July 3, 1896.
The status of petitioner under his imprisonment based on the larger execution is now to be considered. That execution issued on a judgment of the first district police court, rendered on a complaint or report made and preferred by L. Harrigan, chief of police, which complaint is founded on the eighth clause of section 1033, article 6, chapter 25, Revised Ordinances, 1887, which is the same as the like clause in section 1062, Revised Ordinances, 1892, article 6, chapter 26, page 889. This eighth clause is apart of what is known as the ordinance respecting vagrants, and it forbids anyone knowingly to associate with persons having the reputation of being thieves, burglars, pickpockets, pigeon droppers, bawds, prostitutes, or lewd women, or gamblers,.* or any other person, for the purpose or with the intent to agree, conspire, combine, or confederate, first, to commit any offense, or second, to cheat or defraud any person of any money or property, etc., etc.
This ordinance is now attacked on the ground of its unconstitutionality in that it invades the right of personal liberty by assuming to forbid that any person should knowingly associate with those who have the reputation of being thieves, etc. And certainly it stands to reason that if the legislature, either state or municipal, may forbid one to associate with certain classes of persons of unsavory or malodorous reputations, by the same token it may dictate who the associates of anyone may he. But if the legislature may dictate who our associates may be, then what becomes of the constitutional protection to personal liberty, which Blackstone says “consists in the power of locomotion, of changing situation, or moving one’s person *227to whatsoever place one’s own inclination may direct, without imprisonment or restraint, unless by due course of law?” 1 Bl. Com. 134. Obviously, there is no difference in point of legal principle between a legislative or municipal act which forbids certain associations and one which commands certain associations. We deny the power of any legislative body in this country to choose for our citizens whom their associates shall be.
And as to that portion of the eighth clause which uses the words, “for the purpose or with the intent to agree, conspire, combine, or confederate, first to commit any offense,” etc., it is quite enough to say that human laws and human agencies have not yet arrived at such a .degree of perfection as to be able without some overt act done, to discern and to determine by what intent or purpose the human heart is actuated. So that did we concede the validity of the former portion of the eighth clause, which we do not, still it would be wholly impracticable for human laws to punish or even to forbid improper intentions or purposes. For with mere guilty intention, unconnected with overt act or outward manifestation, the law has no concern. Howell v. Stewart, 54 Mo. loc. cit. 404.
In St. Louis v. Fitz, 53 Mo. 582, the ordinance in question, then known as the ninth clause (sec. 1, art. 4, chap. 20, Rev. Ord. 1871), was like the present one down to the * just after the word “gamblers,” but did not contain the words “for the purpose or with the intent to agree,” etc., etc. But in that case, however, the ordinance was so amended by judicial construction, as to be held valid and afterward the common council, acting upon that hint, conformed the ordinance to such construction so as to supply the words therein indicated, to wit, “for the purpose or with the intent to agree, conspire,” etc., etc., etc.
*228But notwithstanding such emendations and additions as aforesaid, this court in the quite recent case of St. Louis v. Roche, 128 Mo. 541, held the eighth clause, in so far as heretofore quoted, invalid on the distinct ground that it invaded the constitutional right of personal liberty, and Fitz’s case was overruled.
It has been urged that we can not in habeas corpus-proceedings investigate and question the constitutionality of an act upon whose provisions a person .has-been tried and convicted; but we think otherwise In Ex parte Siebold, 100 U. S. 371, it is well said that,, “an unconstitutional láw is void, and is as no law. A conviction under it is not merely erroneous, but is. illegal and void, and can not be a legal cause of imprisonment.” Formerly the courts were disinclined to. look into the constitutionality of a statute in habeas-corpus proceedings to determine whether a person was. lawfully convicted, but since the decision already quoted from, the state courts have fallen into the now-prevalent practice of entertaining jurisdiction of such, proceedings for the purpose mentioned. Church, Hab. Corp. [2 Ed.], sec. 83, and cases cited, note 2; Ib., secs. 245a, 325, 349, 351, 352, and cases cited.
In Ex parte Boenninghausen, 91 Mo. 301, it was. indeed ruled that the constitutionality of an ordinance, where a-person has been convicted thereunder, will not. be tested by habeas corpus proceedings. But in that case an earlier one in the same volume was overlooked' ' in which on habeas corpus proceedings a party attached for contempt was discharged on the ground that the-statute under which he acted was constitutional. Ex parte Marmaduke, 91 Mo. 228.
In Ex parte Swann, 96 Mo. 44, the constitutionality of the local option law was tested after conviction and judgment by habeas corpus, and the petitioner-remanded.
*229So, too, in a much, later case,, a negro had been arrested and adjudged a vagrant under the provisions of sections 8846, 8848, 8849, Revised Statutes, 1889, and on application to this court he was discharged on habeas corpus, because of the statute being held unconstitutional. In re Thompson, 117 Mo. 83.
So that it may now be regarded as the established doctrine of this court that it will interfere by means of the writ of habeas corpus to look into and investigate the constitutionality of a statute or ordinance on which a judgment which results in the imprisonment of a petitioner is founded.
And if it be true, as must be true, that an unconstitutional law is no law, then its constitutionality is open to attack at any stage of the proceedings and even after conviction and judgment; and this upon the ground that no crime is shown and therefore the trial court had no jurisdiction; because its criminal jurisdiction extends only to such matters as the law declares to be criminal, and if there is no law making such declaration, or, what is tantamount thereto, if that law is unconstitutional, then the court which tries a party for such an assumed offense, transcends its jurisdiction and he is consequently entitled to his discharge, just the same as if the nonjurisdiction of such court should, in any other manner, be made apparent.
Under the sentence imposed of afine of $10 and $3 costs on petitioner he will have to remain in the workhouse for sixty-five days, which will expire on July 3, 1896.
Under the sentence imposed by the • $500 fine and the $3 cost, petitioner would have had to remain in the workhouse for two thousand, five hundred and fifteen days, or six years, ten months and twenty-five days, a longer period than he would, have to remain in the penitentiary for the commission of many felonies.
*230Inasmuch, however, as we hold that sentence invalid because of the unconstitutionally of the ordinance heretofore quoted, we order that, on expiration of the time required to satisfy the $10 fine and costs, petitioner be discharged from the workhouse.
All concur.