
8 Utah 2d 206 (1958)
331 P.2d 1099
DALLAS H. YOUNG, JR., AND JAMES W. WEBSTER, PLAINTIFFS AND RESPONDENTS,
v.
THE TEXAS COMPANY, DEFENDANT AND APPELLANT.
No. 8882.
Supreme Court of Utah.
November 20, 1958.
Christenson, Novak & Paulson, Provo, for appellant.
Young, Young & Sorensen, Provo, for respondents.
WADE, Justice.
This appeal is from a judgment on the pleadings adverse to The Texas Company.
Dallas H. Young, Jr. and James W. Webster, respondents herein, brought this suit to quiet title to certain real property located in Provo, Utah, against The Texas Company, appellant herein. From the pleadings it appeared that The Texas Company claimed an interest in the property by virtue of a lease obtained by it from respondents' predecessors in interest in January, 1955. Respondents purchased this property in 1956 subject to the lease. Respondents averred the lease was invalid and void because under the terms of the lease the lessor was to build a service station on the land and at the time the lease was to go into effect there was a zoning ordinance prohibiting the maintenance of a service station on that property.
Under the terms of the lease it was provided that the lessor should provide "any and all permits required under existing laws for the construction and/or operation of service station on demised premises * * *" and it further provided that the lessee could after notice terminate the lease if it were prevented by any law or ordinance from establishing or continuing the business of distributing petroleum products. By stipulation of counsel appellant's counsel also filed an affidavit in which he averred that at the time the lease was executed the lessors had orally agreed to "take the necessary steps to procure a change in the zoning to allow the operation of a service station upon the land in question * * *."
In view of the admission of the affidavit we shall treat the judgment as a summary judgment as provided in Rule 12 (c), U.R.C.P., to the effect that "[I]f, on a motion for judgment on the pleadings, matters outside the pleadings are presented to and not excluded by the court, the motion shall be treated as one for summary judgment. * * *" In the case of a summary judgment the party against whom the judgment has been granted is entitled to have all the facts presented and all the inferences fairly arising therefrom considered in a light most favorable to him.[1] Under this rule we will, for the purpose of this appeal, consider that it is true that respondents' predecessors in interest had agreed to obtain a change in the zoning so that a service station could lawfully be erected on the premises.
It is a well-recognized general rule that leases made with the knowledge and intent of both parties that the premises are to be used for an illegal purpose are unenforceable,[2] but it does not follow that because there is a zoning ordinance which makes the contemplated use illegal at the time the lease is executed that it is intended by the parties to use the premises for an illegal purpose where it is possible to obtain a change in the zoning ordinance so that the use can be made legal.[3] In the instant lease the parties have provided that the lessor must obtain all necessary permits which might be required for the construction of the service station contemplated being built under its terms and further provided that the lessee would have the right to terminate the lease if any ordinance or law prevented the construction or maintenance of the service station. Such provisions are consonant with an intention not to enter into an illegal contract but on the contrary contemplated that the use of the property would only be made when it could be legally done. In the absence of evidence to the contrary this is the only legitimate inference that can be made from these provisions. As stated by the court in Warshawsky v. American Automotive Products on page 818 of 138 N.E.2d, wherein a landlord recovered rent on judgment by confession; "If in the instant case both parties are presumed to have known that the proposed usage was contrary to the zoning ordinance, then the only conceivable legitimate reason for execution of the lease by defendant was the belief on its part that operation of the premises could be brought within the law or a variation obtained or a proper showing made that as to this property such usage should be permitted. * *" The law will not assume that an illegal use is contemplated where there are provisions such as are included here that the lessee could terminate the lease if the contemplated use should be frustrated because of illegality. It is to be noted that it is not unusual for zoning ordinances to be amended and provision for such is granted in Section 10-9-5, U.C.A. 1953, which provides that: "* * * The zoning ordinance, including the maps, may be amended from time to time by the legislative body after fifteen days' notice and public hearing; but all proposed amendments shall be first submitted to the planning commission for its recommendation which shall be returned to the legislative body for its consideration within thirty days."
In view of the fact that this action will have to be remanded for trial we deem it advisable to answer respondents' contention that parol evidence of a collateral agreement by the lessor to seek a variance in the zoning ordinance is inadmissible because it would vary the provisions of the written lease. The answer to that contention is that such an agreement made contemporaneously with the lease as to the accomplishment of this objective and any evidence on this subject would not vary the terms of the written lease, but would rather explain it.[4]
Reversed. Costs to appellant.
McDONOUGH, C.J., and CROCKETT and HENRIOD, JJ., concur.
WORTHEN, J., concurs in result.
NOTES
[1]  Morris v. Farnsworth Motel, 123 Utah 289, 259 P.2d 297; Abdulkadir v. Western Pac. Railroad Co., 7 Utah 2d 53, 318 P.2d 339.
[2]  32 Am.Jur., Landlord & Tenant, page 66, Sec. 48; American Law of Property, page 262, Sec. 3.43; Thompson on Real Property, page 250, Sec. 1187.
[3]  Thompson on Real Property, page 251, Sec. 1187; Stockburger v. Dolan, 14 Cal.2d 313, 94 P.2d 33, 128 A.L.R. 87; Warshawsky v. American Automotive Products Co., 12 Ill. App.2d 178, 138 N.E.2d 816.
[4]  Stockburger v. Dolan, supra.
