The iPhone 5s from 2013 (109 months ago) scans QR codes from the default camera app just fine. Still gets security updates too. This is unparalleled in the Android ecosystem.
I’m not going to get into yet another platform flame war and I’m sure you have plenty of reasons why you selected your device and they’re valid. But if your post is about longevity and economics iPhone wins hands down.