📄 php.test
字号:
PAF_FILE_SYMBOLS;f.php<>000003.000<>#<>foo<>fu;3.28<>3.9<>3.12<>{}}tcltest::test function-2.2 { function definition w arguments } { browse [save_file f.php {<?function foo($arg1 = "default") {}?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_FUNC_DEF;foo<>000003.009<>f.php;3.12<>0x0<>{}<>{}<>{arg1}<>{}PAF_FILE_SYMBOLS;f.php<>000003.000<>#<>foo<>fu;3.34<>3.9<>3.12<>{}}tcltest::test function-2.3 { function definition w arguments } { browse [save_file f.php {<?function foo($arg1 = "default", $arg2=1, $arg3 = 'default') {}?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_FUNC_DEF;foo<>000003.009<>f.php;3.12<>0x0<>{}<>{}<>{arg1,arg2,arg3}<>{}PAF_FILE_SYMBOLS;f.php<>000003.000<>#<>foo<>fu;3.62<>3.9<>3.12<>{}}tcltest::test function-2.4 { function definition w arguments } { browse [save_file f.php {<?function foo(&$arg1) {}?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_FUNC_DEF;foo<>000003.009<>f.php;3.12<>0x0<>{}<>{}<>{arg1}<>{}PAF_FILE_SYMBOLS;f.php<>000003.000<>#<>foo<>fu;3.23<>3.9<>3.12<>{}}tcltest::test function-2.5 { function definition w arguments } { browse [save_file f.php {<?function foo( $arg1, $arg2, $arg3) {}?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_FUNC_DEF;foo<>000003.009<>f.php;3.12<>0x0<>{}<>{}<>{arg1,arg2,arg3}<>{}PAF_FILE_SYMBOLS;f.php<>000003.000<>#<>foo<>fu;6.10<>3.9<>3.12<>{}}tcltest::test function-3.0 { xref to function in function } { browse_xref [save_file f.php {<?function foo() { bar();}?>}]} {PAF_CROSS_REF;#<>foo<>fu<>#<>bar<>fu<>p<>000004<>f.php;<>}tcltest::test function-3.1 { xref to function in function } { browse_xref [save_file f.php {<?bar();function foo() { bar();}?>}]} {PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>bar<>fu<>p<>000003<>f.php;<>PAF_CROSS_REF;#<>foo<>fu<>#<>bar<>fu<>p<>000006<>f.php;<>}tcltest::test function-3.2 { reset current function name } { browse_xref [save_file f.php {<?function foo_one() {bar();}bar();function foo_two() {bar ();}?>}]} {PAF_CROSS_REF;#<>foo_one<>fu<>#<>bar<>fu<>p<>000003<>f.php;<>PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>bar<>fu<>p<>000004<>f.php;<>PAF_CROSS_REF;#<>foo_two<>fu<>#<>bar<>fu<>p<>000005<>f.php;<>}tcltest::test function-3.3 { exit php mode inside a function } { browse_xref [save_file f.php {<?function foo() { ?>HTML call()<? bar();}?>}]} {PAF_CROSS_REF;#<>foo<>fu<>#<>bar<>fu<>p<>000005<>f.php;<>}tcltest::test function-3.4 { keywords not seen as call xref } { browse_xref [save_file f.php {<?function foo() { if (1) bar();}?>}]} {PAF_CROSS_REF;#<>foo<>fu<>#<>bar<>fu<>p<>000005<>f.php;<>}tcltest::test function-3.5 { keywords not seen as call xref } { browse_xref [save_file f.php {<?array();?>}]} {}tcltest::test function-3.6 { function result as function argument } { browse_xref [save_file f.php {<?bar( bar());?>}]} {PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>bar<>fu<>p<>000003<>f.php;<>PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>bar<>fu<>p<>000004<>f.php;<>}tcltest::test function-4.0 { function not finished at EOF } { browse [save_file f.php "<?function foo() \{?>"]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_FUNC_DEF;foo<>000003.009<>f.php;3.12<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.000<>#<>foo<>fu;5.0<>3.9<>3.12<>{}}tcltest::test function-4.1 { function not finished at EOF } { save_file f1.php "<?function foo() \{?>" save_file f2.php {<?function bar() {}?>} save_file files {f1.phpf2.php} set results [browse .php {-y files}] file delete files f1.php f2.php set results} {Status: Parsing: f1.phpPAF_FILE;f1.php;php<>PAF_FUNC_DEF;foo<>000003.009<>f1.php;3.12<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f1.php<>000003.000<>#<>foo<>fu;5.0<>3.9<>3.12<>{}Status: Parsing: f2.phpPAF_FILE;f2.php;php<>PAF_FUNC_DEF;bar<>000003.009<>f2.php;3.12<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f2.php<>000003.000<>#<>bar<>fu;3.17<>3.9<>3.12<>{}}tcltest::test function-4.2 { nested functions } { browse [save_file f.php {<?function foo() { function bar() { function baz() {} }}?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_FUNC_DEF;baz<>000005.017<>f.php;5.20<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000005.008<>#<>baz<>fu;5.25<>5.17<>5.20<>{}PAF_FUNC_DEF;bar<>000004.013<>f.php;4.16<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000005.008<>#<>bar<>fu;6.5<>4.13<>4.16<>{}PAF_FUNC_DEF;foo<>000003.009<>f.php;3.12<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000004.004<>#<>foo<>fu;7.1<>3.9<>3.12<>{}}tcltest::test function-4.3 { syntax error leads to nested function } { browse [save_file f.php {<?function foo() {'}'function bar() {}?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_FUNC_DEF;bar<>000005.009<>f.php;5.12<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000005.000<>#<>bar<>fu;5.17<>5.9<>5.12<>{}PAF_FUNC_DEF;foo<>000003.009<>f.php;3.12<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000005.000<>#<>foo<>fu;7.0<>3.9<>3.12<>{}}tcltest::test include-1.0 { include a file } { browse [save_file f.php {<? include("f2.php");?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000003.013<>f.php;3.19<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.013<>#<>f2.php<>iu;3.19<>3.13<>3.19<>{}}tcltest::test include-1.1 { include a file } { browse [save_file f.php {<? include ("f2.php");?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000003.014<>f.php;3.20<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.014<>#<>f2.php<>iu;3.20<>3.14<>3.20<>{}}tcltest::test include-1.2 { include a file } { browse [save_file f.php {<? include "f2.php";?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000003.010<>f.php;3.16<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.010<>#<>f2.php<>iu;3.16<>3.10<>3.16<>{}}tcltest::test include-1.3 { include a file } { browse [save_file f.php {<? include 'f2.php';?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000003.010<>f.php;3.16<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.010<>#<>f2.php<>iu;3.16<>3.10<>3.16<>{}}tcltest::test include-1.4 { include a file } { browse [save_file f.php {<?include'f2.php';?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000004.001<>f.php;4.7<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000004.001<>#<>f2.php<>iu;4.7<>4.1<>4.7<>{}}tcltest::test include-1.5 { include a file } { browse [save_file f.php {<?include( "f2.php" );?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000003.010<>f.php;3.16<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.010<>#<>f2.php<>iu;3.16<>3.10<>3.16<>{}}tcltest::test include-1.6 { include a file } { browse [save_file f.php {<?include( "f2.php" );?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000003.010<>f.php;3.16<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.010<>#<>f2.php<>iu;3.16<>3.10<>3.16<>{}}tcltest::test include-1.7 { include two files } { browse [save_file f.php {<?include('one.php');include('two.php');?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;one.php<>000003.009<>f.php;3.16<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.009<>#<>one.php<>iu;3.16<>3.9<>3.16<>{}PAF_INCLUDE_DEF;two.php<>000004.009<>f.php;4.16<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000004.009<>#<>two.php<>iu;4.16<>4.9<>4.16<>{}}tcltest::test include-1.8 { include two files } { browse [save_file f.php {<?include('one.php'); include('two.php');?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;one.php<>000003.009<>f.php;3.16<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.009<>#<>one.php<>iu;3.16<>3.9<>3.16<>{}PAF_INCLUDE_DEF;two.php<>000003.029<>f.php;3.36<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.029<>#<>two.php<>iu;3.36<>3.29<>3.36<>{}}# This one is really tricky to deal with because the scanner# would have already eaten up the ; from the previous match.# We don't want to match on things that are not the whole# keyword. This might only be fixable by moving to a# bnf based parser.tcltest::test include-1.9 { include two files } { browse [save_file f.php {<?include('one.php');include('two.php');?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;one.php<>000003.009<>f.php;3.16<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.009<>#<>one.php<>iu;3.16<>3.9<>3.16<>{}PAF_INCLUDE_DEF;two.php<>000003.028<>f.php;3.35<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.028<>#<>two.php<>iu;3.35<>3.28<>3.35<>{}}tcltest::test include-1.10 { not an include keyword } { browse [save_file f.php {<?notinclude 'f1.php';?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>}tcltest::test include-1.11 { not an include keyword } { browse [save_file f.php {<?not_include 'f1.php';?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>}tcltest::test include-2.0 { other include keywords } { browse [save_file f.php {<?include("f2.php");?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000003.009<>f.php;3.15<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.009<>#<>f2.php<>iu;3.15<>3.9<>3.15<>{}}tcltest::test include-2.1 { other include keywords } { browse [save_file f.php {<?include_once("f2.php");?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000003.014<>f.php;3.20<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.014<>#<>f2.php<>iu;3.20<>3.14<>3.20<>{}}tcltest::test include-2.3 { other include keywords } { browse [save_file f.php {<?require("f2.php");?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000003.009<>f.php;3.15<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.009<>#<>f2.php<>iu;3.15<>3.9<>3.15<>{}}tcltest::test include-2.4 { other include keywords } { browse [save_file f.php {<?require_once("f2.php");?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;f2.php<>000003.014<>f.php;3.20<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.014<>#<>f2.php<>iu;3.20<>3.14<>3.20<>{}}tcltest::test include-2.5 { can't include filename with embedded vars } { browse [save_file f.php {<?require_once("$var.php");?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>}tcltest::test include-2.6 { semicolon required } { browse [save_file f.php {<?require_once "one.php"?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>}tcltest::test include-2.7 { no semicolon required with parens } { browse [save_file f.php {<?require_once("one.php")?>}]} {Status: Parsing: f.phpPAF_FILE;f.php;php<>PAF_INCLUDE_DEF;one.php<>000003.014<>f.php;3.21<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f.php<>000003.014<>#<>one.php<>iu;3.21<>3.14<>3.21<>{}}tcltest::test operator-1.0 { assignment operator } { browse_xref [save_file f.php {<?$var = 1;?>}]} {PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000003<>f.php;<>UNDECLARED}tcltest::test operator-1.3 { assignment operators } { browse_xref [save_file f.php {<?$var += 1;$var -= 1;$var *= 1;$var /= 1;$var .= 1;$var %= 1;$var &= 1;$var |= 1;$var ^= 1;$var <<= 1;$var >>= 1;?>}]} {PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000003<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000003<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000004<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000004<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000005<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000005<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000006<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000006<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000007<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000007<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000008<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000008<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000009<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000009<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000010<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000010<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000011<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000011<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000012<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000012<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000013<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>w<>000013<>f.php;<>UNDECLARED}tcltest::test operator-2.0 { not an assignment operator } { browse_xref [save_file f.php {<?$var == 1;?>}]} {PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000003<>f.php;<>UNDECLARED}tcltest::test operator-2.1 { not an assignment operator } { browse_xref [save_file f.php {<?$var === 1;?>}]} {PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000003<>f.php;<>UNDECLARED}tcltest::test operator-2.2 { not an assignment operator } { browse_xref [save_file f.php {<?$var != 1;?>}]} {PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000003<>f.php;<>UNDECLARED}tcltest::test operator-2.3 { not an assignment operator } { browse_xref [save_file f.php {<?$var . = 1;$var , = 1;?>}]} {PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000003<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000004<>f.php;<>UNDECLARED}tcltest::test operator-2.4 { not an assignment operator } { browse_xref [save_file f.php {<?$var > = 1;$var < = 1;$var ! = 1;$var and 1;?>}]} {PAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000003<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000004<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000005<>f.php;<>UNDECLAREDPAF_CROSS_REF;#<>GLOBAL<>fu<>#<>var<>gv<>r<>000006<>f.php;<>UNDECLARED}tcltest::test multi-1.0 { process multiple files } { save_file f1.php {<?function foo() {}?>} save_file f2.php {<?function bar() {}?>} save_file files {f1.phpf2.php} set results [browse .php {-y files}] file delete files f1.php f2.php set results} {Status: Parsing: f1.phpPAF_FILE;f1.php;php<>PAF_FUNC_DEF;foo<>000003.009<>f1.php;3.12<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f1.php<>000003.000<>#<>foo<>fu;3.17<>3.9<>3.12<>{}Status: Parsing: f2.phpPAF_FILE;f2.php;php<>PAF_FUNC_DEF;bar<>000003.009<>f2.php;3.12<>0x0<>{}<>{}<>{}<>{}PAF_FILE_SYMBOLS;f2.php<>000003.000<>#<>bar<>fu;3.17<>3.9<>3.12<>{}}# FIXME: Add check for function call inside function arguments,# is that valid? Later: I don't think this is valid, if we# don't match a known pattern the whole function decl is# ignored, is that the right approach to take or should# we still process the function even if the args are confused?# FIXME: Check for parens inside function argument, what if# they are not matched?# FIXME: What if a function call includes a syntax error,# should we still see this as a function invocation?# for example "foo(];" or "foo(;" does the close paren# need to be there for a function call to be seen?# We don't currently report a function name when inserting# comments. Not clear how we would implement this since# comments are stripped before token matching.# It might also be good to check the return value# of the sn_insert_comment if there is one.# When should we do with <? CODE ?> when already in PHP mode?# The docs for function don't mention this usage, but I noticed# an example like "func($ref=$defaultValue) { ... }", should this be supported?# There seems to be a double var deref syntax that I have not# seen before:# function show($arrayName) {# global $$arrayName;# print_r($$arrayName);# )# show('myArray');# There could be a problem with VDOUBLE_QUOTED_STRING# not being accepted as a default argument value# in a function declaration.# FIXME: What if $var['hi'] appears in heredoc does that# just match $var and ignore the rest?# Should the global variable access symbol be extended# to include the full text of the global? This would# make is so that '$var[0] = 1;" would see a define# range of 0 to 7 instead of just 1 to 4. That would# make the combobox display the variable name over# the whole range instead of just over the highlight.# display order for nested functions is messed up.# The outer function needs to be added first so# that the tag is visible. Not sure how we can# work this since the function stack causes it.# Also, columns and lines for nested functions# seems to be hosed.# function foo() {# function bar() {# print hi;# }# }# Fix var highlight for array vars with named elements## $row->cat_id# Emit a PASS xref when a variable is passed as an# argument to a function "foo($var)".# cleanupfile delete f.phpfile delete xoutfile delete toutfile delete hout::tcltest::cleanupTestsreturn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -