Here is a german posting where someone switches between PHP7 and PHP5:
viewtopic.php?f=4&t=77836If you dont understand german, translate it with
http://www.deepl.com, a very sophisticated translator. Basically you have two different httpd-xampp.conf and use one of them due to the PHP version you need.
Actually there is a more sophisticated solution, instead of running PHP as a module you may install and run it in CGI Mode. There is a code snippet in httpd-xampp.conf how to accomplish it. At next install any desired PHP version, then create two different VirtualHosts, call them (for example) local.php5 and local.php7
In each VirtualHost you configure PHP as a module, in one choose PHP from the PHP5 folder, in the other choose PHP from the PHP7 folder. This does NOT work with PHP Module, because you cannot load more than one Module. But you can specify as many CGI versions as you like (therefore CGI instead of Module). You can choose the same DocumentRoot in booth VirtualHosts. Finally, if you did everything right, restart Apache, after you can run your script with PHP5 via
http://local.php5/myscript.php and with PHP7 via
http://local.php7/myscript.php. You even dont need to switch anything, everything depends on the URL and on the VirtualHost you choose.