In my experience, Apple phones are pretty good at not being obsolete.
I gave my old iPhone X to my father who's still using it, 9 years later, with software updates to iOS.
Compare that to the Google Pixel 2 (which came out in the same year), got it's last software update 3 years later.
Iphone x hasn't received ios updates since 2023. That's better than 3 years, but it's not receiving updates any more