Considering how much time it took me to settle into a consistent coding style, I am no longer always so sure about what is required and what is optional.
I always end statements with a semi-colon. I always indent nested code. etc.
But statements do not need to end with a semi-colon, IF the statement is the only statement in a statement group.
Maybe others are more attentive to the presence or absence of a semi-colon if they later decide to add another statement to the group. For me it is easier to just always end a statement with one.
There is. Tested on php 5.6 and 7 - the semi-colon is mandatory. I suspect the OP didn’t copy and paste the code exactly as he is using it - otherwise the semi-colon would have been there. I think there might also be another typo like this - because there is no possibility for this code not to echo ‘yes’. If all this leads to nowhere then it might be useful to see the result of serialize($_POST) so that we can reproduce the case on the same set of data.
The semi-colon can be omitted after the last statement before a ?> closing tag, which helps avoid character noise when php is used as a template language where short php sections are frequent. If there is no ?> after a stament then the semi-colon is mandatory.