XAMPP is a great package to quickly get up and running with Apache, PHP, Perl and MySQL. Here we going to teach how to upgrade PHP on XAMPP
1. Download the latest binary version of PHP from php.net (make sure to get the .zip package not the installer)
2. De-archive it to a directory (prefered location)
3. Copy the contents of the directory in the php subfolder of your XAMPP installation directory, overwriting the files which are already present
4. Overwrite the files which are already present in the apache\bin directory with the newer versions.
5. Now the trick: take the files which have a _2 in their names (for example php5apache2_2.dll or php5apache2_2_filter.dll), copy them in the apache\bin subdirectory and remove the _2 part, overwriting the existing files. This is necessary because by XAMPP uses Apache version 2.2 and the files with the 2 prefix are built for Apache 2.0, so you must take the files build for the newer version (which has a different plugin interface) and rename them in the filenames XAMPP expects.