This error is happening because the BOM signature is enabled for the page.
Go to Modify -> Page Properties
in the Title / Encoding section, uncheck the Include Unicode Signature (BOM) option.
NOTE: when you added the error reporting code block, you also included a blank line between php blocks. you will need to also delete the blank line at line 5.
see this post for more details on the headers already sent error: