You can download the PHP versions you need and place them in your own directories, for example
c:\php5\
c:\php7\
All you need to do is tell your web server (Apache) which version of PHP to use, so it will load the appropriate module. In Apache you can do this by looking for the httpd.conf file and then editing the appropriate line:
LoadModule php7_module c:\php7\libphp7.so
You will have to discover the correct route, of course, this is just an example.
Save the httpd.conf and restart your server. Keep in mind that if you do not restart it, the changes will have no effect.
It is necessary to edit the .conf file and then restart Apache. Doing this only takes a couple of seconds, you can document which one you are also using in the file.
Use PHP 5:
LoadModule php5_module c:\php5\libphp5.so
#LoadModule php7_module c:\php7\libphp7.so
Use PHP 7:
#LoadModule php5_module c:\php5\libphp5.so
LoadModule php7_module c:\php7\libphp7.so
You do not need multiple versions of XAMPP, nor dual boot, nor use a different machine, nor any of the other "solutions" that have suggested complicated solutions. If you want to use XAMPP just tell what version of PHP to use. This is the fastest and most efficient way to do it, and it only requires a XAMPP installation.