php / php/web-php

Operator / Syntax (Symbols) Search

Open
#1,761 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement
Dominant language
PHP
Stars
1.1k
Forks
640
Avg merge
22h 36m
Merged PRs (30d)
16

Description

Affected page

N/A (Search box)

Current issue

Users may come across operators (and other syntax symbols) in code they don't know, and/or don't know what the name for an operator is. This can make them very hard to find documentation for.

Suggested improvement

Add operators (and other non-word syntax) to the search feature.

For best results I think partial matches should work. eg:

  • ? would match ternary, ?:, ?? and ??=
  • : would match ternary, ?: and (static) class access
  • [ would match arrays and list
  • '.' would match concatenation, splat and spread

(I may have missed other potential matches from these examples - this is just "off the top of my head")

Additional context

Related issues:

Recently seen chat query:

[, $target] = explode('://', $uri, 2); I encountered this line in some code, searching online is tricky with this kind of thing, what is this syntax called?

Contributor guide

Open the contributing guide

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 at the search box implementation and read related issues 3519 and 3515 to understand the existing search behavior and scope. Define how partial matches for operators and other non-word syntax should work; the work is done when examples such as ?, :, [, and . find their relevant documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.