diff options
-rw-r--r-- | pygments/lexers/php.py | 2 | ||||
-rw-r--r-- | tests/examplefiles/test.php | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/pygments/lexers/php.py b/pygments/lexers/php.py index 9bee6d2e..091cf93f 100644 --- a/pygments/lexers/php.py +++ b/pygments/lexers/php.py @@ -137,7 +137,7 @@ class PhpLexer(RegexLexer): ], 'php': [ (r'\?>', Comment.Preproc, '#pop'), - (r'<<<([\'"]?)(' + _ident_inner + r')\1\n.*?\n\2\;?\n', String), + (r'<<<([\'"]?)(' + _ident_inner + r')\1\n.*?\n\s*\2;?\n', String), (r'\s+', Text), (r'#.*?\n', Comment.Single), (r'//.*?\n', Comment.Single), diff --git a/tests/examplefiles/test.php b/tests/examplefiles/test.php index 218892fe..2ce4023e 100644 --- a/tests/examplefiles/test.php +++ b/tests/examplefiles/test.php @@ -504,4 +504,12 @@ function &byref() { $x = array(); return $x; } + + echo <<<EOF + + Test the heredocs... + + EOF; + ?> + |