Updating PHP version on your macOS is something that you need to do from time to time. As new PHP versions are coming out you would have to update PHP version on your macOS. So, here is how to do it:

first check your current version by typing this command:

                    php -v
                  

if your PHP needs to be updated type this line:

                    curl -s https://php-osx.liip.ch/install.sh | bash -s 7.3

                  

"7.3" is going to be updated version - please change this number to latest version.

Wait until update process is finished, and check your php version again:

                    php -v
                  

if you still do not see your new version installed, you need to switch to that version:

                    export PATH=/usr/local/php5/bin:$PATH
                  

and now try again with:

                    php -v
                  

This time you should see something like this:

                    PHP 7.3.8 (cli) (built: Aug 11 2019 20:50:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.8, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans
                  

 

Good thing with this approach is that you will get out of the box many cool plugins, including xdebug, redis, zip, OPcache... many others

                    apcu
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
igbinary
imap
intl
json
libxml
mbstring
mcrypt
mongodb
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
propro
raphf
readline
redis
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache