Skip to content

[PHP] When code begins with class, class-name after it is not matched. #2614

@TomPavelec

Description

@TomPavelec

Information

  • Language: PHP
  • Plugins: none

Description
When code begins with class | interface | trait the class-name after it is not matched.
When an whitespace is added before class the class-name is matched correctly.

I know that correct php code starts with <?php and then first class-name is matched correctly.
But opening tag is often dropped in code snippets fot better readability (blogs, docs, ..) and then this is an issue.

Code snippet

The code being highlighted incorrectly. Class name `First` is not matched.
class First {}
class Second {}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions