2020-04-20 17:15:43 +00:00
## Syntax highlighting for PHP.
2014-05-16 20:21:34 +00:00
2019-08-06 16:51:58 +00:00
syntax php "\.(php[23457s~]?|phtml|ctp)$"
2017-11-19 10:10:53 +00:00
magic "PHP script"
2016-05-25 20:13:50 +00:00
comment "//"
2008-03-20 04:45:55 +00:00
2014-05-16 20:21:34 +00:00
# PHP markings.
2008-03-20 04:45:55 +00:00
color brightgreen "(<\?(php)?|\?>)"
2017-05-16 09:34:24 +00:00
# Function names.
2017-12-09 15:29:56 +00:00
color white "\<[A-Za-z_][A-Za-z_0-9]*\("
2017-05-16 09:34:24 +00:00
# Variable names.
2017-12-09 15:29:56 +00:00
color cyan "\$[A-Za-z_][A-Za-z_0-9]*"
2008-03-20 04:45:55 +00:00
2014-05-16 20:21:34 +00:00
# Types.
2017-05-21 08:11:42 +00:00
color green "\<(array|bool|callable|const|float|global|int|object|string|var)\>"
2008-03-20 04:45:55 +00:00
2017-05-16 09:34:24 +00:00
# Directives and structure.
2017-12-09 15:29:56 +00:00
color brightcyan "\<(abstract|as|class|clone|(end)?declare|extends|function|implements|include(_once)?|inst(ance|ead)of|interface|namespace|new|private|protected|public|require(_once)?|static|trait|use|yield)\>"
color brightcyan "\<(case|catch|default|do|echo|else(if)?|end(for(each)?|if|switch|while)|final(ly)?|for(each)?|if|print|switch|throw|try|while)\>"
2017-05-16 09:34:24 +00:00
# Operators.
2017-12-09 15:29:56 +00:00
color brightcyan "\<(and|or|xor)\>"
2008-03-20 04:45:55 +00:00
2014-05-16 20:21:34 +00:00
# Control flow.
2017-05-15 07:52:14 +00:00
color magenta "\<(break|continue|goto|return)\>"
2008-03-20 04:45:55 +00:00
2014-05-16 20:21:34 +00:00
# Strings.
2017-05-16 09:34:24 +00:00
color brightyellow ""(\.|[^"])*"" "'(\.|[^'])*'"
2008-03-20 04:45:55 +00:00
2014-05-16 20:21:34 +00:00
# Comments.
2017-05-16 09:34:24 +00:00
color brightblue "(^|[[:space:]]+)//.*"
2008-03-20 04:45:55 +00:00
color brightblue start="/\*" end="\*/"
2014-05-16 20:21:34 +00:00
# Trailing whitespace.
2008-03-20 04:45:55 +00:00
color ,green "[[:space:]]+$"