First commit
This commit is contained in:
commit
c6e2478c40
13918 changed files with 2303184 additions and 0 deletions
17
vendor/nikic/php-parser/test/code/parser/stmt/loop/do.test
vendored
Normal file
17
vendor/nikic/php-parser/test/code/parser/stmt/loop/do.test
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
Do loop
|
||||
-----
|
||||
<?php
|
||||
|
||||
do {
|
||||
|
||||
} while ($a);
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Do(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
110
vendor/nikic/php-parser/test/code/parser/stmt/loop/for.test
vendored
Normal file
110
vendor/nikic/php-parser/test/code/parser/stmt/loop/for.test
vendored
Normal file
|
@ -0,0 +1,110 @@
|
|||
For loop
|
||||
-----
|
||||
<?php
|
||||
|
||||
// "classical" loop
|
||||
for ($i = 0; $i < $c; ++$i) {}
|
||||
|
||||
// multiple expressions
|
||||
for ($a, $b; $c, $d; $e, $f) {}
|
||||
|
||||
// infinite loop
|
||||
for (;;) {}
|
||||
|
||||
// alternative syntax
|
||||
for (;;):
|
||||
endfor;
|
||||
-----
|
||||
array(
|
||||
0: Stmt_For(
|
||||
init: array(
|
||||
0: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: i
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
cond: array(
|
||||
0: Expr_BinaryOp_Smaller(
|
||||
left: Expr_Variable(
|
||||
name: i
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
loop: array(
|
||||
0: Expr_PreInc(
|
||||
var: Expr_Variable(
|
||||
name: i
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // "classical" loop
|
||||
)
|
||||
)
|
||||
1: Stmt_For(
|
||||
init: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
cond: array(
|
||||
0: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
loop: array(
|
||||
0: Expr_Variable(
|
||||
name: e
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: f
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // multiple expressions
|
||||
)
|
||||
)
|
||||
2: Stmt_For(
|
||||
init: array(
|
||||
)
|
||||
cond: array(
|
||||
)
|
||||
loop: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // infinite loop
|
||||
)
|
||||
)
|
||||
3: Stmt_For(
|
||||
init: array(
|
||||
)
|
||||
cond: array(
|
||||
)
|
||||
loop: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // alternative syntax
|
||||
)
|
||||
)
|
||||
)
|
164
vendor/nikic/php-parser/test/code/parser/stmt/loop/foreach.test
vendored
Normal file
164
vendor/nikic/php-parser/test/code/parser/stmt/loop/foreach.test
vendored
Normal file
|
@ -0,0 +1,164 @@
|
|||
Foreach loop
|
||||
-----
|
||||
<?php
|
||||
|
||||
// foreach on variable
|
||||
foreach ($a as $b) {}
|
||||
foreach ($a as &$b) {}
|
||||
foreach ($a as $b => $c) {}
|
||||
foreach ($a as $b => &$c) {}
|
||||
foreach ($a as list($a, $b)) {}
|
||||
foreach ($a as $a => list($b, , $c)) {}
|
||||
|
||||
// foreach on expression
|
||||
foreach (array() as $b) {}
|
||||
|
||||
// alternative syntax
|
||||
foreach ($a as $b):
|
||||
endforeach;
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Foreach(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
keyVar: null
|
||||
byRef: false
|
||||
valueVar: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // foreach on variable
|
||||
)
|
||||
)
|
||||
1: Stmt_Foreach(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
keyVar: null
|
||||
byRef: true
|
||||
valueVar: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
2: Stmt_Foreach(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
keyVar: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
valueVar: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
3: Stmt_Foreach(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
keyVar: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: true
|
||||
valueVar: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
4: Stmt_Foreach(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
keyVar: null
|
||||
byRef: false
|
||||
valueVar: Expr_List(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
5: Stmt_Foreach(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
keyVar: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
valueVar: Expr_List(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: null
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
6: Stmt_Foreach(
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
)
|
||||
)
|
||||
keyVar: null
|
||||
byRef: false
|
||||
valueVar: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // foreach on expression
|
||||
)
|
||||
)
|
||||
7: Stmt_Foreach(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
keyVar: null
|
||||
byRef: false
|
||||
valueVar: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // alternative syntax
|
||||
)
|
||||
)
|
||||
)
|
25
vendor/nikic/php-parser/test/code/parser/stmt/loop/while.test
vendored
Normal file
25
vendor/nikic/php-parser/test/code/parser/stmt/loop/while.test
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
While loop
|
||||
-----
|
||||
<?php
|
||||
|
||||
while ($a) {}
|
||||
|
||||
while ($a):
|
||||
endwhile;
|
||||
-----
|
||||
array(
|
||||
0: Stmt_While(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
1: Stmt_While(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue