summaryrefslogtreecommitdiff
path: root/pygments
diff options
context:
space:
mode:
authorRichard van Velzen <richard@goreply.com>2023-03-01 00:08:01 +0100
committerGitHub <noreply@github.com>2023-03-01 00:08:01 +0100
commit5b96a7f12bff42234054fd3a3f6751c1ac3aed18 (patch)
tree9df0cdc5a41d7f4f49ea73f260120c58dd169ed2 /pygments
parent80357823f6252a8b99c05bbd5338cf3be80bd052 (diff)
downloadpygments-git-5b96a7f12bff42234054fd3a3f6751c1ac3aed18.tar.gz
Fix lexing PHP anonymous classes with no parameters (#2359)
Diffstat (limited to 'pygments')
-rw-r--r--pygments/lexers/php.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/pygments/lexers/php.py b/pygments/lexers/php.py
index f48fa382..702bdd8d 100644
--- a/pygments/lexers/php.py
+++ b/pygments/lexers/php.py
@@ -205,6 +205,7 @@ class PhpLexer(RegexLexer):
(r'[~!%^&*+=|:.<>/@-]+', Operator),
(r'\?', Operator), # don't add to the charclass above!
(r'[\[\]{}();,]+', Punctuation),
+ (r'(new)(\s+)(class)\b', bygroups(Keyword, Text, Keyword)),
(r'(class)(\s+)', bygroups(Keyword, Text), 'classname'),
(r'(function)(\s*)(?=\()', bygroups(Keyword, Text)),
(r'(function)(\s+)(&?)(\s*)',