forked from GNUsocial/gnu-social
[COMPOSER] Add new php-ffmpeg package
This commit is contained in:
139
vendor/nikic/php-parser/test/code/parser/expr/arrayDef.test
vendored
Normal file
139
vendor/nikic/php-parser/test/code/parser/expr/arrayDef.test
vendored
Normal file
@@ -0,0 +1,139 @@
|
||||
Array definitions
|
||||
-----
|
||||
<?php
|
||||
|
||||
array();
|
||||
array('a');
|
||||
array('a', );
|
||||
array('a', 'b');
|
||||
array('a', &$b, 'c' => 'd', 'e' => &$f);
|
||||
|
||||
// short array syntax
|
||||
[];
|
||||
[1, 2, 3];
|
||||
['a' => 'b'];
|
||||
-----
|
||||
array(
|
||||
0: Expr_Array(
|
||||
items: array(
|
||||
)
|
||||
)
|
||||
1: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: true
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: d
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
3: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: e
|
||||
)
|
||||
value: Expr_Variable(
|
||||
name: f
|
||||
)
|
||||
byRef: true
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Expr_Array(
|
||||
items: array(
|
||||
)
|
||||
)
|
||||
6: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
255
vendor/nikic/php-parser/test/code/parser/expr/assign.test
vendored
Normal file
255
vendor/nikic/php-parser/test/code/parser/expr/assign.test
vendored
Normal file
@@ -0,0 +1,255 @@
|
||||
Assignments
|
||||
-----
|
||||
<?php
|
||||
// simple assign
|
||||
$a = $b;
|
||||
|
||||
// combined assign
|
||||
$a &= $b;
|
||||
$a |= $b;
|
||||
$a ^= $b;
|
||||
$a .= $b;
|
||||
$a /= $b;
|
||||
$a -= $b;
|
||||
$a %= $b;
|
||||
$a *= $b;
|
||||
$a += $b;
|
||||
$a <<= $b;
|
||||
$a >>= $b;
|
||||
$a **= $b;
|
||||
|
||||
// chained assign
|
||||
$a = $b *= $c **= $d;
|
||||
|
||||
// by ref assign
|
||||
$a =& $b;
|
||||
$a =& new B;
|
||||
|
||||
// list() assign
|
||||
list($a) = $b;
|
||||
list($a, , $b) = $c;
|
||||
list($a, list(, $c), $d) = $e;
|
||||
|
||||
// inc/dec
|
||||
++$a;
|
||||
$a++;
|
||||
--$a;
|
||||
$a--;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
1: Expr_AssignOp_BitwiseAnd(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
2: Expr_AssignOp_BitwiseOr(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
3: Expr_AssignOp_BitwiseXor(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
4: Expr_AssignOp_Concat(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
5: Expr_AssignOp_Div(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
6: Expr_AssignOp_Minus(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
7: Expr_AssignOp_Mod(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
8: Expr_AssignOp_Mul(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
9: Expr_AssignOp_Plus(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
10: Expr_AssignOp_ShiftLeft(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
11: Expr_AssignOp_ShiftRight(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
12: Expr_AssignOp_Pow(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
13: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_AssignOp_Mul(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
expr: Expr_AssignOp_Pow(
|
||||
var: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
14: Expr_AssignRef(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
15: Expr_AssignRef(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
16: Expr_Assign(
|
||||
var: Expr_List(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
17: Expr_Assign(
|
||||
var: Expr_List(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: null
|
||||
2: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
18: Expr_Assign(
|
||||
var: Expr_List(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: Expr_List(
|
||||
vars: array(
|
||||
0: null
|
||||
1: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: e
|
||||
)
|
||||
)
|
||||
19: Expr_PreInc(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
20: Expr_PostInc(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
21: Expr_PreDec(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
22: Expr_PostDec(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
72
vendor/nikic/php-parser/test/code/parser/expr/cast.test
vendored
Normal file
72
vendor/nikic/php-parser/test/code/parser/expr/cast.test
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
Casts
|
||||
-----
|
||||
<?php
|
||||
(array) $a;
|
||||
(bool) $a;
|
||||
(boolean) $a;
|
||||
(real) $a;
|
||||
(double) $a;
|
||||
(float) $a;
|
||||
(int) $a;
|
||||
(integer) $a;
|
||||
(object) $a;
|
||||
(string) $a;
|
||||
(unset) $a;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Cast_Array(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
1: Expr_Cast_Bool(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
2: Expr_Cast_Bool(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
3: Expr_Cast_Double(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
4: Expr_Cast_Double(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
5: Expr_Cast_Double(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
6: Expr_Cast_Int(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
7: Expr_Cast_Int(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
8: Expr_Cast_Object(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
9: Expr_Cast_String(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
10: Expr_Cast_Unset(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
13
vendor/nikic/php-parser/test/code/parser/expr/clone.test
vendored
Normal file
13
vendor/nikic/php-parser/test/code/parser/expr/clone.test
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Clone
|
||||
-----
|
||||
<?php
|
||||
|
||||
clone $a;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Clone(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
142
vendor/nikic/php-parser/test/code/parser/expr/closure.test
vendored
Normal file
142
vendor/nikic/php-parser/test/code/parser/expr/closure.test
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
Closures
|
||||
-----
|
||||
<?php
|
||||
function($a) { $a; };
|
||||
function($a) use($b) {};
|
||||
function() use($a, &$b) {};
|
||||
function &($a) {};
|
||||
static function() {};
|
||||
function($a) : array {};
|
||||
function() use($a) : \Foo\Bar {};
|
||||
-----
|
||||
array(
|
||||
0: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: a
|
||||
default: null
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: a
|
||||
default: null
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: b
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
2: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
)
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: a
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ClosureUse(
|
||||
var: b
|
||||
byRef: true
|
||||
)
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
3: Expr_Closure(
|
||||
static: false
|
||||
byRef: true
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: a
|
||||
default: null
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
4: Expr_Closure(
|
||||
static: true
|
||||
byRef: false
|
||||
params: array(
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
5: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: a
|
||||
default: null
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: array
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
6: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
)
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: a
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
returnType: Name_FullyQualified(
|
||||
parts: array(
|
||||
0: Foo
|
||||
1: Bar
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
107
vendor/nikic/php-parser/test/code/parser/expr/comparison.test
vendored
Normal file
107
vendor/nikic/php-parser/test/code/parser/expr/comparison.test
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
Comparison operators
|
||||
-----
|
||||
<?php
|
||||
$a < $b;
|
||||
$a <= $b;
|
||||
$a > $b;
|
||||
$a >= $b;
|
||||
$a == $b;
|
||||
$a === $b;
|
||||
$a != $b;
|
||||
$a !== $b;
|
||||
$a <=> $b;
|
||||
$a instanceof B;
|
||||
$a instanceof $b;
|
||||
-----
|
||||
array(
|
||||
0: Expr_BinaryOp_Smaller(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
1: Expr_BinaryOp_SmallerOrEqual(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
2: Expr_BinaryOp_Greater(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
3: Expr_BinaryOp_GreaterOrEqual(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
4: Expr_BinaryOp_Equal(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
5: Expr_BinaryOp_Identical(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
6: Expr_BinaryOp_NotEqual(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
7: Expr_BinaryOp_NotIdentical(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
8: Expr_BinaryOp_Spaceship(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
9: Expr_Instanceof(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
)
|
||||
10: Expr_Instanceof(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
class: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
621
vendor/nikic/php-parser/test/code/parser/expr/constant_expr.test
vendored
Normal file
621
vendor/nikic/php-parser/test/code/parser/expr/constant_expr.test
vendored
Normal file
@@ -0,0 +1,621 @@
|
||||
Expressions in static scalar context
|
||||
-----
|
||||
<?php
|
||||
|
||||
const T_1 = 1 << 1;
|
||||
const T_2 = 1 / 2;
|
||||
const T_3 = 1.5 + 1.5;
|
||||
const T_4 = "foo" . "bar";
|
||||
const T_5 = (1.5 + 1.5) * 2;
|
||||
const T_6 = "foo" . 2 . 3 . 4.0;
|
||||
const T_7 = __LINE__;
|
||||
const T_8 = <<<ENDOFSTRING
|
||||
This is a test string
|
||||
ENDOFSTRING;
|
||||
const T_9 = ~-1;
|
||||
const T_10 = (-1?:1) + (0?2:3);
|
||||
const T_11 = 1 && 0;
|
||||
const T_12 = 1 and 1;
|
||||
const T_13 = 0 || 0;
|
||||
const T_14 = 1 or 0;
|
||||
const T_15 = 1 xor 1;
|
||||
const T_16 = 1 xor 0;
|
||||
const T_17 = 1 < 0;
|
||||
const T_18 = 0 <= 0;
|
||||
const T_19 = 1 > 0;
|
||||
const T_20 = 1 >= 0;
|
||||
const T_21 = 1 === 1;
|
||||
const T_22 = 1 !== 1;
|
||||
const T_23 = 0 != "0";
|
||||
const T_24 = 1 == "1";
|
||||
const T_25 = 1 + 2 * 3;
|
||||
const T_26 = "1" + 2 + "3";
|
||||
const T_27 = 2 ** 3;
|
||||
const T_28 = [1, 2, 3][1];
|
||||
const T_29 = 12 - 13;
|
||||
const T_30 = 12 ^ 13;
|
||||
const T_31 = 12 & 13;
|
||||
const T_32 = 12 | 13;
|
||||
const T_33 = 12 % 3;
|
||||
const T_34 = 100 >> 4;
|
||||
const T_35 = !false;
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_1
|
||||
value: Expr_BinaryOp_ShiftLeft(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_2
|
||||
value: Expr_BinaryOp_Div(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_3
|
||||
value: Expr_BinaryOp_Plus(
|
||||
left: Scalar_DNumber(
|
||||
value: 1.5
|
||||
)
|
||||
right: Scalar_DNumber(
|
||||
value: 1.5
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_4
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: foo
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: bar
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_5
|
||||
value: Expr_BinaryOp_Mul(
|
||||
left: Expr_BinaryOp_Plus(
|
||||
left: Scalar_DNumber(
|
||||
value: 1.5
|
||||
)
|
||||
right: Scalar_DNumber(
|
||||
value: 1.5
|
||||
)
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_6
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Expr_BinaryOp_Concat(
|
||||
left: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: foo
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
right: Scalar_DNumber(
|
||||
value: 4
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_7
|
||||
value: Scalar_MagicConst_Line(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_8
|
||||
value: Scalar_String(
|
||||
value: This is a test string
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_9
|
||||
value: Expr_BitwiseNot(
|
||||
expr: Expr_UnaryMinus(
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
9: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_10
|
||||
value: Expr_BinaryOp_Plus(
|
||||
left: Expr_Ternary(
|
||||
cond: Expr_UnaryMinus(
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
if: null
|
||||
else: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
right: Expr_Ternary(
|
||||
cond: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
if: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
else: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
10: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_11
|
||||
value: Expr_BinaryOp_BooleanAnd(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
11: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_12
|
||||
value: Expr_BinaryOp_LogicalAnd(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
12: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_13
|
||||
value: Expr_BinaryOp_BooleanOr(
|
||||
left: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
13: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_14
|
||||
value: Expr_BinaryOp_LogicalOr(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
14: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_15
|
||||
value: Expr_BinaryOp_LogicalXor(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
15: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_16
|
||||
value: Expr_BinaryOp_LogicalXor(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
16: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_17
|
||||
value: Expr_BinaryOp_Smaller(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
17: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_18
|
||||
value: Expr_BinaryOp_SmallerOrEqual(
|
||||
left: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
18: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_19
|
||||
value: Expr_BinaryOp_Greater(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
19: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_20
|
||||
value: Expr_BinaryOp_GreaterOrEqual(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
20: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_21
|
||||
value: Expr_BinaryOp_Identical(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
21: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_22
|
||||
value: Expr_BinaryOp_NotIdentical(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
22: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_23
|
||||
value: Expr_BinaryOp_NotEqual(
|
||||
left: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
23: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_24
|
||||
value: Expr_BinaryOp_Equal(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
24: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_25
|
||||
value: Expr_BinaryOp_Plus(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
right: Expr_BinaryOp_Mul(
|
||||
left: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
25: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_26
|
||||
value: Expr_BinaryOp_Plus(
|
||||
left: Expr_BinaryOp_Plus(
|
||||
left: Scalar_String(
|
||||
value: 1
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
26: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_27
|
||||
value: Expr_BinaryOp_Pow(
|
||||
left: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
27: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_28
|
||||
value: Expr_ArrayDimFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
28: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_29
|
||||
value: Expr_BinaryOp_Minus(
|
||||
left: Scalar_LNumber(
|
||||
value: 12
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 13
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
29: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_30
|
||||
value: Expr_BinaryOp_BitwiseXor(
|
||||
left: Scalar_LNumber(
|
||||
value: 12
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 13
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
30: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_31
|
||||
value: Expr_BinaryOp_BitwiseAnd(
|
||||
left: Scalar_LNumber(
|
||||
value: 12
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 13
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
31: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_32
|
||||
value: Expr_BinaryOp_BitwiseOr(
|
||||
left: Scalar_LNumber(
|
||||
value: 12
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 13
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
32: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_33
|
||||
value: Expr_BinaryOp_Mod(
|
||||
left: Scalar_LNumber(
|
||||
value: 12
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
33: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_34
|
||||
value: Expr_BinaryOp_ShiftRight(
|
||||
left: Scalar_LNumber(
|
||||
value: 100
|
||||
)
|
||||
right: Scalar_LNumber(
|
||||
value: 4
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
34: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_35
|
||||
value: Expr_BooleanNot(
|
||||
expr: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
12
vendor/nikic/php-parser/test/code/parser/expr/errorSuppress.test
vendored
Normal file
12
vendor/nikic/php-parser/test/code/parser/expr/errorSuppress.test
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
Error suppression
|
||||
-----
|
||||
<?php
|
||||
@$a;
|
||||
-----
|
||||
array(
|
||||
0: Expr_ErrorSuppress(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
34
vendor/nikic/php-parser/test/code/parser/expr/exit.test
vendored
Normal file
34
vendor/nikic/php-parser/test/code/parser/expr/exit.test
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
Exit
|
||||
-----
|
||||
<?php
|
||||
exit;
|
||||
exit();
|
||||
exit('Die!');
|
||||
die;
|
||||
die();
|
||||
die('Exit!');
|
||||
-----
|
||||
array(
|
||||
0: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
1: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
2: Expr_Exit(
|
||||
expr: Scalar_String(
|
||||
value: Die!
|
||||
)
|
||||
)
|
||||
3: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
4: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
5: Expr_Exit(
|
||||
expr: Scalar_String(
|
||||
value: Exit!
|
||||
)
|
||||
)
|
||||
)
|
99
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/args.test
vendored
Normal file
99
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/args.test
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
Arguments
|
||||
-----
|
||||
<?php
|
||||
|
||||
f();
|
||||
f($a);
|
||||
f($a, $b);
|
||||
f(&$a);
|
||||
f($a, ...$b);
|
||||
-----
|
||||
array(
|
||||
0: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
1: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: true
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: true
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
33
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/constFetch.test
vendored
Normal file
33
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/constFetch.test
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
Constant fetches
|
||||
-----
|
||||
<?php
|
||||
|
||||
A;
|
||||
A::B;
|
||||
A::class;
|
||||
-----
|
||||
array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: B
|
||||
)
|
||||
2: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: class
|
||||
)
|
||||
)
|
231
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/constantDeref.test
vendored
Normal file
231
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/constantDeref.test
vendored
Normal file
@@ -0,0 +1,231 @@
|
||||
Array/string dereferencing
|
||||
-----
|
||||
<?php
|
||||
|
||||
"abc"[2];
|
||||
"abc"[2][0][0];
|
||||
|
||||
[1, 2, 3][2];
|
||||
[1, 2, 3][2][0][0];
|
||||
|
||||
array(1, 2, 3)[2];
|
||||
array(1, 2, 3)[2][0][0];
|
||||
|
||||
FOO[0];
|
||||
Foo::BAR[1];
|
||||
$foo::BAR[2][1][0];
|
||||
-----
|
||||
array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Scalar_String(
|
||||
value: abc
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
1: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Scalar_String(
|
||||
value: abc
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
2: Expr_ArrayDimFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
3: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
4: Expr_ArrayDimFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
5: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
6: Expr_ArrayDimFetch(
|
||||
var: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: FOO
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
7: Expr_ArrayDimFetch(
|
||||
var: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
)
|
||||
)
|
||||
name: BAR
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
8: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_ClassConstFetch(
|
||||
class: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
name: BAR
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
117
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/funcCall.test
vendored
Normal file
117
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/funcCall.test
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
Function calls
|
||||
-----
|
||||
<?php
|
||||
|
||||
// function name variations
|
||||
a();
|
||||
$a();
|
||||
${'a'}();
|
||||
$$a();
|
||||
$$$a();
|
||||
$a['b']();
|
||||
$a{'b'}();
|
||||
$a->b['c']();
|
||||
|
||||
// array dereferencing
|
||||
a()['b'];
|
||||
-----
|
||||
array(
|
||||
0: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: a
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
1: Expr_FuncCall(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
2: Expr_FuncCall(
|
||||
name: Expr_Variable(
|
||||
name: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
3: Expr_FuncCall(
|
||||
name: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
4: Expr_FuncCall(
|
||||
name: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
5: Expr_FuncCall(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
6: Expr_FuncCall(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
7: Expr_FuncCall(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
8: Expr_ArrayDimFetch(
|
||||
var: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: a
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
70
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/newDeref.test
vendored
Normal file
70
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/newDeref.test
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
New expression dereferencing
|
||||
-----
|
||||
<?php
|
||||
|
||||
(new A)->b;
|
||||
(new A)->b();
|
||||
(new A)['b'];
|
||||
(new A)['b']['c'];
|
||||
-----
|
||||
array(
|
||||
0: Expr_PropertyFetch(
|
||||
var: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
1: Expr_MethodCall(
|
||||
var: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
2: Expr_ArrayDimFetch(
|
||||
var: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
3: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
)
|
118
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/objectAccess.test
vendored
Normal file
118
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/objectAccess.test
vendored
Normal file
@@ -0,0 +1,118 @@
|
||||
Object access
|
||||
-----
|
||||
<?php
|
||||
|
||||
// property fetch variations
|
||||
$a->b;
|
||||
$a->b['c'];
|
||||
$a->b{'c'};
|
||||
|
||||
// method call variations
|
||||
$a->b();
|
||||
$a->{'b'}();
|
||||
$a->$b();
|
||||
$a->$b['c']();
|
||||
|
||||
// array dereferencing
|
||||
$a->b()['c'];
|
||||
$a->b(){'c'}; // invalid PHP: drop Support?
|
||||
-----
|
||||
array(
|
||||
0: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
)
|
||||
1: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
2: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
3: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
4: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
5: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
6: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
7: Expr_ArrayDimFetch(
|
||||
var: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
8: Expr_ArrayDimFetch(
|
||||
var: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
)
|
62
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/simpleArrayAccess.test
vendored
Normal file
62
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/simpleArrayAccess.test
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
Simple array access
|
||||
-----
|
||||
<?php
|
||||
|
||||
$a['b'];
|
||||
$a['b']['c'];
|
||||
$a[] = $b;
|
||||
$a{'b'};
|
||||
${$a}['b'];
|
||||
-----
|
||||
array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
1: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
2: Expr_Assign(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: null
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
3: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
4: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
151
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/staticCall.test
vendored
Normal file
151
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/staticCall.test
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
Static calls
|
||||
-----
|
||||
<?php
|
||||
|
||||
// method name variations
|
||||
A::b();
|
||||
A::{'b'}();
|
||||
A::$b();
|
||||
A::$b['c']();
|
||||
A::$b['c']['d']();
|
||||
|
||||
// array dereferencing
|
||||
A::b()['c'];
|
||||
|
||||
// class name variations
|
||||
static::b();
|
||||
$a::b();
|
||||
${'a'}::b();
|
||||
$a['b']::c();
|
||||
-----
|
||||
array(
|
||||
0: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
1: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
2: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
3: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
4: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: d
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
5: Expr_ArrayDimFetch(
|
||||
var: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
6: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: static
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
7: Expr_StaticCall(
|
||||
class: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
8: Expr_StaticCall(
|
||||
class: Expr_Variable(
|
||||
name: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
9: Expr_StaticCall(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
name: c
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
71
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/staticPropertyFetch.test
vendored
Normal file
71
vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/staticPropertyFetch.test
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
Static property fetches
|
||||
-----
|
||||
<?php
|
||||
|
||||
// property name variations
|
||||
A::$b;
|
||||
A::$$b;
|
||||
A::${'b'};
|
||||
|
||||
// array access
|
||||
A::$b['c'];
|
||||
A::$b{'c'};
|
||||
|
||||
// class name variations can be found in staticCall.test
|
||||
-----
|
||||
array(
|
||||
0: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
1: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
2: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
3: Expr_ArrayDimFetch(
|
||||
var: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
4: Expr_ArrayDimFetch(
|
||||
var: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
)
|
40
vendor/nikic/php-parser/test/code/parser/expr/includeAndEval.test
vendored
Normal file
40
vendor/nikic/php-parser/test/code/parser/expr/includeAndEval.test
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
Include and eval
|
||||
-----
|
||||
<?php
|
||||
include 'A.php';
|
||||
include_once 'A.php';
|
||||
require 'A.php';
|
||||
require_once 'A.php';
|
||||
eval('A');
|
||||
-----
|
||||
array(
|
||||
0: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
)
|
||||
type: 1
|
||||
)
|
||||
1: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
)
|
||||
type: 2
|
||||
)
|
||||
2: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
)
|
||||
type: 3
|
||||
)
|
||||
3: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
)
|
||||
type: 4
|
||||
)
|
||||
4: Expr_Eval(
|
||||
expr: Scalar_String(
|
||||
value: A
|
||||
)
|
||||
)
|
||||
)
|
75
vendor/nikic/php-parser/test/code/parser/expr/issetAndEmpty.test
vendored
Normal file
75
vendor/nikic/php-parser/test/code/parser/expr/issetAndEmpty.test
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
isset() and empty()
|
||||
-----
|
||||
<?php
|
||||
isset($a);
|
||||
isset($a, $b, $c);
|
||||
|
||||
empty($a);
|
||||
empty(foo());
|
||||
empty(array(1, 2, 3));
|
||||
-----
|
||||
array(
|
||||
0: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
2: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_Empty(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
3: Expr_Empty(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_Empty(
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
138
vendor/nikic/php-parser/test/code/parser/expr/logic.test
vendored
Normal file
138
vendor/nikic/php-parser/test/code/parser/expr/logic.test
vendored
Normal file
@@ -0,0 +1,138 @@
|
||||
Logical operators
|
||||
-----
|
||||
<?php
|
||||
|
||||
// boolean ops
|
||||
$a && $b;
|
||||
$a || $b;
|
||||
!$a;
|
||||
!!$a;
|
||||
|
||||
// logical ops
|
||||
$a and $b;
|
||||
$a or $b;
|
||||
$a xor $b;
|
||||
|
||||
// precedence
|
||||
$a && $b || $c && $d;
|
||||
$a && ($b || $c) && $d;
|
||||
|
||||
$a = $b || $c;
|
||||
$a = $b or $c;
|
||||
-----
|
||||
array(
|
||||
0: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
1: Expr_BinaryOp_BooleanOr(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
2: Expr_BooleanNot(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
3: Expr_BooleanNot(
|
||||
expr: Expr_BooleanNot(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_BinaryOp_LogicalAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
5: Expr_BinaryOp_LogicalOr(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
6: Expr_BinaryOp_LogicalXor(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
7: Expr_BinaryOp_BooleanOr(
|
||||
left: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_BinaryOp_BooleanOr(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
9: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_BinaryOp_BooleanOr(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
10: Expr_BinaryOp_LogicalOr(
|
||||
left: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
226
vendor/nikic/php-parser/test/code/parser/expr/math.test
vendored
Normal file
226
vendor/nikic/php-parser/test/code/parser/expr/math.test
vendored
Normal file
@@ -0,0 +1,226 @@
|
||||
Mathematical operators
|
||||
-----
|
||||
<?php
|
||||
|
||||
// unary ops
|
||||
~$a;
|
||||
+$a;
|
||||
-$a;
|
||||
|
||||
// binary ops
|
||||
$a & $b;
|
||||
$a | $b;
|
||||
$a ^ $b;
|
||||
$a . $b;
|
||||
$a / $b;
|
||||
$a - $b;
|
||||
$a % $b;
|
||||
$a * $b;
|
||||
$a + $b;
|
||||
$a << $b;
|
||||
$a >> $b;
|
||||
$a ** $b;
|
||||
|
||||
// associativity
|
||||
$a * $b * $c;
|
||||
$a * ($b * $c);
|
||||
|
||||
// precedence
|
||||
$a + $b * $c;
|
||||
($a + $b) * $c;
|
||||
|
||||
// pow is special
|
||||
$a ** $b ** $c;
|
||||
($a ** $b) ** $c;
|
||||
-----
|
||||
array(
|
||||
0: Expr_BitwiseNot(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
1: Expr_UnaryPlus(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
2: Expr_UnaryMinus(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
3: Expr_BinaryOp_BitwiseAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
4: Expr_BinaryOp_BitwiseOr(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
5: Expr_BinaryOp_BitwiseXor(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
6: Expr_BinaryOp_Concat(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
7: Expr_BinaryOp_Div(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
8: Expr_BinaryOp_Minus(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
9: Expr_BinaryOp_Mod(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
10: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
11: Expr_BinaryOp_Plus(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
12: Expr_BinaryOp_ShiftLeft(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
13: Expr_BinaryOp_ShiftRight(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
14: Expr_BinaryOp_Pow(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
15: Expr_BinaryOp_Mul(
|
||||
left: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
16: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
17: Expr_BinaryOp_Plus(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
18: Expr_BinaryOp_Mul(
|
||||
left: Expr_BinaryOp_Plus(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
19: Expr_BinaryOp_Pow(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_BinaryOp_Pow(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
20: Expr_BinaryOp_Pow(
|
||||
left: Expr_BinaryOp_Pow(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
140
vendor/nikic/php-parser/test/code/parser/expr/new.test
vendored
Normal file
140
vendor/nikic/php-parser/test/code/parser/expr/new.test
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
New
|
||||
-----
|
||||
<?php
|
||||
|
||||
new A;
|
||||
new A($b);
|
||||
|
||||
// class name variations
|
||||
new $a();
|
||||
new $a['b']();
|
||||
new A::$b();
|
||||
// DNCR object access
|
||||
new $a->b();
|
||||
new $a->b->c();
|
||||
new $a->b['c']();
|
||||
new $a->b{'c'}();
|
||||
|
||||
// test regression introduces by new dereferencing syntax
|
||||
(new A);
|
||||
-----
|
||||
array(
|
||||
0: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
1: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_New(
|
||||
class: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
3: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
4: Expr_New(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
5: Expr_New(
|
||||
class: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
6: Expr_New(
|
||||
class: Expr_PropertyFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
)
|
||||
name: c
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
7: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
8: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
9: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
8
vendor/nikic/php-parser/test/code/parser/expr/newWithoutClass.test
vendored
Normal file
8
vendor/nikic/php-parser/test/code/parser/expr/newWithoutClass.test
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
New without a class
|
||||
-----
|
||||
<?php
|
||||
new;
|
||||
-----
|
||||
Syntax error, unexpected ';' from 2:4 to 2:4
|
||||
array(
|
||||
)
|
12
vendor/nikic/php-parser/test/code/parser/expr/print.test
vendored
Normal file
12
vendor/nikic/php-parser/test/code/parser/expr/print.test
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
Print
|
||||
-----
|
||||
<?php
|
||||
print $a;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Print(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
38
vendor/nikic/php-parser/test/code/parser/expr/shellExec.test
vendored
Normal file
38
vendor/nikic/php-parser/test/code/parser/expr/shellExec.test
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
Shell execution
|
||||
-----
|
||||
<?php
|
||||
``;
|
||||
`test`;
|
||||
`test $A`;
|
||||
`test \``;
|
||||
`test \"`;
|
||||
-----
|
||||
array(
|
||||
0: Expr_ShellExec(
|
||||
parts: array(
|
||||
)
|
||||
)
|
||||
1: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: test
|
||||
)
|
||||
)
|
||||
2: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: test
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: test `
|
||||
)
|
||||
)
|
||||
4: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: test \"
|
||||
)
|
||||
)
|
||||
)
|
128
vendor/nikic/php-parser/test/code/parser/expr/ternaryAndCoalesce.test
vendored
Normal file
128
vendor/nikic/php-parser/test/code/parser/expr/ternaryAndCoalesce.test
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
Ternary operator
|
||||
-----
|
||||
<?php
|
||||
|
||||
// ternary
|
||||
$a ? $b : $c;
|
||||
$a ?: $c;
|
||||
|
||||
// precedence
|
||||
$a ? $b : $c ? $d : $e;
|
||||
$a ? $b : ($c ? $d : $e);
|
||||
|
||||
// null coalesce
|
||||
$a ?? $b;
|
||||
$a ?? $b ?? $c;
|
||||
$a ?? $b ? $c : $d;
|
||||
$a && $b ?? $c;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
else: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
1: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
if: null
|
||||
else: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
2: Expr_Ternary(
|
||||
cond: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
else: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
else: Expr_Variable(
|
||||
name: e
|
||||
)
|
||||
)
|
||||
3: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
else: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
else: Expr_Variable(
|
||||
name: e
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
5: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Expr_Ternary(
|
||||
cond: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
else: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
7: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
54
vendor/nikic/php-parser/test/code/parser/expr/variable.test
vendored
Normal file
54
vendor/nikic/php-parser/test/code/parser/expr/variable.test
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
Variable syntaxes
|
||||
-----
|
||||
<?php
|
||||
|
||||
$a;
|
||||
${'a'};
|
||||
${foo()};
|
||||
$$a;
|
||||
$$$a;
|
||||
$$a['b'];
|
||||
-----
|
||||
array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
)
|
||||
2: Expr_Variable(
|
||||
name: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
4: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Expr_Variable(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
Reference in New Issue
Block a user