I had a similar goal, and went a slightly different way:
I wanted to be able to test with newer versions of PHP as well as the production version, and run testcases against them.
Code centric Development environment
I started by using vagrant, which basically is a way of provisioning your VMs. the configuration is in code, in form of a VagrantFile. I liked the way this allowed me to set up completely equal environments, and bracnh off to test new versions of PHP without changing the rest of the system. The way I set it up, it basically maps your
src folder to the vm, and you are off.
This also meant that any developer checking out the code will be able to spin up a development environment which is exactly the same as the one all the other developers are using.
This is a further development of the scenario I have described, and is essentially an alternative route
After some iterations, and a desire to automate the testing, which meant spinning up a test environment when I needed to test, with the same specs as my prod environment, I decided to move to docker. the overhead is less, and it appears that docker is easier to run on different OSes, so essentially I did the same sort of thing in docker, which means that setting up CI/CD is easy since a lot of those tools have docker integrations built in.