Skip to content

How can I find the documentation for the ??= operator? #3515

@speller

Description

@speller

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions