I assure you it works..
sudo su user
$ php -v
PHP 8.3.15 (cli) (built: Dec 19 2024 15:04:32) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.15, Copyright (c) Zend Technologies
with Zend OPcache v8.3.15, Copyright (c), by Zend Technologies
Change php from dashboard
$ Killed
sudo su user
$ php -v
PHP 8.2.27 (cli) (built: Dec 19 2024 15:04:38) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.27, Copyright (c) Zend Technologies
with Zend OPcache v8.2.27, Copyright (c), by Zend Technologies