(b) Notice to attorney-general, city, county, town or village where constitutionality in issue. 1. When the constitutionality of a statute of the state, or a rule and regulation adopted pursuant thereto is involved in an action to which the state is not a party, the attorney-general, shall be notified and permitted to intervene in support of its constitutionality. 2. When the constitutionality of a local law, ordinance, rule or regulation of a city, county, town or village is involved in an action to which the city, county, town or village that enacted the provision is not a party, such city, county, town or village shall be notified and permitted to intervene in support of its constitutionality. 3. The court having jurisdiction in an action or proceeding in which the constitutionality of a state statute, local law, ordinance, rule or regulation is challenged shall not consider any challenge to the constitutionality of such state statute, local law, ordinance, rule or regulation unless proof of service of the notice required by this subdivision is filed with such court.
(c) Notice to comptroller of the state of New York where public retirement benefits are in issue. Where public retirement benefits, paid, payable, claimed, or sought to be paid by a state retirement system or any other retirement system established for public employees within this state or any subdivision thereof, or the interpretation of any provisions of law or rules governing any such retirement system or the operation thereof, are involved in an action to which the comptroller of the state of New York is not a party, the court shall notify said comptroller, who shall be permitted, in his discretion, to intervene in such action or to file a brief amicus curiae.