On Monday, July 30, 2018 at 2:45 AM Abdul Haque Sheikh <khaweronline@gmail.com> wrote:
> why not to make semicolon not required if there is only 1 statement
> like javascript. semicolon will be required if there are multiple
> statements on the same line.
Because this "feature" of JavaScript leads to confusing code and unintended bugs
(see examples at https://codeburst.io/why-i-prefer-to-use-semicolon-in-javascript-f00c303547).
Many JS projects end up relying on a linter to require semicolons and avoid these issues.
The fact that PHP requires semicolons is one of the things I like about the language.
Best regards,
Theodore Brown