For the benefit of other beginners, it's worth noting that the brace that closes a block need not be followed by a semicolon, and, in some cases (e. g.. the closing brace of a function), it might even be a syntax error.

One thing to remember is, if you decide to omit the closing PHP tag, then the last line of the file should be ended with semi colon. If you add the closing tag then last line doesn't need to end with semi colon.

<?phpecho "First line";echo "Last line"

The above code throws error as it neither has closing tag nor semicolon ending. So it should be replaced with either of the below two