-
Notifications
You must be signed in to change notification settings - Fork 707
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 and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function trailing commas #241
Conversation
Crell
commented
Nov 25, 2020
- Trailing commas in function parameter list.
- Trailing commas in use clause.
- Minor language change along the way.
- I have no idea what the difference is between para and simplepara...
language/functions.xml
Outdated
$second_arg, | ||
$a_very_long_argument_name, | ||
$arg_with_default = 5, | ||
$again = 'a default string', // This trailing comma is optional as of PHP 8.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel how this comment is written it means that prior to PHP 8.0.0 the trailing comma was mandatory
That said, I think that currently PhD treats both pretty similar, and in practise, the documentation mostly uses |
I think the only important distinction is when it's inside a
whereas with a para you get:
|
Updated the comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
Thanks! It seems that the manual is generally sloppy regarding the term "argument", so I left it as is, but in the long run we may consider to distinguish between "parameter" and "argument" (or "formal parameter" and "actual parameter"). |
What even is the difference between an argument and a parameter? I've generally seen/used them interchangeably. |
Huh, I've been getting the proper order wrong then apparently, oh well TIL |