3 ms·
I mean, it clearly has them; it's part of the syntax. You can skip them, and the parser will insert them for you; but the language has them.
by azangru 5y ago
I mean, it clearly has them; it's part of the syntax. You can skip them, and the parser will insert them for you; but the language has them.
- cute_boi 5y agoyea but its optional so does it matter? In PHP its compulsory, right?
- Minor49er 5y agoSometimes the extra options can produce unexpected problems. For example, in JavaScript, this would return nothing and may result in an unreachable code warning: function go() { return 5 + 3; } console.log(go()) Since semicolons are optional, it's treating "return" as its own statement and "5 + 3" as a separate one. There are no hidden gotchas like this in PHP though since semicolons are always used: function go() { return 5 + 3; } var_dump(go()); This will return int(8).