
141 Cal.App.3d 952 (1983)
190 Cal. Rptr. 599
KAREN A. LUM, Petitioner,
v.
THE SUPERIOR COURT OF FRESNO COUNTY, Respondent; ROY O. KROEKER, Real Party in Interest.
Docket No. 7653.
Court of Appeals of California, Fifth District.
April 15, 1983.
*953 COUNSEL
Lerrigo, Walters, Nibler, Moss & Berryman, C. Richard Walters and Catherine Adams Bennett for Petitioner.
No appearance for Respondent.
*954 Glynn, Harvey & Tosney, Kiernan & Finnegan and Barbara A. Bodager for Real Party in Interest.
OPINION
BROWN (G.A.), P.J.
In this case the court is asked to decide whether a statutory offer to compromise made pursuant to Code of Civil Procedure section 998 may be withdrawn before the expiration of the time limits provided in the statute. We hold that the offer must be left open for the periods provided.
Petitioner, Karen A. Lum, sued Roy O. Kroeker for personal injuries. Pursuant to Code of Civil Procedure section 998, defendant Kroeker served petitioner Lum's attorney with an offer to compromise the claim for $25,000. The offer was received by mail on October 25. Later on the same day, at a settlement conference, the offer was verbally withdrawn and the court orally approved the withdrawal. The withdrawal was confirmed by a letter sent by defendant Kroeker's attorney. Lum's attorney received this letter on November 1. Lum had filed a formal acceptance of the offer on October 28.
Lum thereafter moved to vacate the court's order approving the withdrawal of the offer and for summary judgment. The court denied the motions. This petition for mandate followed.

DISCUSSION
Code of Civil Procedure section 998 provides in pertinent part: "(b) Not less than 10 days prior to commencement of the trial ... any party may serve an offer in writing upon any other party to the action to allow judgment to be taken in accordance with the terms and conditions stated at that time. If such offer is accepted, the offer with proof of acceptance shall be filed and the clerk or the judge shall enter judgment accordingly. If such offer is not accepted prior to trial or within 30 days after it is made, whichever occurs first, it shall be deemed withdrawn, and cannot be given in evidence upon the trial.
"(c) If an offer made by a defendant is not accepted and the plaintiff fails to obtain a more favorable judgment, the plaintiff shall not recover his costs and shall pay the defendant's costs from the time of the offer...." The section further provides that the court has the discretion to order the plaintiff to pay defendant's costs from the date of filing the complaint and to include the reasonable costs of expert witnesses.
(1a) The cardinal rule of statutory construction is to ascertain the intent of the Legislature so as to effectuate the purpose of the statute. All rules of construction *955 are subject to this controlling principle. (Code Civ. Proc., § 1859; Friends of Mammoth v. Board of Supervisors (1972) 8 Cal.3d 247, 259 [104 Cal. Rptr. 761, 502 P.2d 1049]; Select Base Materials v. Board of Equal. (1959) 51 Cal.2d 640, 645 [335 P.2d 672].)
A solid line of cases has construed the purpose of section 998 as being to encourage settlements. (2) "The purpose of this section is to encourage the settlement of litigation without trial. [Citation.] Its effect is to punish the plaintiff who fails to accept a reasonable offer from a defendant." (Brown v. Nolan (1979) 98 Cal. App.3d 445, 449 [159 Cal. Rptr. 469]; see also Wear v. Calderon (1981) 121 Cal. App.3d 818, 821 [175 Cal. Rptr. 566]; Pineda v. Los Angeles Turf Club, Inc. (1980) 112 Cal. App.3d 53, 63 [169 Cal. Rptr. 66].)
(1b) Once the legislative purpose is ascertained, the statute must be given a reasonable and common sense construction which will promote that purpose. Thus, in Bennett v. Brown (1963) 212 Cal. App.2d 685, 688 [28 Cal. Rptr. 485], the court said, in construing the predecessor statute to section 998: "It is a cardinal rule of statutory construction that a statute should, if possible, be given an interpretation which will give effect to the legislative intent and which is consistent with the real object and purpose of the statute." (See also Clean Air Constituency v. California State Air Resources Bd. (1974) 11 Cal.3d 801, 813-814 [114 Cal. Rptr. 577, 523 P.2d 617].)
We are persuaded that an interpretation requiring an offer of compromise to be held open for the statutory periods will promote the object and purpose of the statute by enhancing the chance of settling litigation. A contrary interpretation, which would permit withdrawal of an offer prior to the statutorily mandated periods, would operate to defeat settlements.
It is manifest that if an offeror is permitted to withdraw an offer within the statutory time and before it is accepted, that particular settlement is defeated. The Legislature has determined that the periods provided are reasonable periods for the offeree to cogitate and make a decision. If the settlement process is truncated by withdrawal of the offer before an adequate time has passed to consider and respond to the offer, the legislative purpose of encouraging settlements is frustrated. "[I]t is in the public interest that [an offeree] be given the opportunity to accept and consummate the offer made him." (Hutchins v. Waters (1975) 51 Cal. App.3d 69, 73 [123 Cal. Rptr. 819].)
The statute does not require a party to litigation to make an offer of compromise but gives any party that option on certain terms, one of which is that the offeree shall be given 30 days or to time of trial, whichever occurs first, to accept the offer. By making the offer, the offeror voluntarily accepts the burdens of the statute (to keep the statutory time open) along with the benefits *956 (to deprive the offeree of his costs and permit the offeror to collect his costs should a less favorable judgment be rendered). Accordingly, we think it is reasonable to imply that the Legislature intended that the offer cannot be withdrawn prior to the statutory times stated.
We therefore imply a condition of irrevocability in order to serve a reasonable legislative purpose. (3) "Whatever is necessarily implied is as much a part of the statute as that which is expressed, ..." (58 Cal.Jur.3d, Statutes, § 114, p. 501, fn. omitted; see Johnston v. Baker (1914) 167 Cal. 260, 264 [139 P. 86]; Currieri v. City of Roseville (1970) 4 Cal. App.3d 997, 1001 [84 Cal. Rptr. 615].) In this regard, it is noteworthy that other courts have implied a condition into section 998 that the offer of compromise must be reasonable in amount and be made in good faith. (Wear v. Calderon, supra, 121 Cal. App.3d 818, 821; Pineda v. Los Angeles Turf Club, Inc., supra, 112 Cal. App.3d 53, 63.)
Former section 997,[1] the predecessor to section 998, permitted the offer of compromise to be made at any time before judgment, and allowed 10 days to give notice of acceptance. Section 998, on the other hand, requires the offer to be made at least 10 days before trial and allows 30 days or the period preceding trial, whichever occurs first, to accept. By expanding the time to 30 days before "it [the offer] shall be deemed withdrawn," the Legislature evidenced an intent to provide for an expanded but definitive time within which to act on the offer. It is reasonable to infer that the Legislature expanded the time in order to improve the chance of settlement. Further, it may be reasonably inferred from the wording, "it shall be deemed withdrawn" upon expiration of the time limit stated, that the Legislature intended the offer should not be withdrawn prior to the expiration of those times.
(4) In sum, we believe it would be unreasonable to hold that the Legislature intended to permit the withdrawal of an offer before expiration of the statutory time, thereby frustrating the legislative purpose of encouraging settlement. We therefore conclude that in order to serve a reasonable legislative purpose, the offer cannot be withdrawn.[2]
*957 It has been argued that the rule herein announced could result in serious injustice to an offeror who discovers legitimate grounds for revoking an offer before the expiration of the statutory time limits. Should that occur, it would appear that in an appropriate case a party could seek relief from an offer based upon a mistake, inadvertence, surprise or excusable neglect pursuant to Code of Civil Procedure section 473.
Let a writ of mandate issue directing the trial court to set aside its order denying petitioner's motion to vacate the court's order approving the withdrawal of real party in interest's motion, to disapprove the withdrawal of the offer, and to consider petitioner's motion for summary judgment on its merits.
Zenovich, J., and Woolpert, J., concurred.
NOTES
[1]  Former section 997 was repealed by Statutes 1971, chapter 1679, section 1, page 3605, at which time section 998 was recast by section 3 of the same statute.
[2]  At least two courts have construed analogous statutes as creating an irrevocable offer upon a theory of contract. (See Mubi v. Broomfield (1972) 108 Ariz. 39 [492 P.2d 700]; McVicar v. Keating (1897) 19 App.Div. 581 [46 N.Y.S. 298].) Those courts found that an offer to compromise created an irrevocable option supported by consideration. While we generally concur that section 998 is to be construed in light of contract principles (see Distefano v. Hall (1968) 263 Cal. App.2d 380, 385 [69 Cal. Rptr. 691]), we are unable to find adequate consideration for the offer to convert the offer into an irrevocable option.
