10 ms·
yea but its optional so does it matter? In PHP its compulsory, right?
by cute_boi 5y ago
yea 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).