Also, another case where it is hard to spot is when you have a file with just a function, I know it is not a common use case but it is annoying and had to spot the error.
The file above returns the erro Parse error: syntax error, unexpected end of file in
while the below does not.