Once you’ve installed php on IIS using the web platform installer, you might find that your websites do not automatically use the latest version. I had this problem while using Windows Server 2016.
If you go to handler mappings in IIS (either by selecting it for your whole server or one particular site) you can see the list of CGIphp versions although some of the later ones may not show the version (eg. phpv7) next to the name but may instead say something like PHP_via_FastCGI with a number at the end. If you double-click on one of these it will show you to the path to your php version, so you will know which is the right one to use.
Once you know which one you want to prioritise, click on ‘View Ordered List…’ to the right of the list and move this version to the top of the list. The system should automatically update instantly.