Remove brackets from PHP statements by grandeljay · Pull Request #137447 · microsoft/vscode (original) (raw)
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation4 Commits3 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
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.
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
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.
Jay Trees added 2 commits
guibber pushed a commit to guibber/vscode that referenced this pull request
…rom-statements
Remove brackets from PHP statements
2 participants