I forked this because the original didn't work with linuxbrew, if you're on MacOS, just use the original.
Brew PHP switcher is a simple script to switch your PHP cli configs quickly between major versions of PHP.
If you support multiple products/projects that are built using either brand new or old legacy PHP functionality and you find it a pain to change config files continually this will make the whole process just one command.
For users who have installed PHP via Homebrew and for PHP version 5.6, 7.0, 7.1, 7.2, 7.3 and 7.4 only.
@todo
Where 5.6 exists, please replace with syntax of 5.6, 7.0, 7.1, 7.2, 7.3, or 7.4 depending on which version is required.
./phpswitch.sh 5.6