PHP was quite possibly corrupted on upload. If the line breaks are missing, the script will fail.
Which line break type do you have set in Preferences > Code Format?
Which OS do you use?
Are you on Windows or Linux server?
I'm definitely having a 'should have just stayed in bed' day.
The information I omitted was that I am running this on a localhost server.
It's Windows 7 and I use cr/lf.
It seems strange to me that as there have been no changes at all to any aspect of the code and it works in perfectly in CS4 but not CS6.
Also it worked in CS6 prior to the latest update a few days ago.
Maybe I should take up road sweeping instead