Been using  DDEV-Local for a while as my main PHP-environment for Magento2 & Laravel projects. DDEV-Local is a super easy and fast way to get started on a PHP project. DDEV is open-source. All docker based and very well documented on their website or/and on Github

Install DDEV (Homebrew)

brew tap drud/ddev && brew install ddev

Once DDEV is installed go to your project folder and enter command below. Follow instructions showned in terminal. Depending which project you're using. (Laravel, wordpress, Magento, Drupal etc).

ddev config

Will recommend to checkout DDEV's quickstart-guides.

Swap PHP version

SSH into web-container once a project has been setup. You can change PHP version any time by entering following command.

update-alternatives --config php