Compatibility of oldish iPhones, Apple's policy, future perspective
Here's the list of iPhones that currently support iOS 11:


iPhone 5S
6
6 Plus
6S
6S Plus
SE
7
7 Plus
8
8 Plus
iPhone X


With the exception of the last 3, you can find reasonably inexpensive (probably not 'cheap') used iPhones that should last for another 1-3 years.  Apple doesn't post roadmaps as to upcoming devices or the iOS versions that support.