I just ran into this. Took me and the team an hour to track down. This is amazing. I love PHP so much.
This is what caused it for us:
<php $code = "blah"; ?php> <EOF>
NEWLINE NOTE AT THE END OF A FILE
PHP, in all its transcendental beauty, will interpret this new line as something that you are actually trying to send to someone by wire. After all, this is HTML. As a result, the maximum of your newline character will be added to your answer, even if several PHP files in your include path end with a new line.
Pay special attention to the fact that any file that you include or require, if it ends on a new line, everything that you echo or print from your current file will be added to a new line.
Just. ASTONISHING.
source share