It seems like the 0a
problem was caused by a trailing Enter character in a PHP file included by my main PHP file. When I removed it from the include file, the 0a
character in my output disappeared.
What I find peculiar about this is the different handling of whitespace between PHP versions that I experienced, and the fact that I still got the 0a
when testing the community's suggestions.
I have no more time to put research into this, but my advice to people experiencing similar problems is to check whether whitespace in include files may play into the equation. In addition, avoid ending the <?php
tag as suggested by Dan below.