To upgrade your current PHP to the lastest PHP version using XAMPP, Follow these simple steps:

  1. Donwload and Install XAMPP
  2. Setup you Environment Variables PATH to the new php.exe file in XAMMP. (example: c:\xampp\php)
  3. Be sure to remove older PHP Environment Variables PATH
  4. Open the terminal and check the version you are running: > php -v
  5. This was the output I got:

PS C:\Users\15t> php -v
PHP 8.1.12 (cli) (built: Oct 25 2022 18:16:21) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.12, Copyright (c) Zend Technologies
PS C:\Users\15t>

These instructions helped me find my solution: https://stackoverflow.com/a/68194088

Done.