When Gene Salomon, a veteran hack, is asked, “What was the wildest ride you ever had?” he has to think before answering.

He makes a mental list of his near lifetime of rides. He has been driving a taxi since 1977, during the era of checker cabs.

“Was it the girl who rushed out of the cab seven times to puke? Or was it the guy who, without the slightest provocation, would just start screaming? Or the basket case who got out of the cab in the middle of the 59th Street Bridge?”

“But then I remember the ride with the Mafia hit men — and I just can’t decide.”

Rather than choose just one, he has compiled a list of more than 100 of his most memorable fares in his memoir, “Confessions of a Taxi Driver” (The Friday Project) out Jan. 28.

Though there are no pensions, no paid vacations, no overtime, no health benefits for a cabdriver, Salomon gets fulfillment from the stories.

“I have more stories than the Empire State Building,” he quips. It’s a motto on his business card.

You can still hail Salomon. He hits the streets three nights a week from 5 p.m. to 5 a.m. Be warned: He’s keeping a list.

Here are Salomon’s craziest cab stories:

FUTURE “KING OF THE WORLD”

One summer night in 1996, Salomon pulled in front of a group of rowdy kids. One of them, a young blond “smoking a cigar that was bigger than his face” hopped in.

“Don’t you know who I am?” the kid cried from the back seat.

“Uhhh . . . nooo.”

“I’m an actor, man!”

“Oh.”

“Did you see ‘This Boy’s Life’?” he asked.

Salomon said no.

“I played with De Niro, man!”

His passenger then rattled off a list of movies, including “What’s Eating Gilbert Grape.” All of which Salomon hadn’t seen.

Despite this, the two hit it off.

“Our discussion continued until we arrived at Spy [a nightclub], Salomon writes. “As everyone else piled out of the cab, Leonardo DiWho surprised me. He stayed inside and started asking me questions about what it’s like to be a taxi driver.”

Then he asked, “Who was the biggest celebrity tipper you ever had in your cab?”

“Believe it or not, it was John McEnroe. He gave me double the meter,” Salomon replied.

“Well,” DiCaprio said, “I’m gonna give you triple the meter!”

And he did.

CAUGHT IN THE ACT

Sex in cabs — it happens a lot, says Salomon.

“With me, I do find it offensive, but my level of resentment seems to depend on the way the passenger goes about it . . . I do get annoyed if they’re pretending I’m not even there,” he says.

That was the case one night when he picked up a couple at The Bowery Hotel. As the woman closed the door, she blurted out, “You don’t mind if we have sex in your cab, do you?”

Before he could answer, “she was on him like Fido on a leg.”

Salomon drove half a block before hitting a red light. Coming to a stop, he noticed a cop car and rolled down the window.

“Is this legal?” he asked the female officer.

“She was right on it,” Salomon recalls. “She picked up her microphone and, with a big smile on her face, went to work.”

“Hey, you back there in the taxi!” her voice boomed. “What are you doing back there?”

The couple remained oblivious.

“Hey, no sex in taxis!” the cop shouted.

Now everyone within earshot was beginning to enjoy the show.

“Hey, you, lady in the taxi — get off that guy right now!” the officer continued.

The girl finally looked up and dismounted in horror.

“That’s better! Now behave yourselves!”

After that, the ride up to 24th Street and Second Avenue was as “sober as a ride to church on a Sunday morning with a minister and his missus,” Salomon recalls.

OLD LOVE

In 1987, two elderly out-of-towners hopped into Salomon’s car, and he drove them around, stopping at the sights they used to frequent when they were dating.

Then, on Park Drive, he looked in the rearview to check in on the two septuagenarians.

“They were wrapped around each other like a couple of vines,” Salomon writes, “and I would rank them right up there near the top of my all-time list of back-seat kissing fools.”

As the car approached the exit of the park at Central Park South, they straightened up.

“I’m sorry,” said the woman, “for using your taxi for a purpose other than the one for which it is intended.”

“Hey, that’s all right,” Salomon replied. “Cabs are for kissing.”

BLOODY RIDE

In March 1999, Salomon had taken a fare out to Jackson Heights at midnight and was heading back when he was hailed by a man covered in blood. He let him in the cab anyway.

“What’s the matter?” I asked.

“Oh, my God,” he sobbed, “I hope I didn’t kill him.”

“I think I killed him. I hope I didn’t kill him,” he repeated.

After some prodding, he shared his story: He had been sitting a bar, alone, when three rowdy men began to make fun of him. Little did they know, he was an ex-Marine who knew martial arts and was in no mood to take crap.

It became an outright slug fest, which ended with the other guy collapsing on the floor from a chop to the neck that may have crushed his windpipe.

“I gave him the only advice I could: Talk to no one else about his incident other than a priest. Don’t let your feelings of guilt put you in a jail cell,” Salomon says.

HIT MEN

One Friday afternoon in February 1985, two men came into the car and asked to be taken to Newark Airport. Although Salomon never learned their names, he quickly learned what kind of guys he was dealing with.

The two spoke a mix of Italian and English and paid Salomon hardly any attention until they heard news bulletin on the radio.

It had been the time of the city’s infamous Pizza Connection trial, in which dozens of reputed mobsters were accused of operating a massive drug-trafficking ring that had used numerous pizzerias as a fronts.

“Turn that up, please!” one of the men blurted out.

They listened intently until the broadcast was over and then began talking to each other with great animation in Italian.

“It was then I realized where I had picked them up — Foley Square, the very place where all the courthouses were located,” Salomon recalls. “And they had gotten into my cab at 4 p.m., the time of day when a trial would be recessing. And they had told me that they make this trip to Chicago every Friday. They were going back home for the weekend until the trial picked up again the following Monday!

“I knew at this moment as well as I could ever know that these guys sitting five feet behind me were card-carrying members of the mob.

“So how do you drive when you know that the fellow sitting just behind you puts bullets through people’s brains for a living? Carefully!”

The fare was $26.90.

“I’m sorry, my friend, but I have not much money today,” one of the men said, placing an arm on Salomon’s shoulder.

The man handed over $27 — a 10 cent tip.

“What could I say besides, “Have a good flight’?” Salomon says.

CELEBRITY SIGHTINGS

By his count, Salomon has had 114 boldface names in his back seat. He drove Dick Clark three times and also hauled Lauren Bacall, Sean Penn, Dennis Hopper, Robin Williams and James Taylor.

“If I were able to count the ones I didn’t recognize, I’m sure the number would be God knows how many,” he writes.

Here are his recollections of the greats and not-so-greats:

Douglas Fairbanks Jr.: “I was hailed at 77th Street by a middle-aged man wearing a tuxedo. He opened the door, inspected the condition of the cab, and picked up a couple of errant pieces of paper from the floorboard.

“He was prepping the car for his ‘major VIP’ friend, Fairbanks.”

Abbie Hoffman: Salomon was cruising up Eighth Avenue when one normal-looking man and one crazy-looking man entered.

“The ‘dark-haired motormouth’ spoke to his companion in a semi-hysterical rant without giving him a chance to get a word in edgewise.

“When the crazy one got out of the car, the other guy turned to me and said, ‘That was Abbie Hoffman. I’m his parole officer.’ ”

Paul Simon: Salomon enjoyed two rides with the prolific pop star. During the second, in 1983, he floated him a business proposition:

“‘I want you to buy the Yankees,” Salomon said.

“Me? You want me to buy the Yankees?” he replied. “I don’t have that kind of money. You should talk to McCartney.”

THE “I’LL GET OUT HERE” GUY

Salomon picked up a very anxious guy in 1980 who wanted to get to Queens as fast as possible.

He says they had hit traffic on the 59th Street Bridge when the man uttered “those dreaded words: ‘I’ll get out here.’ ”

Salomon turned and glared.

“What do you mean?” he asked.

“I . . . I want to get out right here. Please.”

“What are you going to do, walk? We’re in the middle of the bridge!”

“The other side . . . it’s moving faster.”

“The meter was $3,” Salomon writes. “He handed me three bills, opened his door, and got out of the cab. He then climbed over the railing that divides the two sides of the bridge and, to my astonishment, immediately found an available cab.”

DYING TO GET THERE

On Sunday evening in April 1996, Salomon encountered a middle-aged man in the Financial District with a serious problem.

The cabby was heading for the Holland Tunnel when he noticed something very wrong with his passenger — his body was jerking violently and he was grimacing.

“Sir,” Salomon asked, “are you all right?”

“I just had a heart attack,” he blurted out.

“You just had a heart attack?” the cabby said. “Shouldn’t I take you to the hospital?”

Salomon calls the man’s response “one of the greatest comebacks of all time.”

“I’m comin’ from the hospital,” he said. “Those motherf- -kers don’t know what they’re doing. I’d rather die in a hotel room.”

“I considered driving him to the hospital against his will,” Salomon writes, “but I knew that if I did that, as soon as we came to a stop, he would get out, tell me to go f- -k myself and find another taxi.”

Then another thought occurred to him: “Wait a minute, if this guy dies, what about my fare? Do I charge for the whole ride to Rutherford or just from the point where he expired?

“And do I have the right to take my payment from his wallet? What about my tip? Should I give myself a normal 15 to 20 percent? Or should I be compensated for the trauma to my own psyche and throw myself a $50?”

Luckily, the guy survived the trip.