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.
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. |
|
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 |