doc-en
doc-en copied to clipboard
Operator / Syntax (Symbols) Search
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:
- https://github.com/php/doc-en/issues/3519
- https://github.com/php/doc-en/issues/3515
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?