Get the latest stable release of PHP:
Open a terminal(Ctrl+Alt+t) and cd to the directory where you downloaded the tar ball and then type:
tar -zxvf php-5.5.8.tar.gz
After the extraction has completed, type
cd php-5.5.8
./configure
make
sudo make install
Log out and log in to reload all packages that depend on PHP and you will have PHP version 5.5.8!
For a detailed instruction manual, refer to the INSTALL file in the extracted directory and scroll down to Installation on Unix systems.
Before updating, when I did php --version, I got:
PHP 5.4.6-1ubuntu1.5 (cli) (built: Dec 12 2013 04:39:44)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
After updating, php --version gives me:
PHP 5.5.8 (cli) (built: Jan 22 2014 21:12:05)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies