AngularJS, PHP - line breaks required to pass exercise

I have used CodeAcademy to quickly start AngularJS and now PHP. It is really frustrating that you expect random linebreaks to get an approved solution.

For example:

function displayName() {
            echo "Stuff";
// This linebreak is required        

There are other similar cases in the same course. This could be confusing to people that are all new to code. And it is just really annoying trying to figure out what is wrong when the code is OK,

Another thing is that it breaks on every second assignment. It shows the running animation but does nothing. Then I have to reload (which is slow) and resubmit the code.

I think this is done on purpose.
The technical term is ‘whitespace’ and it is just when you leave a horizontal line free from characters in order to allow you, and the thing running the code to be able to read and execute the code more efficiently.

If anyone has specific examples where a blank line is required to pass an exercise, please post the URLs and full details.