This action was brought by the respondents as material-men, laborers, and subcontractors against the appellants, to enforce a lien for material furnished and for labor done in the construction of a dwelling-house. The appellant Howes was the owner of the real estate, and contracted with his co-defendant to construct the building, and the latter contracted with the respondents for the labor and material done and furnished by them. The contract price for constructing the building was more than one thousand dollars, and the contract was not filed for record as required by section 1183 of the Code of Civil Procedure. The respondents had actual notice that there was a contract between the owner and his contractor, and gave no notice to the owner to withhold payments to such contractor. The owner paid the contractor the greater part of the contract price. The amounts for which the respondents claimed liens exceeded the amount- due the *172contractor, and unpaid, assuming the contract to have been valid, but were less than the full contract price. The court below held the contract to be void, for the reason that it was not filed for record, and that the respondents were entitled to recover the value of the material furnished and labor done by them without any reference to the amount remaining unpaid to the original contractor by the owner. The only question presented and argued on this appeal is, whether or not a material-man or subcontractor can recover beyond the amount unpaid by the owner to the original contractor on the contract, where the same has not been recorded, and where no personal notice has been given by such material-man or subcontractor to the owner to withhold the payments due such contractor, the material-man and subcontractor having actual notice that there was such a contract.
Counsel for appellants contend, with much earnestness and ingenuity and with marked ability, that the right of the material-man and subcontractor to enforce his lien is liniited, where he lias given no personal notice to the owner, to the amount remaining unpaid by the owner to the original contractor. They contend, in substance, that, although the contract is void as between the parties to it, it is not void as to the owner and the material-men and subcontractors; that there is a distinction between an original contractor and a material-man or subcontractor, in that the former has a direct lien upon the real estate of the owner to the full extent of the amount due him, based upon the personal liability of the owner to him, while the latter have but a lien in the nature of an attachment against the money in the hands of the owners and due the contractor, and that the legislature had no power to make the owner or his property liable to any greater extent. There is, perhaps, not a single one of these propositions that- is not, to some extent, supported by some decision or dictum of this court.. *173The question is, therefore, whether these decisions or dicta are applicable to the present provisions of the mechanic’s lien law, and, if so, whether they are such as should control us in the interpretation of such provisions.
The present code, so far as it affects this question, provides: “ In case” of a contract for the work, between the owner and his contractor, the lien shall extend to the entire contract price, and such contract shall operate as a lien in favor of all persons, except the contractor, to the extent of the whole contract price; and after all such liens are satisfied, then as a lien for any balance of the contract price in favor of the contractor. All such contracts shall be in writing when the amount agreed to be paid thereunder exceeds one thousand dollars, and shall be subscribed by the parties thereto, and shall, before the work is commenced, be filed in the office of the county recorder of the county, or city and county, where the property is situated, who shall receive one dollar for such filing; otherwise they shall be wholly void, and no recovery shall be had thereon by either party thereto; and in such case the labor done and materials furnished by all persons aforesaid, except the contractor, shall be deemed to have been done and furnished at the personal instance of the owner, and they shall have a lien for the value thereof.” (Code Civ. Proc., sec. 1183.)
Again; “No payment made prior to the time when the same is due under the terms and conditions of the contract shall be valid for the purpose of defeating, diminishing, or discharging any lien in favor of any person, except the contractor, but as to such liens such payment shall' be deemed as if not made, and shall be applicable to such liens notwithstanding the contractor to whom it was paid may thereafter abandon his contract, or be or become indebted to the owner in any amount, for damages or otherwise, for non-performance of his contract or otherwise. .... All such contracts *174and alterations thereof as do not conform substantially to the provisions of this section shall be wholly void, and no recovery shall be had thereon by either party thereto; and in such case the labor done and materials furnished by all persons, except the contractor, shall be deemed to have been done and furnished at the personal instance of the owner, and they shall have a lien for the Value thereof. Any of the persons mentioned in section 1183, except the contractor, may, at any time, give to the owner a written notice that they have performed, labor or furnished materials, or both, to the contractor, or other person acting by authority of the owner, or that they have agreed to do so, stating in general terms the kind of labor and materials, and the name of the person to or for whom the same was done or furnished, or both, and the amount in value, as near as may be, of that already done or furnished, or both, and of the whole agreed to be done or furnished, or both.....Upon such notice being given, it shall be the duty of the owner to,, and he shall, withhold from his contractor, or from any other person acting under such owner, and to whom by said notice the said labor or materials, or both, have been furnished or agreed to be furnished, all money due, or that may become due, to such contractor, or other person, or sufficient of such money to answer such claim and any lien that may be filed therefor, for record, under this chapter, including costs and counsel fees provided for in this chapter, until such notice is by writing withdrawn; and all money paid thereafter by the owner to the contractor, or such other person, while such notice is in force, shall, for the purposes of all liens of all persons, except that of the contractor, be deemed a payment prior to the time the same was due within the meaning of and subject to the provisions of this section.” (Code Civ. Proc., sec. 1184.)
It has been held in a number of cases under earlier ■ statutes that a subcontractor or material-man could en*175force his lien only to the extent of the contract price remaining unpaid, and that, too, under statutes providing that subcontractors should have a lien “ regardless of the claim of the contractor against the owner,” or that the lien should inure “to the extent of the contract price,” and “ whether done or furnished at the instance of the owner or his agent,” and “that the contractor should be deemed such agent, and that the lien should not be affected by the fact that no money was due the contractor.”
Counsel for appellants have industriously gathered up and cited these earlier statutes and the .cases decided Under them. We cite them here more as showing the course of legislation and its judicial construction and interpretation on this subject than because of their bearing on the question now presented. (Stats. 1850, p. 211; Stats. 1855, p. 156; Stats. 1856, p. 203; Stats. 1858, p. 225; Stats. 1862, p. 384; Stats. 1868, p. 589; Code Civ. Proc., sec. 1183; Stats. 1887, p. 152; Cahoon v. Levy, 6 Cal. 295; 65 Am. Dec. 515; Knowles v. Joost, 13 Cal. 620; McAlpin v. Duncan, 16 Cal. 126; Bowen v. Aubrey, 22 Cal. 566; Dore v. Sellers, 27 Cal. 588; Renton v. Conley, 49 Cal. 185; Latson v. Nelson, 11 Pac. L. J. 589; Whittier v. Hollister, 64 Cal. 283; O’Donnell v. Kramer, 65 Cal. 353; Wilson v. Barnard, 67 Cal. 422; Wiggins v. Bridge, 70 Cal. 437.)
It will be observed that all of these cases, so far as they hold that the lien of a subcontractor shall only extend to the money unpaid on the original contract, are cases in which the contract between the owner and subcontractor was valid, and each and all of them are based upon the theory, which we fully approve, that where there is a valid contract between the owner and contractor, such contract is the measure of the owner’s liability, and that in the absence of notice from the subcontractor of his claim, a payment by the owner in conformity to the contract will relieve him to that extent *176from any claim or lien by the subcontractor. This is so under the present statute, and thus far the cases cited are applicable to the present statute, and no further. '
Counsel insist that there is but one additional requirement under the present statute, viz., that the contract shall be filed in the recorder’s office, and that such a requirement does not affect the principle laid down in the cases decided under former statutes, especially in this case, where it appears that the subcontractors had actual notice of the existence of the contract, which was in all respects in conformity to the statute. In this contention counsel overlook what we regard as the most material addition to the statute by the last amendment, viz., that if the contract is not executed as required by the statute, and filed in the recorder’s office, it shall be void, and no recovery shall be had thereon by either party. In onr judgment this provision of the statute takes away entirely the basis upon which it was held under earlier statutes that the subcontractor could not recover, viz., that the owner could not be compelled to pay more than he had contracted to pay, or, in other words, could not be compelled to pay twice for the same thing. This cannot be so under the present statute, where his contract is not recorded. The contract cannot be the measure of his liability, because there is no contract. He cannot pay the contractor, and thereby relieve himself from liability to the subcontractor, because the contract .being void as between him and the contractor, he is not liable to the latter, and has no right, as between him and the subcontractor, to ¡Day such contractor. The statute is too plain on this point to need construction. It not only provides that the contract shall be wholly void, and that neither party shall recover thereon, which must have been provided wholly for the protection of subcontractors, laborers, etc., but in order to make this fact doubly plain it further provides that “the labor done and material furnished by all persons aforesaid, except *177the contractor, shall be deemed to have been done and furnished at the personal instance of the owner, and they shall have a lien for the value thereof.” In other words, the subcontractors, laborers, and' material-men shall have their lien precisely as if no contract had ever been made between the owner and contractor, and the material had been furnished and work done for the owner at his special instance and request.
But counsel say the legislature had no power to provide for any such liability on the part of the owner, and that this court has so decided. We do not so understand it. It' has been held, as we have said, and very properly, that where there is a valid contract the owner cannot be compelled to pay more than he has contracted to pay, unless he is notified of the claims of subcontractors before payment to the contractor. But that is not this case. Here there was no contract. If the legislature had the power to say to the owner, If you pay the contractor after notice from the subcontractor of his claim, you shall still be liable to the latter, it has the undoubted right to say to him, If you do not execute your contract in a certain form, and file it in the recorder’s office, you shall be liable to material-men and laborers for the value of their material and labor. There is no hardship or injustice in this provision. The owner is only compelled to pay once for what he receives and retains the benefit of. He is not bound and has no right, as between him and subcontractors, to pay the contractor.
If the contract is valid, then, under the present' statute, notice must be given of his claim by a material-man or laborer, in order to reach the moneys due the contractor, and if he fails to give such notice, the owner is protected by the statute, as held in the cases above, cited, decided under former statutes. But where there is no valid contract, this notice is unnecessarjq because there are no payments to be stopped, and the statute *178itself is notice to the owner that he must not pay to the contractor.
It is urged upon us by counsel for appellants that the contract in this case was void only as between the parties to it, and not as between the owner and material-men and laborers, and that we have so decided in Giant Powder Co. v. San Diego Flume Co., 78 Cal. 193. We did not so hold in the case referred to. It was held in that case that the contract between the subcontractor and contractor for material was valid, notwithstanding the original contract was void as between the parties to it. But the opinion in that case was so worded as to mislead in this respect, and it is broadly stated that the contract, though wholly void, was not void except as to the parties to it. This could not be so. A contract wholly void is void as to everybody whose rights would be affected by it .if valid. And here it would be a strange construction of the statute to hold that the failure to file an instrument for record would render it void as to the parties to it, who necessarily have notice of its contents, and not affect the rights of the only persons sought to be protected by such filing, and who alone could be affected by such failure. The court meant nothing more in that case than to hold that the material-man was entitled to his lien, notwithstanding the contract was not filed in the recorder’s office. What was said as to the contract remaining to mark the extent of the recovery of the lien-holders, etc., was outside of the real question presented in the case, and should be modified. The extent of the material-man’s recovery is not measured by the terms of the contract. On the contrary, the statute provides, in express terms, that, where the contract is not recorded, the material-man shall have a lien for the value thereof. In case the contract is not recorded, the statute, and not the contract, measures the extent of his recovery. And so it was held in Southern California Lumber Co. v. Schmitt, 74 Cal. 625.
*179The case of Latson v. Nelson, 11 Pac. L. J. 589, is greatly relied upon by the appellant. The reasoning of the opinion in that case was not concurred in by a majority of the court, and, so far as it may be construed as against the right and power of the legislature to enact the present statute, as we have construed it in this opinion, it does not meet with our approval. It is extremely difficult to determine what the views of the learned justice who wrote the opinion were, as announced in the opinion, but as we construe his language it amounted to nothing more than has been decided in earlier cases, that where a valid contract existed between the owner and contractor, the former could not be made liable to subcontractors beyond the amount fixed therein, and that section 15 of article 20 of the present constitution had not changed that rule. So understood, the opinion is not in conflict with anything we have said in this opinion.
As to the contention that the fact that the respondents had actual notice of the existence of a contract was equivalent to the filing of the same in the recorder’s office, this would be so if the question were one of notice. But it is not. The express provision of the statute is, that if the contract is not filed, it shall be void. This being so, there is in fact no contract of which the subcontractor is bound to take notice, and his knowledge that a contract was attempted to be made, but was not, cannot affect his rights.
The point, made that there can be no recovery by a subcontractor as against the owner, independent of some contract between the owner and original contractor, is met by the express language of the statute that, for the purposes of his lien, he shall be deemed to have contracted directly with the owner, and shall have a lien for the value of his material. This brings him in direct contact with the owner as a contractor, and removes the distinction made under former statutes between those *180who contract directly with the owner and subcontractors. By the terms of the statute they become, for the purpose of their lien, original contractors with the owner, hut cannot recover against him personally. (Southern Cal. Lumber Co. v. Schmitt, supra.)
The judgment and order appealed from are affirmed.
Paterson, J., concurred.