Please refer to the following article for how to change the PHP version.
how to change the PHP version
How to check using a PHP file
STEP 1: Open a text editor and write the following content.
<?php echo phpversion(); ?>
STEP 2: Save the file with a name such as version.php.
STEP 3: Upload the saved file to the root directory of the domain you want to check.
STEP 4: Open the uploaded file in your browser and check the displayed version.
STEP 5: After confirmation, delete the uploaded file.
Reference external link
There is also a method of checking the version by executing a command, but the version may differ from the version when the website is actually displayed.
The PHP executed in the cPanel Terminal or SSH connection is different from the PHP executed when browsing the website.
Therefore, the PHP version displayed by the "php --version" command may differ from the version confirmed by the confirmation method using the PHP file described on this page.