Opinion by
Mr. Justice Brown,The mechanic’s lien Act of June 16, 1836, P. L. 696, provides that a building “ shall be subject to a' lien for the payment of all debts contracted for work done, or materials furnished for, or about, the erection or construction of the same.” By the Act of April 14, 1855, P. L. 238, entitled a supplement to the act of 1836, the provisions of that act are extended to plumbing, gas fitting and furnishing and erection of grates and furnaces. The Act of June 15, 1897, P. L. 155, amends the act of 1855, by further extending the provisions of the act of 1836, to gas fixtures, and by this last act, to' be read in connection with the act of 1836, every building is made subject to the lien of a debt “ contracted ” for gas fixtures furnished to it. The question now before us is whether the appellee, The Horn & Brannen Manufacturing Company, which furnished gas fixtures for a building after the passage of the act of 1897, under á contract to do so entered into before the act was passed, has a right to file a mechanic’s lien for the materials so furnished.
The words of the act of 1836 are that a building “ shall be subject to a lien for the payment of all debts contracted for ” materials furnished to it. On this appeal counsel for appellee labor to show that, prior to the passage of the act of 1897, no *189contract had been entered into between it and Steelman, the owner and contractor, to furnish the gas fixtures, and therefore the act, if it is only prospective in its operation, protects their client. We are at a loss to understand how this position can be seriously taken, in view of what appears in the record. A part of the stipulation referring the case to the referee is a distinct admission by the appellee that a contract was entered into between it and Steelman prior to the passage of the act of June 15, 1897, to furnish the material which is the subject of this lien. That portion of the stipulation is as follows: “ Whereas, prior to the passage and approval of the act of assembly of June 15, 1897, extending the provisions of the mechanics’ lien law to plumbing, gas fitting, and furnishing and the erection of grates and furnaces, gas fixtures, electric-light fixtures and wiring, the defendant proposed to the plaintiff to have it furnish the work, materials and gas fixtures for the buildings against which the above liens were filed, and that said plaintiff agreed to accept such proposition to so furnish them.” On the trial before the referee the first witness called by the plaintiff testified as follows : “ Q. Was there ever any written contract between you? A. No; only our estimate. Q. Was there any written acceptance of that estimate? A. I don’t think there was. I could not find any at our office. Q. Was there or was there not ? A. There must have been. He would come in from time to time to get the fixtures.” The referee found as a fact that “prior to June 15, 1897, the defendant proposed to plaintiff that it furnish and set up in the respective houses which were in course of erection or completion the gas fixtures specified in the lien filed, at the prices named therein, and prior to the said date the plaintiff accepted also the said propositon. The fulfillment by the plaintiff of the contract so made was not effected by the delivery of the said gas fixtures until after the fifteenth day of June, 1897.” Having been of opinion that the act of 1897, was not retroactive and applied only to debts contracted after its passage for materials furnished for or about the erection or construction of a building, he reported that judgment ought to be entered for the defendant. In disposing of the exceptions by the appellee to this report, the court below, sustaining the contention that the lien was within the protection of the act, said the question was *190“ whether the Act of June 15, 1897, P. L. 155, extending the right to file a mechanic’s lien to persons supplying gas fixtures and other appliances mentioned in the act, gave a right of lien where the goods were contracted for before the passage of the act, but delivered to the building after the passage and approval of the act.” Referring to the testimony in the case, the learned judge delivering the opinion of the court stated that the claimant had made a contract before the passage of the act to supply the gas fixtures for which the lien was filed. Clearly the contract out of which the indebtedness to the appellee has arisen was .made before the passage of the act of 1897, and must be so considered in determining the question before us.
The right to file a mechanic’s lien must have a contract as its basis or foundation. “ The claims of workmen and material-men do not become liens on a house from the mere fact that the work was done or the materials found for its erection, for they must be founded on a contract, express or implied, direct or indirect, with the owner of the estate sought to be charged. The lien law of 1886 provides only for ‘ debts contracted ’ for work and materials: ” Harlan v. Rand, 27 Pa. 511. This is reaffirmed in Owen v. Johnson, 174 Pa. 99. The rights of these parties were fixed by their contract, made prior to the passage of the act of 1897. What were these rights ? On the one hand, the appellee bound itself tó furnish the gas fixtures to Steelman on his personal responsibility, and for its failure to do so, his right was to hold it responsible for any damages resulting from a breach of its contract; on the other hand, he bound himself to pay for these fixtures, and, for his failure to do so, the right of the appellee would have been to sue him for what he owed. The rights of each of these contracting parties were such, and such only, as existed at the common law at the time they contracted and as if there had been no mechanic’s lien law. And yet Brannen testified that the goods were sold, not on the credit of Steelman, but on the credit of the building. This witness may have intended to testify truthfully, but what he stated was legally an untruth, for at the time the contract was made there was no law in existence giving his company a right to hold the building for what it agreed to furnish.
But the contention of the appellee, sustained by the court below and the Superior Court, is that the delivery of the goods *191upon the faith and credit of the building fixed the right to file the lien, and as it took place after the passage of the act, such right existed. In so holding, both courts overlooked the words of the act of 1836. The right of lien does not arise or grow out of the furnishing or delivery of the materials, but out of the debt contracted for them. The debt here was contracted before the passage of the act. There was only one time when it could be contracted, and that was when Steelman contracted with the appellee to buy its goods. The debt then arose, though payment of it could not be enforced until afterwards — until the appellee had furnished the goods which it agreed to furnish. But in that contract there was involved no right on the part of the appellee to file a lien, for there was then no law giving it such right. If the materials that it agreed to furnish had been within the mechanic’s lien laws then in existence, the contract would have given it a right to file a lien. It would have acquired such a right at the same time that Steelman created an indebtedness to it; but such right could not have been exercised until the materials had been delivered. The distinction between the time when a right of lien is acquired and when it can be exercised was overlooked by both courts, and in so overlooking it the error was committed which we must correct.
As the rights of the parties were such only as existed under the contract made before the passage of the act of 1897, do its terms apply to them ? This is easily answered, for there is nothing in the words of the act of 1836, to which the act of 1897 is but a supplement, extending the right to file a lien for gas fixtures, to justify the belief that it was intended by the legislature to act retroactively. “ Nothing short of the most indubitable phraseology is to convince us that the legislature meant their enactment to have any other than a prospective operation: ” Dewart v. Purdy, 29 Pa. 113. “ We always construe statutes as prospective and not retrospective, unless constrained to the contrary course by the rigor of the phraseology: ” Price v. Mott, 52 Pa. 315. It is hardly necessary to cite any of the many cases announcing this rule, and reference will be made to but one. “ There is no canon of construction better settled than this, that a statute shall always be interpreted so as to operate prospectively and not retrospec*192tively, unless the language is so clear as to preclude all question as to the intention of the legislature: Neff’s Appeal, 9 Harris, 248; Fisher v. Farley, 11 Id., 501; Becker’s Appeal, 3 Casey, 52. Lord Bacon expressed concisely the same rule: Ñeque enim placet Janus in legibus. Retrospective laws generally if not universally work injustice, and ought to be so construed only when the mandate of the legislature is imperative: ” Taylor v. Mitchell, 57 Pa. 209. Applying this settled rule of construction to the act of 1897, its provisions can apply only to debts for materials contracted for after its passage. The wisdom of this rule manifests itself in the effort of the appellee to have it disregarded in this case. The appeal from the judgment of the Superior Court was allowed on the petition of Thomas D. Andress, who purchased the building from Steel-man. He may have purchased it before the passage of the act of June 15, 1897, after its erection, but before the gas fixtures were furnished to it, and, if so, it was necessary for him to protect himself only against such mechanics’ liens as could be filed against the building under the statutes then existing. At that time he would have known that no lien could be placed on it for gas fixtures furnished or to be furnished, but, with the act given a retrospective operation and taking in the contract of Steelman, he might have to pay for what at the time he purchased the property could not, under the laws then in existence, have become a lien upon it.
In Best v. Baumgardner, 122 Pa. 17, the question raised on this appeal was not passed upon by the court, and what was said by Greek, J., in overruling the constitutional objection to the act of 1887, is not to be regarded as in conflict with the views expressed in this opinion.
The judgment of the Superior Court is reversed, as is that of the common pleas, and the record is remitted with direction that judgment be entered for the defendant in accordance with the report of the referee.