Skip to content

Instantly share code, notes, and snippets.

@itsmikita
Created June 21, 2023 07:56
Show Gist options
  • Save itsmikita/6bd308764b06a1b93436856f052723ff to your computer and use it in GitHub Desktop.
Save itsmikita/6bd308764b06a1b93436856f052723ff to your computer and use it in GitHub Desktop.
A tiny shortcut function to switch between PHP versions on macOS.
# switch php version
function switch_php() {
brew services stop [email protected]
brew services stop php
brew unlink [email protected]
brew unlink php
case $1 in
7.4)
brew services start [email protected]
brew link [email protected]
;;
*)
brew services start php
brew link php
;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment