Raines itself recognizes, however, there are several exceptions to this rule. (362 U.S. 17, 22-23 [80 S.Ct. 519, 4 L.Ed.2d 524, 529-530]; see also Barrows v. Jackson (1953) 346 U.S. 249, 257 [73 S.Ct. 1031, 97 L.Ed. 1586, 1595-1596]; Mendoza v. Small Claims Court (1958) 49 Cal.2d 668, 670 [321 P.2d 9]; People v. Building Maintenance etc. Assn. (1953) 41 Cal.2d 719, 726 [264 P.2d 31]; Quong Ham Wah Co. v. Industrial Acc. Com. (1920) 184 Cal. 26, 30 [192 P. 1021, 12 A.L.R. 1190].)
One important exception is that, where a provision restricting free speech and the free dissemination of ideas is involved, a court in considering the claim of overbreadth and vagueness may take into account the operation of the provision as to factual situations other than the one at bar. (N.A.A.C.P. v. Button, supra, 371 U.S. 415, 432-433 [83 S.Ct. 328, 9 L.Ed.2d 405, 417-418]; Thornhill v. Alabama (1940) 310 U.S. 88, 96-99 [60 S.Ct. 736, 84 L.Ed. 1093, 1098-1100]; In re Blaney (1947) 30 Cal.2d 643, 650-653 [184 P.2d 892]; In re Porterfield (1946) 28 Cal.2d 91, 115 [168 P.2d 706, 167 A.L.R. 675]; In re Bell (1942) 19 Cal.2d 488, 495-496 [122 P.2d 22].) Although the exception has usually been resorted to in connection with criminal statutes, the principles applied to protect free speech against infringement by criminal statutes may be of equal or greater importance in regard to noncriminal statutes. (See New York Times Co. v. Sullivan, supra, 376 U.S. 254 [84 S.Ct. 710, 724-725, 11 L.Ed.2d 686].) The exception in question is appropriate wherever a provision too broad or vague, if allowed to stand, would amount to a coercive restraint on free speech, as would the one before us since it provides for dismissal from employment in the event of a violation. It should be noted that the court in In re Blaney, supra, 30 Cal.2d 643, 653-654, applied the exception with respect to a statute which did not impose criminal penalties but provided for injunctive relief, reasoning that the statute was coercive because an injunction could be enforced by contempt proceedings.
Where a provision encompasses both valid and invalid restrictions on free speech and its language is such that a court cannot reasonably undertake to eliminate its invalid operation by severance or construction, the provision is void in its entirety regardless of whether the particular conduct before the court could be constitutionally regulated and whether there is a severability clause applicable to the provision. (See, e.g., Thornhill v. Alabama, supra, 310 U.S. 88, 96-