Former "Social Distortion" drummer Casey Royer was sentenced to 90 days in jail yesterday ... TMZ has learned -- after the punk legend allegedly OD'd on heroin in front of his 12-year-old son.
Royer pled guilty in Orange County Superior Court to one count of being under the influence of a controlled substance. Prosecutors dismissed the child abuse and endangerment charge.
In addition to jail time, Royer -- who's currently released on bond -- was placed on formal probation for three years.
So far, a date hasn't been set for Royer to begin his sentence.
UPDATE: A rep for Royer released a statement saying, "Casey Royer, front man of the punk band DI has entered a rehab facility and is working in accordance with the courts wishes."