PHP 7.2 reached end of life on 30 Nov 2020 and is no longer being updated. It's strongly recommended to upgrade to the latest version as soon as possible. You can read the official PHP migration guide here.
sudo apt update
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php7.2
sudo apt install php7.2-common php7.2-cli php7.2-curl php7.2-mbstring php7.2-mysql php7.2-xml
php -v
The output should display PHP 7.2.x
php -i
This will display detailed PHP configuration information
php -m
This will list all installed PHP modules