This Bash script for users who work with multple PHP versions, make them easy to switch between different version (Ubuntu 16.04 LTS (Xenial Xerus) and Ubuntu 18.04 LTS (Bionic Beaver)).
$ wget https://raw.githubusercontent.com/alirza143/switch-php/main/sphp.sh
$ chmod +x ./sphp.sh
$ sudo mv sphp.sh /usr/local/bin/sphp
$ sudo sphp
Sample output
0 : 7.2
1 : 7.3
2 : 7.4 (active)
PHP Current Version in 7.4
Enter the corresponding number to switch PHP version: 2
Switched to PHP 7.4, do you want to switch PHP version in the terminal also [y/N]:
Ok, switched to 7.4
DISCALIMER: These instructions are made available for ease and not recommended for the production, owner will not be responsible of any damage or lose of data or whatsoever.