Good news! PHP 7.1 is being actively supported through 21 Nov 2024. After that point, it's advisable to upgrade to the latest version, since the PHP team will only offer security-related support until 21 Nov 2024, 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();"