Good news! PHP 7.1 is being actively supported through 18 Jan 2025. After that point, it's advisable to upgrade to the latest version, since the PHP team will only offer security-related support until 18 Jan 2025, at which point PHP 7.1 will be considered "end-of-life".
brew update
brew install [email protected]
brew link [email protected] --force
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
php -v
php --ini
php -r "phpinfo();"