OPINION OF THE COURT
ROBERTS, Justice.On October 31, 1957, twenty-four days prior to her death, Leona E. Cavill executed her last will and tes*413tament. In an audit statement, filed pursuant to the first and final account, decedent’s executrix requested a hearing on the applicability of section 7(1) of the Wills Act of 1947 1 to the final dispositive paragraph of the will. That paragraph directs that the residue of decedent’s estate be divided among five named charitable organizations.2 A supplemental account showing $100,750.97 in the estate was filed in 1972, and the account was called for audit.3
The orphans’ court held that the residuary estate should be distributed to the five charitable organizations named in the will. Cavill Estate, 56 Erie County Legal J. 44 (Pa.OvC.1973). Decedent’s intestate heirs have appealed.4 We affirm.
*414Although statutory provisions substantially identical to section 7(1) have been in effect in Pennsylvania since 1855,5 this Court has never passed on the constitutionality of this so-called “Mortmain statute.”6 A three-pronged constitutional attack is now before us. En route to its holding, the orphans’ court concluded that by invalidating all charitable or religious gifts included in a will executed within thirty days of death, section 7(1) violates the due process, privileges and immunities, and equal protection clauses of the Fourteenth Amendment. Id. at 46-47. We need consider only one of these grounds; we conclude that section 7(1) denies the charitable beneficiaries equal protection of the laws.7
The raison d’etre of Mortmain statutes has been variously described.
“The motive behind these acts is not hostility to charity, but rather a desire to prevent imposition upon the donor and to protect his family against unwise generosity. The statutes are intended to require gifts to charity to be made with proper deliberation and at a time when the donor is in at least reasonably competent physical condition. They seek to hold for the near relatives of the donor a fair share of his estate, as against the claims of charity.”
*4153 G. Bogert, The Law of Trusts and Trustees § 326, at 683 (2d ed. 1964). See also 4 A. Scott, The Law of Trusts § 362.4, at 2821 (3d ed. 1967).
“The basic purpose of the 30 day requirement was and is to prevent a testator during his last illness from being importuned or otherwise influenced, by hope of reward or fear of punishment in the hereafter, to leave his estate in whole or in part to charity or to church.”
McGuigen Estate, 388 Pa. 475, 478, 131 A.2d 124, 126 (1957) (Bell, J.) (dictum); see Paxson’s Estate, 221 Pa. 98, 111, 70 A. 280, 285 (1908).
The basic principles which govern this case are well known.
“ ' [T] he Fourteenth Amendment does not deny to States the power to treat different classes of persons in different ways. Barbier v. Connolly, 113 U.S. 27, 5 S.Ct. 357, 28 L.Ed. 923 (1885); Lindsley v. Natural Carbonic Gas Co., 220 U.S. 61, 31 S.Ct. 337, 55 L.Ed. 369 (1911); Railway Express Agency v. New York, 336 U.S. 106, 69 S.Ct. 463, 93 L.Ed. 533 (1949); McDonald v. Board of Election Commissioners, 394 U.S. 802, 89 S.Ct. 1404, 22 L.Ed.2d 739 (1969). The Equal Protection Clause of that amendment does, however, deny to States the power to legislate that different treatment be accorded to persons placed by a statute into different classes on the basis of criteria wholly unrelated to the objective of that statute. A classification “must be reasonable, not arbitrary, and must rest upon some ground of difference having a fair and substantial relation to the object of the legislation, so that all persons similarly circumstanced shall be treated alike.” Royster Guano Co. v. Virginia, 253 U.S. 412, 415, 40 S.Ct. 560, 64 L.Ed. 989 (1920).’ ”
Eisenstadt v. Baird, 405 U.S. 438, 446-447, 92 S.Ct. 1029, 1035, 31 L.Ed.2d 349 (1972), quoting Reed v. Reed, 404 U.S. 71, 75-76, 92 S.Ct. 251, 253, 30 L.Ed.2d 225 (1971).
*416Section 7(1) divides testators into two classes. One class is composed of those testators whose wills provide for charitable gifts and who die within 30 days of executing their wills. The other class is composed of those .testators who either make no charitable gifts or survive the execution of their wills by at least 30 days. The statute renders invalid any charitable gifts made by a testator in the first class if any person “who would benefit by its invalidity” objects.8 In all other cases, one who wishes to invalidate a testamentary gift must prove lack of testamentary capacity or undue influence.
Clearly, the statutory classification bears only the most tenuous relation to the legislative purpose. The statute strikes down the charitable gifts of one in the best of health at the time of the execution of his will and regardless of age if he chances to die in an accident 29 days later. On the other hand, it leaves untouched the charitable bequests of another, aged and suffering from a terminal disease, who survives the execution of his will by 31 days. Such a combination of results can only be characterized as arbitrary.
Furthermore, while the legislative purpose is to protect the decedent’s family, the statute nevertheless seeks to nullify bequests to charity even where, as here, the testator leaves no immediate family.9 In these circumstances, the statute would operate to “protect” only distant relatives, with whom the testator may have had little or no contact during life, against the carefully selected and clearly identified objects of the testator’s bounty. This protection of a nonexistent “family” defeats the testator’s expressed intent without any relation to the purpose which is sought to be promoted, further demonstrating the irrationality of the statutory classification.
*417Because the statute sweeps within its prohibition many testamentary gifts which present no threat of the evils which the statute purports to minimize, it is substantially over-inclusive. Since the statute also leaves unaffected many gifts which do present such a threat, it is also substantially under-inclusive. We are thus compelled to conclude that it lacks “a fair and substantial relation” to the legislative object. Therefore, the Equal Protection Clause forbids us to give it any effect. Eisenstadt v. Baird, 405 U.S. 438, 447, 92 S.Ct. 1029, 1035, 31 L.Ed.2d 349 (1972); Reed v. Reed, 404 U.S. 71, 76, 92 S.Ct. 251, 253, 30 L.Ed.2d 225 (1971); F. S. Royster Guano Co. v. Virginia, 253 U.S. 412, 415, 40 S.Ct. 560, 561, 64 L.Ed. 989 (1920).
The decree of the orphans’ court is affirmed. Each party pay own costs.
POMEROY, J., filed a dissenting opinion in which EAGEN, J., joins.. Act of April 24, 1947, P.L. 89, § 7(1). The relevant portion of § 7(1) states:
“Any bequest or devise for religious or charitable purposes included in a will or codicil executed within thirty days of the death of the testator shall be invalid unless all who would benefit by its invalidity agree that it shall be valid.”
This section was amended by the Probate, Estates and Fiduciaries Code, 20 Pa. S. § 2507(1) (Special Pamphlet 1974) (effective July 1, 1972). However, because testatrix died while the 1947 Act was in effect, the orphans’ court properly applied that Act. See Cavill Estate, 56 Erie County Legal J. 44, 45 n. 1 (Pa.O.C. 1973) (Dwyer, P. J.). Since section 7(1) and section 2507(1) are identical in effect, our analysis of section 7(1) is equally applicable to section 2507(1).
. The residuary clause reads:
“TENTH: All the rest, residue and remainder of my estate, whether real, personal or mixed, of whatsoever kind or nature and wheresoever situate at the time of my decease, I give, devise and bequeath unto The American Heart Association; The American Cancer Society Incorporated; The American Foundation for the Blind; Boys Town of Boys Town, Nebraska; and Zem Zem Hospital for Crippled Children, of Erie, Pennsylvania, to be equally divided among them, share and share alike.”
. Notice of the hearing was given to the five charities, the decedent’s intestate heirs, and the Attorney General of the Commonwealth.
The charities argue that the delay in calling the estate for audit estops the heirs from contesting the residuary bequests. The record does not indicate, however, that this delay can be attributed to the heirs. Therefore it cannot operate to estop them.
. Appellate Court Jurisdiction Act of 1970, Act of July 31, 1970, P.L. 673, Art. II, § 202(3), 17 P.S. § 211.202(3) (Supp.1974).
. See Act of April 26, 1855, P.L. 328, § 11; Act of June 7, 1911, P.L. 702, § 1; Act of June 7, 1917, P.L. 403, § 6; Act of April 24, 1947, P.L. 89, § 7; 20 Pa. S. § 2507(1) (Supp.1974).
. In 1880 the Court did allude in dictum to the constitutionality of the then-existing Mortmain statute.
“While the propriety of legislation which thus limits the right of giving for religious or charitable purposes may sometimes have been questioned, it has never been doubted that the act is constitutional, and the only question presented for our consideration is whether the residuary bequest is for either a religious or charitable use, and therefore falls within the prohibition of the statute.”
Rhymer’s Appeal, 93 Pa. 142, 146 (1880).
. U.S.Const. Amend. XIV, § 1. Our holding is likewise mandated by the prohibition of special laws in the Pennsylvania Constitution, Pa.Const. art. Ill, § 32, P.S.
. Act of April 24, 1947, P.L. 89, § 7(1). See note 1, supra.
. Leona Cavill left no surviving issue, spouse, ancestor, or sibling. All of the next of kin were children of her deceased brothers and sister.