Skip to content

Conversation

@grandeljay
Copy link
Contributor

This PR changes some mentions of PHP statements which have brackets on them. It makes it looks like they are functions which they are clearly not. VS Code correctly describes them as statements. The tooltips should now reflect that too.

image

@roblourens
Copy link
Member

Sure, and I'm not a PHP expert but it seems common and idiomatic to include parens, even if they aren't required, right? Plus it seems that PHP includes them in error messages. If a require fails, I get Fatal error: require(): Failed opening required

@grandeljay
Copy link
Contributor Author

That is a very good point. I was browsing the official PHP doc and I found some arguments for my PR:

  • include

    Because include is a special language construct, parentheses are not needed around its argument.

  • require

    Remember, when using require that it is a statement, not a function.

    (found in the top voted user contribution)

As you may know PHP is a heavily criticised programming language and often rightfully criticized. There are many quirks and inconsistencies. I'm willing to bet the error message you received (require() instead of require) is also incorrect.

@roblourens roblourens added this to the November 2021 milestone Nov 22, 2021
@grandeljay
Copy link
Contributor Author

I also edited echo now

@roblourens roblourens merged commit d1640b7 into microsoft:main Nov 23, 2021
guibber pushed a commit to guibber/vscode that referenced this pull request Nov 30, 2021
…rom-statements

Remove brackets from PHP statements
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants