-
Notifications
You must be signed in to change notification settings - Fork 731
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
How can I find the documentation for the ??=
operator?
#3515
Comments
If you're skimming through pages looking for a quick answer, you're probably going to have a hard time. PHP is complicated, and the documentation works much better when you slow down and read it. The operators page is a good place to start. It's a short page, and the last paragraph says
So then there's the Operator Precedence page. It has a table there of everything, and In the Asssignment Operators page, I see a the part where it says
Ah. That sounds like maybe (Truth is that The next step is following the link given that places you at the Null Coalescing Operator section within the Comparison page. That... well, doesn't need to be summarized, but it explains what So now you know that
Virtually every search engine in existence doesn't support searching for symbols. So yes, not being able to search for information about operators in any language is a common problem for everyone, which is why it's a Good Thing to know where to find the general operators documentation for your desired language(s).
Most of the documentation's various chapters and sections start with an introductory page. The Operators chapter is the same way. The very next page after it contains exactly the sort of list you want.
How so? Do you mean a separate page just about I'm all for improving documentation, and I'm not at all trying to say that everything is fine here and the problem is with you, but keep in mind that sometimes you have to learn how a documentation site is meant to be read before you can read it to find answers. So there's dumping all information in one page, and creating tons of small pages for every single operator. What other ideas would help you? |
I know that RTFM is the best answer. But that is not what people expect.
You assume that the reader person has your mind and the same knowledge as yours to make the same assumptions. While some assumptions may be obvious to you, it doesn't mean they're obvious to everyone. Because your assumptions are based on your existing knowledge. But if the person doesn't have this knowledge, it'll be not easy to come to the same conclusion.
I'm okay with that. Just one more click to the user's goal. Who cares about user experience in the documentation, huh? (sarcasm)
Yes, really need to explain a language operator clearly.
If there are many operators with the same pattern, then I would suggest listing all of them in a line to make them available for the browser's page search and giving a couple of examples explaining the pattern. It can be a separate page about combined operators. In my opinion, if there's a term "combined operator" in the language, it definitely requires a clear explanation with listing all operators of this type. Probably, a separate page for combined operators would be a good place. With links to/from all other operator types which can be combined. |
Dark magic. :) Anyway, this is related to #3519, and https://www.php.net/manual/en/tokens.php is a good starting place to use the search function of your browser. |
Imagine I'm a newbie and I see the
??=
operator in some code. How can I learn about it?Operators
help page https://www.php.net/manual/en/language.operators.php, I can't find it by searching on the page.Operator Precedence
,Arithmetic
, etc). I can find that it's an Assignment operator on theOperator Precedence
page. But when I get to the https://www.php.net/manual/en/language.operators.assignment.php page, I can't find any description. This operator is mentioned in theOther Assignment Operators
section with no description, just another type of the operator.Null Coalesce
in theOther Assignment Operators
section. When I go to the https://www.php.net/manual/en/language.operators.comparison.php#language.operators.comparison.coalesce page, there's NO description of this operator, it is not mentioned anywhere.??= doesn't exist
."??=" site:php.net
I'm still getting nothing.Why is getting information about this "secret" operator so difficult? I would suggest the following improvements:
Operators
help page to enable users to quickly identify the type of operator they're looking for by using the browser's search on page function. It probably should be a table with links to corresponding help pages.??=
operator to a corresponding help page.The text was updated successfully, but these errors were encountered: