I am guessing that there were either minor configuration changes or incompatibilities that prevented the newer version from running as hoped.
Installed 5.3.5 probably provided some newer version so of library files and made minor configuration changes that 'fixed' the errors you were having.
(I would still be on the look out for security holes though..especially if you are running this alongside a database which might be vulnerable to injection).
Going from v4 to v5.3.5 is a bit of a shift. Some of the older structures no longer function they way they used. That said, I would encourage you to attempt to update some of the outdated code to be more v5x compatible.
If you are working on a 'live' system, a second 'test' system might be in order..nothing fancy, just enough to test the code with the newer php. (you MIGHT be able to run them side-by side on two separate virtual servers on the same machine, but I would not recommend attempting it..It would be much better to make a duplicate copy of your existing system, and setup a 'plan of attack' for migrating it to the newer version of PHP..then upgrade that machine using that plan (modifying as needed)..then wiping it, duplicating the original machine again and using your plan to make sure that all goes very smooth and easy.
Once you have that down, start fixing the PHP code to work on the new version.
That way, when everything is ready, you can just execute the plan on the original machine (after a full backup of course), and copy over the new php code and yer all set.
Here is a guide that will help convert some of the old setup to the new.. not TOO much info, but some may be useful :
You might also want to go over some changes that are completely backwards incompatible (once you make them, older version will no longer work) :
You probably have to make some major changes to your setup and php files and that will take a while, so be prepared for the 'long haul'.. that said..once you have it, it will be much easier to maintain and should be more robust and faster.
useful places like http://www.HowToForge.com
will be your best resources for information and research to help you get through this process.
Keep in mind that if you run a very small personal lesser-used site, and security, stability, and speed are not much of an issue in your scenario, it may not be worth the effort..unless you just like the challenge and learning new things.
Good luck with everything!