5.6 to 7.2 :

/usr/sbin/pkg info -xo ^php | /usr/bin/awk '{ gsub("56","72",$2); print  " -o "$2" "$1}' | /usr/bin/xargs -L 1 /usr/local/sbin/portupgrade -by

7.2 to 7.3:

pkg info -xo php72 | awk '{ gsub("72","73",$2); print " -o "$2" "$1}' | xargs -L 1 portupgrade -by

 

7.3 to 7.4:

pkg info -xo php73 | awk '{ gsub("73","74",$2); print " -o "$2" "$1}' | xargs -L 1 portupgrade -by

 

7.2 to 8.0:

pkg delete php72-hash php72-json; pkg info -xo ^php ^mod_php | grep php72 | awk '{gsub("72","80",$2); print " -o "$2" "$1}' | xargs -L 1 portupgrade -DbkycC --batch