Using Homebrew, Homebrew-PHP and the RVM-like brew-php-switcher you can easily switch between multiple installed versions of PHP on your OS X machine (Mavericks 10.9 to El-Capitan 10.11).
xcode-select --install # install the command line tools, if missing
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update && brew doctor