Skip to content
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

Finding the ... operator for argument unpacking #3519

Open
LouFromAsgard opened this issue Jul 1, 2024 · 2 comments
Open

Finding the ... operator for argument unpacking #3519

LouFromAsgard opened this issue Jul 1, 2024 · 2 comments

Comments

@LouFromAsgard
Copy link

Hello everyone it's the first time I try to contribute to the php documentation.
I find the ... operator for argument unpacking very useful.
I found it only today using a topic on stackoverflow here where we can find a comprehensive example and a link to the documentation page from function arguments documentation page here
I also found another page here on php doc page that was probably a proposal at first, right? And another from the new features of php 5.6 here.
Well, in this proposal and the new features for 5.6, the ... token was called an operator.
My question is : is it an operator ?
And if it is one, should it be listed inside the operators precedence page ?
The problem here is that I find it very difficult for anyone to find this ... construct because it is not documented as an operator in this page, and it is not searchable as is because it is made of symbols - neither on php.net nor on any search engine that I know of.
Do you think you could add it to the operators precedence page ?
It is my humble opinion that it would ensure a larger audience for this topic, what do you think?
I hope I didn't intrude too much. And I respectfully ask that you forgive me if my English lacks refinement... well I'm french.
Thank you for reading my prose so far.

@cmb69
Copy link
Member

cmb69 commented Aug 7, 2024

Well, ... (aka elipsis) is not a proper operator which can be used in an expression like the other operators.

The problem here is that I find it very difficult for anyone to find this ... construct because it is not documented as an operator in this page, and it is not searchable as is because it is made of symbols - neither on php.net nor on any search engine that I know of.

Indeed, that is a problem that had been reported several times.

Maybe there should be new page in the documentation for, eh, "special operators" where ..., =>, ::, etc. could be listed, or somehow make https://www.php.net/manual/en/tokens.php more prominent.

@LouFromAsgard
Copy link
Author

Thank you for your kind answer.
I didn't know of the Tokens page, this is very useful because once we are on it, we can use the "search in page" feature of the web browser to search for any kind of token, including the ones made of symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants