‘For’ or ‘in’ years, ages, a long time, etc.?

Both can be used in ‘negative’ and ‘past simple’ sentences.

“I hear ‘for ages’ much more frequently by British English speakers, and ‘in ages’ more commonly spoken by American English speakers.” – by ESL Teacher James on italki

But in ‘present perfect’ sentences, only ‘for’ can be used.

Cambridge dictionary examples:

in

I haven’t had a decent night’s sleep in years/ages (= for a long time).

time

That was the best restaurant I’ve been to for/in a long time (= a long period has gone past since I went to such a good restaurant).

for

I haven’t played tennis for years.
Mr Black has been a client of this firm for many years.