-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Improper formatting of PHP function namespaces #2887
Copy link
Copy link
Closed
Labels
Description
Information:
- Prism version: Newest
Description
While prism understands namespace declaration (namespace Hello), namespace definition (use Hello) and using classes with namespaces (new \Hello\Hi(); and \Hello\Hi::class), it doesn't understand function namespaces. In PHP, functions can be namespaced as well.
mb_string(); // call to a global function
\mb_string(); // namespace \ is global
\a\b\c\mb_string(); // function in \a\b\c namespaceIn Prism.js, the namespace parts \a\b\c are makred as .token.plain, which I don't believe they are.
Technical tips:
Only calls to methods need this checks - so it must be \w+\\\w+\(\). Namespaces and functions cannot start with letter. There can't be a space between namespaces and functions as well as between namespaces and backslashes.
Reactions are currently unavailable