ps: most of my own packages are currently tested with all php versions from 5.4 to 8.2, so it is definitely doable to have code that can work on all versions.
It does take time to get there though. I'd say most of the time I spent on that was wresting with testing automation rather than with the language itself - but it is still a chore.