In 99% after download and install your new PHP version you will need to change your environment variable in order to switch on your new version. To do so, open a terminal and tap:
(if you don't know how to use vi --> click here)
Tap i to insert and then paste this line with your new PHP version,
Of course, if you already did the sane action for an older version you need to remove the old lines in this file (tap 'dd' to remove a line with vi).
In this example I have the PHP-version 7.1.13, to get your, you can tap in another terminal this command and see which version you want to implement:
Finally, press ESC and ZZ (MAJ + ZZ), it will save your modification.
Restart you computer and that's it ! To double-check go to how to found my PHP version.