Use Laragon
I don't know if it is possible with other stacks but Laragon is a lightweight ans performant option.
As described here it's easy and there are few steps.
- Install Laragon as your
LAMPP
or LEMMP
stack for windows
- Download your desired PHP version from official website
- Extract downloaded zip in PHP folder within your Laragon installation.
- Right-click on the Laragon icon in your stystem tray. Navigate to PHP and choose your version!
- Restart Laragon and done!

The default installation path is:
C:\laragon\bin\php\
Laragon will pick up the folder name as the identifier.
Note: You Can config apache
or nginx
to serve each directory with its own version but it is not included in this post. you should learn it from official documentations.