Skip to content

Instantly share code, notes, and snippets.

@zafranf
Created November 16, 2022 14:21
Show Gist options
  • Save zafranf/93aaadaa139ddc72280516bbdcbd220d to your computer and use it in GitHub Desktop.
Save zafranf/93aaadaa139ddc72280516bbdcbd220d to your computer and use it in GitHub Desktop.
macOS switch php version
#!/bin/bash
echo "###########################"
echo "# Choose PHP Version #"
echo "###########################"
echo "1) [email protected]"
echo "2) [email protected]"
echo ""
echo "0) exit"
echo
printf 'choose [1/2/0] : '
read -r i
case "$i" in
1) echo "Changing PHP Version to 7.4"
brew unlink [email protected]
brew unlink [email protected] && brew link --force --overwrite [email protected]
;;
2) echo "Changing PHP Version to 8.1"
brew unlink [email protected]
brew unlink [email protected] && brew link --force --overwrite [email protected]
;;
*) echo "Exit"
exit 0
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment