In a proceeding pursuant to CPLR article 78 to review respondents’ determination denying seniority credit for continuous substitute service rendered under per diem certificates prior to September 1, 1972, petitioners appeal from a judgment of the Supreme Court, Kings County, entered October 8, 1976, which dismissed the petition for failure to state a cause of action. Judgment reversed, on the law, without costs or disbursements, respondents’ motion to dismiss denied, and proceeding remitted to Special Term for further proceedings in accordance herewith. The time within which respondents may serve their answer is extended until 20 days after entry of the order to be made hereon. Petitioners are all regularly appointed teachers who were laid off between January 1, 1976 and March 30, 1976. Prior to receiving their regular appointments, petitioners served "on a regular continuous basis as [substitute] teachers” under per diem certificates. By statute, the abolition of a teaching position compels the layoff of the teacher "having the least seniority in the system within the tenure of the position abolished” (Education Law, § 2585, subd 3). It is conceded that the date of commencement of a teacher’s seniority is, for present purposes, either the date he or she began the probationary period or, "if she [or he] had been employed by the board as a regular substitute prior to service as a probationary teacher, the date of the commencement of regular substitute service” (Matter of Ducey, 65 St Dept Rep 65, 68). Section 484 of the board’s own by-laws defines a regular substitute teacher as "one who is assigned by the Superintendent of Schools at the beginning of the term, or within fifteen calendar days following the first day for the reporting of newly appointed teachers, to a position open for a full term.” Petitioners contend that they fall within the purview of this definition and that, the motion, to dismiss having been made before answer, such conten*599tion is deemed true for purposes of this appeal. The collective bargaining agreement between the board and the United Federation of Teachers for the period September 1, 1972 to September 1, 1975 contained, for the first time, a provision granting seniority credit for regular substitute service performed by a per diem teacher. In accordance therewith, the board has given petitioners seniority credit for the substitute services they rendered after September 1, 1972. However, it has refused to grant seniority credit to petitioners for continuous substitute service rendered prior to such date on the ground that such service was rendered under per diem certificates and, hence, was not "regular” service as a matter of law. If petitioners are granted the sought-after seniority credit, they will allegedly be able to "bump” retained teachers with less seniority. Special Term has determined that petitioners’ service under per diem certificates does not qualify for seniority credit with respect to the period prior to September 1, 1972. We disagree. The absence of any pre-1972 contractual parity between per diem and regular substitutes who, in fact, performed the same service, is not dispositive. The relief requested may be premised upon statutory right, as well as contractual right, and, of course, the contract cannot impliedly deprive teachers of rights secured by law. In this case, it is a statute, subdivision 3 of section 2585 of the Education Law, which governs petitioners’ seniority lay-off rights. In Matter of Ducey (65 St Dept Rep 65, supra), the Commissioner of Education explained the distinction between the two types of substitute service: regular and itinerant. The "regular substitute” is the one who takes over the class of another teacher on a permanent basis, i.e., under circumstances where the regular teacher has been given a definite leave of absence, as for maternity leave or a sabbatical, for at least a term. The regular substitute should be paid on an annual basis and would be entitled to membership in the retirement system. The "itinerant substitute”, on the other hand, is a person called in for short periods of a day, a week or more to take the place of a teacher temporarily absent because of sickness or otherwise. Such a substitute is paid on a per diem basis and is not entitled to membership in the retirement system. The commissioner further noted that then section 872 (now § 2573) of the Education Law recognized only regular substitute service, permitting boards of education to credit two years’ service as such toward the probationary period of any teacher. The commissioner did not discuss per diem certificates as such and specifically declared (p 67) that the "failure of a board of education to 'assign’ for a definite term and to pay upon an annual basis would not, however, alter the status of the teacher as a regular substitute if it appears as a matter of fact that she has taught regularly during the term” (emphasis supplied). This last caveat was enforced in several subsequent decisions of the Commissioner of Education. Thus, in Matter of Nuzzi (8 Ed Dept Rep 97, petition dsmd sub nom. Matter of Board of Educ. v Nyquist, 60 Misc 2d 99), for example, it was held that the New York City Board of Education had improperly denied the petitioner salary credit for service as a regular substitute since, although hired as a per diem substitute, she had been assigned to a class within 15 days of the beginning of the term, which she then taught for the entire term. In Matter of Waterman (13 Ed Dept Rep 68) and Matter of Artale (13 Ed Dept Rep 84), service as a regular substitute, albeit under per diem status, was held to entitle the teacher to "Jarema Act” credit (regular substitute service may be credited against the completion of a probationary term) (Education Law, § 2509, subd 1; § 2573, subd 1). In the light of these decisions of the education commissioner, the board’s exaltation of form over substance in this case cannot be justified. *600The distinction between "regular” and per diem substitute service has been long recognized and consistently based, for statutory purposes, upon the nature of the services performed, and not the type of paper authorization held by the teacher. If regular substitute service entitles the teacher to credit for such service in determining salary and tenure after appointment to a regular teaching position, we can see no basis in law, logic or equity for denying such credit for the purpose of determining seniority in a lay-off situation. Matter of Lee v Board of Educ. (182 Misc 1011, affd 269 App Div 747, affd 295 NY 647) is inapposite. The petitioner therein had not, in fact, served as a "regular” substitute prior to her permanent appointment, her service having been, inter alia, sporadic rather than continuous for a full term or more. Moreover, that decision was premised solely upon judicial interpretation of a so-called analogous seniority provision in the Civil Service Law. Matter of Ryba (14 Ed Dept Rep 11) is also inapposite. The sole issue there was whether the holder of a temporary per diem certificate had a contractual right to have his regular substitute service credited toward his seniority for purposes of applying the board’s excessing rules. Although it does not govern the rights of those teachers laid off before July 1, 1976 in this case, we note that the Legislature has recently amended the Education Law to expressly include "all full-time equivalent substitute service” in determining relative seniority rights (Education Law, § 2588, subd 3, par [a]). The amendment thus accords with pre-existing law, as applied and interpreted. In conclusion, we hold that the mere fact that petitioners held per diem certificates at the time they rendered their alleged regular substitute service does not, as a matter of law, suffice to deny them seniority credit in a lay-off situation pursuant to subdivision 3 of section 2585 of the Education Law. We would also add that this proceeding appears to he an appropriate one for class action treatment, but we leave the final resolution of petitioners’ application for that relief to Special Term. Hopkins, Acting P. J., Martuscello, Cohalan and Damiani, JJ., concur.