it's likely the editor that you're using. It definitely is a new line error (\r\n). \r is used by linux-like systems, and \n by windows-like systems (or the other way around, google if you want to know). Your editor probably only uses one version of these (which I've seen more often on mac). Generally, every enter that you press, generates the \r\n characters, which are then rendered to new lines.
I recommend copy/pasting the code you have written to some other simple text editors, and saving it as a PHP file, just to see how it goes. I'll give you a good bet that one of them will have no parse errors, while others do.
You can read the code properly because your OS uses the line breaks you have used. The system you're running your scripts on is not.
Thinking of it, I think if you add a space (with the spacebar) after the <?php starting code (so it becomes <php(space here), the parse error will move, possibly to another funciton, but still line 1 (since there are no linebreaks! all your code is on 1 line on your server 🙂 )
Wow I feel so energetic now haha.
Makes any sense?