Skip to content

Add support for @ and magic constants in search - #1813

Open
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:fix/search-special-chars-974
Open

Add support for @ and magic constants in search#1813
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:fix/search-special-chars-974

Conversation

@lacatoire

@lacatoire lacatoire commented Feb 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Fixes Add support for @, magic constants in PHP web search #974
  • manual-lookup.php now checks is_known_term() and is_known_variable() before falling back to find_manual_page(), so searching for @ now resolves to the error control operator page
  • Adds all magic constants (__LINE__, __FILE__, __DIR__, __FUNCTION__, __CLASS__, __TRAIT__, __METHOD__, __PROPERTY__, __NAMESPACE__) to both $uri_aliases in error.php and is_known_term() in errors.inc

@derickr derickr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are conflicts in this PR now.

@lacatoire
lacatoire force-pushed the fix/search-special-chars-974 branch 2 times, most recently from f337edd to fa6d2c3 Compare September 1, 2026 13:20
The manual-lookup search did not consult is_known_term() or
is_known_variable(), so searching for operators like @ or magic
constants like __LINE__ returned no results. Now these are checked
before falling back to the manual page lookup.

Also adds all magic constants (__LINE__, __FILE__, __DIR__, etc.)
to both $uri_aliases and is_known_term().
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📊 Regression report for commit 47d0578 is at https://web-php-regression-report-pr-1813.preview.thephp.foundation

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview for commit 47d0578 is available at https://web-php-pr-1813.preview.thephp.foundation

Comment thread include/errors.inc
'yield from' => 'language.generators.syntax.php#control-structures.yield.from',
'yield' => 'language.generators.syntax.php#control-structures.yield',

'__line__' => 'language.constants.magic.php',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to add two entries? After the redirect via is_known_term, the request won't reach uri_aliases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for @, magic constants in PHP web search

3 participants