On the eve of their wedding, Ben Affleck and Jennifer Lopez went to war — over Ben’s high-stakes gambling!

Just a week after wagering furiously at a casino in Los Angeles, Affleck spent two days playing poker and blackjack in Connecticut, sometimes betting thousands of dollars a hand, witnesses say. And Jennifer, busy shooting a film in Canada, erupted, friends reveal.

One evening as Ben played poker, the actress repeatedly interrupted the game by calling his cell phone every 30 to 60 minutes, a fellow player said.

“Jen was ticked off at Ben for blowing wads of dough in L.A.,” a friend of the couple told The ENQUIRER. “And when she found out he had hightailed it to a Connecticut casino after visiting his mom, she was furious.

“She’s still very, very mad at him for playing around with strippers a few weeks ago.”

Experts tell The ENQUIRER that gambling may be a danger for Affleck — who entered alcohol rehab in 2001 — because he may be substituting one addiction for another.

“It’s very common for people recovering from chemical addictions to become addicted to gambling,” said Pat Fowler, executive director of the Florida Council on Compulsive Gambling.

“Compulsive gambling progresses much like alcohol addiction. It starts out as a social activity, but for those prone to lose control, it can progress to a disorder.

“Increasing the size of bets is one warning sign.”

Psychiatrist Dr. James Cocores, an expert on addictions, agreed.

“There’s a huge link between gambling and substance abuse,” said Dr. Cocores, who has never treated Affleck. “When someone recovering from an addiction starts gambling, it’s like switching from vodka to gin.

“It’s just a matter of time before they’re going to destroy their lives.”

The ENQUIRER recently revealed that Affleck — whose gambling is becoming legendary — wagered heavily at Hollywood Park Casino in Inglewood, Calif., on August 17.

“Ben looked like he was on a mission,” a casino employee told The ENQUIRER. “He was losing money and tipping big time.”

The Academy Award-winning star hit the tables again August 24-26 at Foxwoods Casino in Connecticut after spending a low-key weekend hanging out with pals and his mother Chris in his hometown of Boston.

Shortly after his arrival at Foxwoods, Affleck played high-stakes poker continuously for nearly five hours — drinking Diet Coke and losing approximately $100,000, witnesses said.

“Ben was really cool, like a regular guy, not pretentious at all,” a fellow player told The ENQUIRER. “I could tell he loves the competition, but he’s not really a strong player. He makes a lot of mistakes.”

Affleck later won back $10,000 playing blackjack and won $80,000 at the poker table the next night.

“That second night, Ben kept getting phone calls from Jennifer, every half hour or hour,” his fellow player said. “I knew it was her, because the first time she called, he said ‘Hello, my love,’ then mouthed ‘Jennifer’ to us and walked away from the table.

“He was very sweet to her. Each time she called — which turned out to be about 10 times — he would walk away from the table, smoke a cigarette and talk to her.”

Jennifer was enraged at Ben for gambling because she considers it a waste of money, the couple’s friend told The ENQUIRER.

“When she hears about Ben wagering huge sums of money on a single poker hand, she thinks that’s flushing money down the toilet,” the friend said.

“She wants him to grow up and act his age.”