Imagine being forced to take “flirting classes,” designed to teach a gay teenage boy how to talk to the opposite sex. Being ordered to masturbate to images of women. To undergo electric shock treatments, and take medicine to induce vomiting when a therapist flashes a photo of two men holding hands.

All administered with parental consent — and the false promise that it will change your sexual orientation.

The stories of teens who endured so-called gay “conversion therapy,” as told to a Senate committee this week, are heart-wrenching. It should come as no surprise that they suffered lasting psychological harm. This therapy is intended to twist a person’s very nature out of shape. It’s pure quackery, and any rational person would oppose it.

To that end, New Jersey lawmakers are now trying to outlaw conversion therapy, as only California has done. The bill’s Assembly sponsor, Tim Eustace (D-Bergen), who is openly gay, calls it child abuse.

He has good reason to say so. This therapy has been discredited by all the major counseling organizations. Just last year, a prominent psychiatrist in Prince­ton apologized for publishing the one shred of scientific evidence that appeared to support it, saying the study was invalid.

Nevertheless, lawmakers should vote against his well-intentioned bill. Because the truth is, it won’t have much effect on the fringe practice of this therapy. And what it will do is set a dangerous precedent.

Remember, there’s an important distinction between what is a terrible idea and what should be illegal. This therapy is a terrible idea. It’s primarily practiced by religious leaders, counselors or life coaches who aren’t licensed. None of these people would be affected by this bill, which applies only to licensed therapists.

It’s true that the handful of doctors who promote “conversion therapy” are not following the standards of their profession; they’re following their own belief systems and presenting them as professional standards. This can be very harmful.

But in most cases, there’s no medicine or electric shock treatments involved. It’s strictly a form of talk therapy. And lawmakers have never outlawed any type of talk therapy. Do we really want them to decide what sort of speech should be allowed in your therapist’s office?

However misguided a form of therapy is, to outlaw it seems like an overreach. Think about what this could mean in the future. Do we also want the Legislature weighing in on other controversies, such as how to treat children who may be transgendered?

It’s not always clear what’s in the best interest of a child and, depending on a parent’s point of view, doctors take very different approaches. The state shouldn’t make that choice for them.

People have a right to mistakes. Unfortunately, this includes raising a child according to crackpot ideas. So instead of passing a ban that’s largely futile, let’s find ways to warn parents about the dangers of conversion therapy, no matter who is practicing it. And the importance of accepting gay children as they are.