Skip to content

Commit e0ee93f

Browse files
authored
PHP: Added missing PHP 7.4 fn keyword (#2858)
1 parent 3786f39 commit e0ee93f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

components/prism-php.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
//
113113
// keywords cannot be preceded by "->"
114114
// the complex lookbehind means `(?<!(?:->|::)\s*)`
115-
pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,
115+
pattern: /((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|match|new|or|parent|print|private|protected|public|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,
116116
lookbehind: true
117117
}
118118
],

components/prism-php.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/languages/php/keyword_feature.test

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ exit
3030
extends;
3131
final
3232
finally
33+
fn
3334
for
3435
foreach
3536
function
@@ -109,6 +110,7 @@ yield from
109110
["keyword", "extends"], ["punctuation", ";"],
110111
["keyword", "final"],
111112
["keyword", "finally"],
113+
["keyword", "fn"],
112114
["keyword", "for"],
113115
["keyword", "foreach"],
114116
["keyword", "function"],

0 commit comments

Comments
 (0)