Hello Pals.
I want to share how to setup different php version on sing Mac machine.
First of all let’s add this to your homebrew.
brew tap shivammathur/php
brew tap shivammathur/extensions
After tapping a new source. We can simply install custom version. In this case I use several version that I commonly used.
brew install shivammathur/php/php@7.4
brew install shivammathur/php/php@8.2
brew install shivammathur/php/php@8.3
After all the version that you need are installed. The next step is just switch between those versions. What I will do is to set using brew.
brew link --overwrite --force shivammathur/php/php@8.3
And then use version checker to see whether the version is already changed.
php -v
There are also many extensions that you can use.
https://github.com/shivammathur/homebrew-extensions?tab=readme-ov-file#extensions
I think that’s all. Feel free to install whatever version that you want and switch it easily.