It appears you are using Ubuntu 10.04? This release offers stable, well-tested software from April (.04) 2010 (10.).
If you want newer software then you need to go outside the Ubuntu repositories and download/install PHP from another source as j-ray suggests. Or you can upgrade to a newer Ubuntu release, which will upgrade all of your packages at once to newer versions. For example if you go to 12.04 you will get stable software from April (.04) 2012 (12.) such as PHP 5.3.10.
Is there a reason you specifically need 5.3.5? 5.3.5 was superceded in March 2011 by 5.3.6 which offered "over 60 bug fixes, some of which are security related." The latest PHP version is 5.5.0 and the current 5.3.x is 5.3.26.
Also keep in mind that the PHP 5.3.2 in the Ubuntu 10.04 repositories is not
actually 5.3.2; rather, Ubuntu developers have been "backporting" security patches and bug fixes from newer PHP releases over the past 3 years. If you bypass the Ubuntu repos and manually install a different PHP then you will not get the benefit of this support from Ubuntu security team. You can read the changelog here:
http://changelogs.ubuntu.com/changel...4.19/changelog