OK, so, I've been using auto-loaders for a while, become rather used to MVC, and decided to try to tackle namespaces. Well, this hasn't worked as expected. I have managed to reproduce the error in a very simple way, so the contents of my php file read:
<?php namespace site\test; echo 'hello';
The output is not what I expected:
Fatal error: Namespace declaration statement has to be the very first statement in the script in file on line 2
I'm running PHP 5.3.10 on a Synology NAS, using the latest version of DSM (Synology's OS). This makes use of Apache v2.2.22. I can confirm that commenting out the "namespace" line returns the word "hello", with no extra characters before it.
There is no BOM at the beginning of the file. I also have no issues with setting headers such as "Location" which would suggest this as being an issue.
Line endings are Unix ( only) and the character encoding of the file is UTF8.
The PHP setting "auto_prepend_file" is empty.