Google and Samsung now provide updates for 7 years, and Fairphone provides updates for 8 years.
From what I can tell, Apple doesn’t promise a set number of years for updates. The iPhone x got about 5 years of updates before support was dropped, but Apple will occasionally give security updates to older devices if they’re severe enough.
With Fairphone 5, they guarantee at least 8 years of software updates but they will actually try 10 years! [1]
And Apple was recently forced to disclose their software support commitment in the UK due to regulations. Apple guarantees at least 5 years of software updates, which is less than Google, Samsung, and Fairphone. Apple is no longer the leader in software support! [2]