I found myself constantly needing to switch PHP versions in my development environment based on the projects I work on. I wanted to have a simple way to switch php versions and all the tools I found were heavy weight or to complicated for my purpose. So I wrote a simple bash script which provides a list of available PHP versions and allows you to switch between those versions. This script is written for Ubuntu and tested in Ubuntu 16.04.

Basic Usage

./switchPhp.sh <php_version>

You can download the script from my github gist.