If you are in PHP code block, then white space does nothing. But by placing ?> you tell PHP when your scripts ends. And outside PHP code block, white space is just being sent to the client. So if you keep ?> and the space is after it then it will be sent. And if output of your script is something downloadable, said space will "join" the byte stream user saves. By removing ?> you are not telling explicitly PHP where your code ends, and in that case it will automatically end with end of source file. And white space is a bitch to track as usually it is "invisible" due to editor settings (and for that reason I set my syntax highlighting to show spaces in different color than background color is)