Multiple versions of php on Ubuntu 14.04 server

Reading doumentation I see its possible to install multiple versions of php in Centos but can someone explain how to do this with Ubuntu?
I have a script that needs an older version of php.
Thanks in advance.