You are using a comparison operator on a string though. I'm not sure if you can really do that in the way you intended it. if phpversion() is an integer you should have 7 as an integer I guess, not as a string.
Snog and Robust bring up good points that I didn't notice on my initial skim read. You can change your conditional to something like this to ensure it doesn't fall over in a case where the version isn't what you expect: