php / php/doc-en

How can I find the documentation for the `??=` operator?

Open
#3,515 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

Imagine I'm a newbie and I see the ??= operator in some code. How can I learn about it?

  1. What is the type of this operator? When I visit the Operators help page https://www.php.net/manual/en/language.operators.php, I can't find it by searching on the page.
  2. I'm clicking randomly on the operator type pages (Operator Precedence, Arithmetic, etc). I can find that it's an Assignment operator on the Operator 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 the Other Assignment Operators section with no description, just another type of the operator.
  3. Okay, I see that this operator is mentioned as Null Coalesce in the Other 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.
  4. Okay, let me try the search field of the php.net website. But again nothing, I get ??= doesn't exist.
  5. When I try searching in Google "??=" site:php.net I'm still getting nothing.

Why is getting information about this "secret" operator so difficult? I would suggest the following improvements:

  • Mentioning all existing operators on the 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.
  • Add explicit documentation for the ??= operator to a corresponding help page.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Operators, assignment operators, and comparison operator pages linked in the issue, then trace how the ??= operator is currently referenced. Document the operator explicitly and make it discoverable from the Operators page and site search; done means users can identify its type and find its description through the documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.