I have a Samsung Galaxy S4, it is still a very usuable phone and is running a modern android version and gets regular updates. Sure it is a bit slow and I had to flash a custom rom (/e/os) but that is not hard to do.
This phone is now almost 10 years old, but still gets updates and can run most apps. I don't think this can be done with an iphone.