This is how i achieved to get all PHP versions working at the same time.
I have as many php versions as i want all running at same time. Versions are attached to directories, so in my www
directory i have a folder for each php version www/php71/
, www/php72/
and so on. If i want to change a project to another version, i only have to move it to a different folder. In MacOs, moving a huge folder is less than 1 second, so this is the fastest way to change version without updating server configuration.
Install all the php versions via brew
command.
Example command (replace version number for each one)