Laravel version update
Laravel version update
This commit is contained in:
@@ -10,14 +10,27 @@ Comments on blocks
|
||||
$a;
|
||||
}
|
||||
}
|
||||
|
||||
// empty
|
||||
{}
|
||||
-----
|
||||
array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // baz
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // foo
|
||||
1: // bar
|
||||
2: // baz
|
||||
)
|
||||
)
|
||||
1: Stmt_Nop(
|
||||
comments: array(
|
||||
0: // empty
|
||||
)
|
||||
)
|
||||
)
|
37
vendor/nikic/php-parser/test/code/parser/commentAtEndOfClass.test
vendored
Normal file
37
vendor/nikic/php-parser/test/code/parser/commentAtEndOfClass.test
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
Comment at end of class (#509)
|
||||
-----
|
||||
<?php
|
||||
class MyClass {
|
||||
protected $a;
|
||||
// my comment
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: MyClass
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_PROTECTED (2)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Nop(
|
||||
comments: array(
|
||||
0: // my comment
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -21,8 +21,16 @@ if ($cond) {
|
||||
// bar 3
|
||||
-----
|
||||
array(
|
||||
0: Expr_Variable(
|
||||
name: var
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: var
|
||||
comments: array(
|
||||
0: /** doc 1 */
|
||||
1: /* foobar 1 */
|
||||
2: // foo 1
|
||||
3: // bar 1
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: /** doc 1 */
|
||||
1: /* foobar 1 */
|
||||
|
@@ -4,10 +4,12 @@ Error positions
|
||||
-----
|
||||
Syntax error, unexpected EOF from 1:10 to 1:10
|
||||
array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -17,10 +19,12 @@ array(
|
||||
-----
|
||||
Syntax error, unexpected EOF from 1:20 to 1:20
|
||||
array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
140
vendor/nikic/php-parser/test/code/parser/errorHandling/lexerErrors.test
vendored
Normal file
140
vendor/nikic/php-parser/test/code/parser/errorHandling/lexerErrors.test
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
Lexer errors
|
||||
-----
|
||||
<?php
|
||||
|
||||
$a = 42;
|
||||
/*
|
||||
$b = 24;
|
||||
-----
|
||||
Unterminated comment from 4:1 to 5:9
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 42
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Nop(
|
||||
comments: array(
|
||||
0: /*
|
||||
$b = 24;
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
|
||||
$a = 42;
|
||||
@@{ "\1" }@@
|
||||
$b = 24;
|
||||
-----
|
||||
Unexpected character "" (ASCII 1) from 4:1 to 4:1
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 42
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 24
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
|
||||
$a = 42;
|
||||
@@{ "\0" }@@
|
||||
$b = 24;
|
||||
-----
|
||||
Unexpected null byte from 4:1 to 4:1
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 42
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 24
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
|
||||
$a = 1;
|
||||
@@{ "\1" }@@
|
||||
$b = 2;
|
||||
@@{ "\2" }@@
|
||||
$c = 3;
|
||||
-----
|
||||
Unexpected character "@@{ "\1" }@@" (ASCII 1) from 4:1 to 4:1
|
||||
Unexpected character "@@{ "\2" }@@" (ASCII 2) from 6:1 to 6:1
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
|
||||
if ($b) {
|
||||
$a = 1;
|
||||
/* unterminated
|
||||
}
|
||||
-----
|
||||
Unterminated comment from 5:5 to 6:2
|
||||
Syntax error, unexpected EOF from 6:2 to 6:2
|
File diff suppressed because it is too large
Load Diff
@@ -14,128 +14,147 @@ array('a', &$b, 'c' => 'd', 'e' => &$f);
|
||||
['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
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
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
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
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(
|
||||
4: Stmt_Expression(
|
||||
expr: 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: Stmt_Expression(
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // short array syntax
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // short array syntax
|
||||
)
|
||||
)
|
||||
6: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: a
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
|
152
vendor/nikic/php-parser/test/code/parser/expr/arrayDestructuring.test
vendored
Normal file
152
vendor/nikic/php-parser/test/code/parser/expr/arrayDestructuring.test
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
Array destructuring
|
||||
-----
|
||||
<?php
|
||||
|
||||
[$a, $b] = [$c, $d];
|
||||
[, $a, , , $b, ,] = $foo;
|
||||
[, [[$a]], $b] = $bar;
|
||||
['a' => $b, 'b' => $a] = $baz;
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Array(
|
||||
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
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: null
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: null
|
||||
3: null
|
||||
4: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
5: null
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: null
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: bar
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: baz
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -36,238 +36,328 @@ $a++;
|
||||
$a--;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // simple assign
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // simple assign
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // simple assign
|
||||
)
|
||||
)
|
||||
1: Expr_AssignOp_BitwiseAnd(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_AssignOp_BitwiseAnd(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // combined assign
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // combined assign
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // combined assign
|
||||
)
|
||||
)
|
||||
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
|
||||
comments: array(
|
||||
0: // chained assign
|
||||
)
|
||||
)
|
||||
expr: Expr_AssignOp_Mul(
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_AssignOp_BitwiseOr(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
expr: Expr_AssignOp_Pow(
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_AssignOp_BitwiseXor(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_AssignOp_Concat(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_AssignOp_Div(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_AssignOp_Minus(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_AssignOp_Mod(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_AssignOp_Mul(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
9: Stmt_Expression(
|
||||
expr: Expr_AssignOp_Plus(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
10: Stmt_Expression(
|
||||
expr: Expr_AssignOp_ShiftLeft(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
11: Stmt_Expression(
|
||||
expr: Expr_AssignOp_ShiftRight(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
12: Stmt_Expression(
|
||||
expr: Expr_AssignOp_Pow(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
13: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // chained assign
|
||||
)
|
||||
)
|
||||
expr: Expr_AssignOp_Mul(
|
||||
var: Expr_Variable(
|
||||
name: c
|
||||
name: b
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: d
|
||||
expr: Expr_AssignOp_Pow(
|
||||
var: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // chained assign
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // chained assign
|
||||
)
|
||||
)
|
||||
14: Expr_AssignRef(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
14: Stmt_Expression(
|
||||
expr: Expr_AssignRef(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // by ref assign
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // by ref assign
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // by ref assign
|
||||
)
|
||||
)
|
||||
15: Expr_Assign(
|
||||
var: Expr_List(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
15: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_List(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // list() assign
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // list() assign
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // list() assign
|
||||
)
|
||||
)
|
||||
16: Expr_Assign(
|
||||
var: Expr_List(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: null
|
||||
2: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
17: Expr_Assign(
|
||||
var: Expr_List(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: Expr_List(
|
||||
vars: array(
|
||||
0: null
|
||||
1: Expr_Variable(
|
||||
name: c
|
||||
16: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_List(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: null
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
2: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: e
|
||||
)
|
||||
17: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_List(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_List(
|
||||
items: array(
|
||||
0: null
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: e
|
||||
)
|
||||
)
|
||||
)
|
||||
18: Expr_PreInc(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
18: Stmt_Expression(
|
||||
expr: Expr_PreInc(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
comments: array(
|
||||
0: // inc/dec
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // inc/dec
|
||||
)
|
||||
)
|
||||
19: Expr_PostInc(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
19: Stmt_Expression(
|
||||
expr: Expr_PostInc(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
20: Expr_PreDec(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
20: Stmt_Expression(
|
||||
expr: Expr_PreDec(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
21: Expr_PostDec(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
21: Stmt_Expression(
|
||||
expr: Expr_PostDec(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -5,17 +5,19 @@ $a =& new B;
|
||||
-----
|
||||
!!php5
|
||||
array(
|
||||
0: Expr_AssignRef(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_AssignRef(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
args: array(
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -27,13 +29,15 @@ $a =& new B;
|
||||
!!php7
|
||||
Syntax error, unexpected T_NEW from 2:7 to 2:9
|
||||
array(
|
||||
0: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
@@ -14,59 +14,81 @@ Casts
|
||||
(unset) $a;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Cast_Array(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Cast_Array(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_Cast_Bool(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Cast_Bool(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_Cast_Bool(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Cast_Bool(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_Cast_Double(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Cast_Double(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_Cast_Double(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_Cast_Double(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Expr_Cast_Double(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_Cast_Double(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Expr_Cast_Int(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_Cast_Int(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Expr_Cast_Int(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_Cast_Int(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Expr_Cast_Object(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_Cast_Object(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
9: Expr_Cast_String(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
9: Stmt_Expression(
|
||||
expr: Expr_Cast_String(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
10: Expr_Cast_Unset(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
10: Stmt_Expression(
|
||||
expr: Expr_Cast_Unset(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -5,9 +5,11 @@ Clone
|
||||
clone $a;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Clone(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Clone(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -10,133 +10,167 @@ 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
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
uses: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Stmt_Expression(
|
||||
expr: 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
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: b
|
||||
byRef: false
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
2: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
)
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: a
|
||||
byRef: false
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
)
|
||||
1: Expr_ClosureUse(
|
||||
var: b
|
||||
byRef: true
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ClosureUse(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: true
|
||||
)
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
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
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Closure(
|
||||
static: false
|
||||
byRef: true
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
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
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_Closure(
|
||||
static: true
|
||||
byRef: false
|
||||
params: array(
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: array
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
6: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
)
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: a
|
||||
byRef: false
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: Identifier(
|
||||
name: array
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
returnType: Name_FullyQualified(
|
||||
parts: array(
|
||||
0: Foo
|
||||
1: Bar
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
)
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
returnType: Name_FullyQualified(
|
||||
parts: array(
|
||||
0: Foo
|
||||
1: Bar
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -14,94 +14,116 @@ $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
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Smaller(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
10: Expr_Instanceof(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
class: Expr_Variable(
|
||||
name: b
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_SmallerOrEqual(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Greater(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_GreaterOrEqual(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Equal(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Identical(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_NotEqual(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_NotIdentical(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Spaceship(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
9: Stmt_Expression(
|
||||
expr: Expr_Instanceof(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
10: Stmt_Expression(
|
||||
expr: Expr_Instanceof(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
class: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -44,7 +44,9 @@ array(
|
||||
0: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_1
|
||||
name: Identifier(
|
||||
name: T_1
|
||||
)
|
||||
value: Expr_BinaryOp_ShiftLeft(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -59,7 +61,9 @@ array(
|
||||
1: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_2
|
||||
name: Identifier(
|
||||
name: T_2
|
||||
)
|
||||
value: Expr_BinaryOp_Div(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -74,7 +78,9 @@ array(
|
||||
2: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_3
|
||||
name: Identifier(
|
||||
name: T_3
|
||||
)
|
||||
value: Expr_BinaryOp_Plus(
|
||||
left: Scalar_DNumber(
|
||||
value: 1.5
|
||||
@@ -89,7 +95,9 @@ array(
|
||||
3: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_4
|
||||
name: Identifier(
|
||||
name: T_4
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: foo
|
||||
@@ -104,7 +112,9 @@ array(
|
||||
4: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_5
|
||||
name: Identifier(
|
||||
name: T_5
|
||||
)
|
||||
value: Expr_BinaryOp_Mul(
|
||||
left: Expr_BinaryOp_Plus(
|
||||
left: Scalar_DNumber(
|
||||
@@ -124,7 +134,9 @@ array(
|
||||
5: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_6
|
||||
name: Identifier(
|
||||
name: T_6
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Expr_BinaryOp_Concat(
|
||||
left: Expr_BinaryOp_Concat(
|
||||
@@ -149,7 +161,9 @@ array(
|
||||
6: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_7
|
||||
name: Identifier(
|
||||
name: T_7
|
||||
)
|
||||
value: Scalar_MagicConst_Line(
|
||||
)
|
||||
)
|
||||
@@ -158,7 +172,9 @@ array(
|
||||
7: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_8
|
||||
name: Identifier(
|
||||
name: T_8
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: This is a test string
|
||||
)
|
||||
@@ -168,7 +184,9 @@ array(
|
||||
8: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_9
|
||||
name: Identifier(
|
||||
name: T_9
|
||||
)
|
||||
value: Expr_BitwiseNot(
|
||||
expr: Expr_UnaryMinus(
|
||||
expr: Scalar_LNumber(
|
||||
@@ -182,7 +200,9 @@ array(
|
||||
9: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_10
|
||||
name: Identifier(
|
||||
name: T_10
|
||||
)
|
||||
value: Expr_BinaryOp_Plus(
|
||||
left: Expr_Ternary(
|
||||
cond: Expr_UnaryMinus(
|
||||
@@ -213,7 +233,9 @@ array(
|
||||
10: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_11
|
||||
name: Identifier(
|
||||
name: T_11
|
||||
)
|
||||
value: Expr_BinaryOp_BooleanAnd(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -228,7 +250,9 @@ array(
|
||||
11: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_12
|
||||
name: Identifier(
|
||||
name: T_12
|
||||
)
|
||||
value: Expr_BinaryOp_LogicalAnd(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -243,7 +267,9 @@ array(
|
||||
12: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_13
|
||||
name: Identifier(
|
||||
name: T_13
|
||||
)
|
||||
value: Expr_BinaryOp_BooleanOr(
|
||||
left: Scalar_LNumber(
|
||||
value: 0
|
||||
@@ -258,7 +284,9 @@ array(
|
||||
13: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_14
|
||||
name: Identifier(
|
||||
name: T_14
|
||||
)
|
||||
value: Expr_BinaryOp_LogicalOr(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -273,7 +301,9 @@ array(
|
||||
14: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_15
|
||||
name: Identifier(
|
||||
name: T_15
|
||||
)
|
||||
value: Expr_BinaryOp_LogicalXor(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -288,7 +318,9 @@ array(
|
||||
15: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_16
|
||||
name: Identifier(
|
||||
name: T_16
|
||||
)
|
||||
value: Expr_BinaryOp_LogicalXor(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -303,7 +335,9 @@ array(
|
||||
16: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_17
|
||||
name: Identifier(
|
||||
name: T_17
|
||||
)
|
||||
value: Expr_BinaryOp_Smaller(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -318,7 +352,9 @@ array(
|
||||
17: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_18
|
||||
name: Identifier(
|
||||
name: T_18
|
||||
)
|
||||
value: Expr_BinaryOp_SmallerOrEqual(
|
||||
left: Scalar_LNumber(
|
||||
value: 0
|
||||
@@ -333,7 +369,9 @@ array(
|
||||
18: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_19
|
||||
name: Identifier(
|
||||
name: T_19
|
||||
)
|
||||
value: Expr_BinaryOp_Greater(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -348,7 +386,9 @@ array(
|
||||
19: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_20
|
||||
name: Identifier(
|
||||
name: T_20
|
||||
)
|
||||
value: Expr_BinaryOp_GreaterOrEqual(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -363,7 +403,9 @@ array(
|
||||
20: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_21
|
||||
name: Identifier(
|
||||
name: T_21
|
||||
)
|
||||
value: Expr_BinaryOp_Identical(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -378,7 +420,9 @@ array(
|
||||
21: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_22
|
||||
name: Identifier(
|
||||
name: T_22
|
||||
)
|
||||
value: Expr_BinaryOp_NotIdentical(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -393,7 +437,9 @@ array(
|
||||
22: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_23
|
||||
name: Identifier(
|
||||
name: T_23
|
||||
)
|
||||
value: Expr_BinaryOp_NotEqual(
|
||||
left: Scalar_LNumber(
|
||||
value: 0
|
||||
@@ -408,7 +454,9 @@ array(
|
||||
23: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_24
|
||||
name: Identifier(
|
||||
name: T_24
|
||||
)
|
||||
value: Expr_BinaryOp_Equal(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -423,7 +471,9 @@ array(
|
||||
24: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_25
|
||||
name: Identifier(
|
||||
name: T_25
|
||||
)
|
||||
value: Expr_BinaryOp_Plus(
|
||||
left: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -443,7 +493,9 @@ array(
|
||||
25: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_26
|
||||
name: Identifier(
|
||||
name: T_26
|
||||
)
|
||||
value: Expr_BinaryOp_Plus(
|
||||
left: Expr_BinaryOp_Plus(
|
||||
left: Scalar_String(
|
||||
@@ -463,7 +515,9 @@ array(
|
||||
26: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_27
|
||||
name: Identifier(
|
||||
name: T_27
|
||||
)
|
||||
value: Expr_BinaryOp_Pow(
|
||||
left: Scalar_LNumber(
|
||||
value: 2
|
||||
@@ -478,7 +532,9 @@ array(
|
||||
27: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_28
|
||||
name: Identifier(
|
||||
name: T_28
|
||||
)
|
||||
value: Expr_ArrayDimFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
@@ -515,7 +571,9 @@ array(
|
||||
28: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_29
|
||||
name: Identifier(
|
||||
name: T_29
|
||||
)
|
||||
value: Expr_BinaryOp_Minus(
|
||||
left: Scalar_LNumber(
|
||||
value: 12
|
||||
@@ -530,7 +588,9 @@ array(
|
||||
29: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_30
|
||||
name: Identifier(
|
||||
name: T_30
|
||||
)
|
||||
value: Expr_BinaryOp_BitwiseXor(
|
||||
left: Scalar_LNumber(
|
||||
value: 12
|
||||
@@ -545,7 +605,9 @@ array(
|
||||
30: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_31
|
||||
name: Identifier(
|
||||
name: T_31
|
||||
)
|
||||
value: Expr_BinaryOp_BitwiseAnd(
|
||||
left: Scalar_LNumber(
|
||||
value: 12
|
||||
@@ -560,7 +622,9 @@ array(
|
||||
31: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_32
|
||||
name: Identifier(
|
||||
name: T_32
|
||||
)
|
||||
value: Expr_BinaryOp_BitwiseOr(
|
||||
left: Scalar_LNumber(
|
||||
value: 12
|
||||
@@ -575,7 +639,9 @@ array(
|
||||
32: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_33
|
||||
name: Identifier(
|
||||
name: T_33
|
||||
)
|
||||
value: Expr_BinaryOp_Mod(
|
||||
left: Scalar_LNumber(
|
||||
value: 12
|
||||
@@ -590,7 +656,9 @@ array(
|
||||
33: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_34
|
||||
name: Identifier(
|
||||
name: T_34
|
||||
)
|
||||
value: Expr_BinaryOp_ShiftRight(
|
||||
left: Scalar_LNumber(
|
||||
value: 100
|
||||
@@ -605,7 +673,9 @@ array(
|
||||
34: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: T_35
|
||||
name: Identifier(
|
||||
name: T_35
|
||||
)
|
||||
value: Expr_BooleanNot(
|
||||
expr: Expr_ConstFetch(
|
||||
name: Name(
|
||||
|
@@ -4,9 +4,11 @@ Error suppression
|
||||
@$a;
|
||||
-----
|
||||
array(
|
||||
0: Expr_ErrorSuppress(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_ErrorSuppress(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -9,26 +9,38 @@ die();
|
||||
die('Exit!');
|
||||
-----
|
||||
array(
|
||||
0: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
1: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
2: Expr_Exit(
|
||||
expr: Scalar_String(
|
||||
value: Die!
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
)
|
||||
3: Expr_Exit(
|
||||
expr: null
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
)
|
||||
4: Expr_Exit(
|
||||
expr: null
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Exit(
|
||||
expr: Scalar_String(
|
||||
value: Die!
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Expr_Exit(
|
||||
expr: Scalar_String(
|
||||
value: Exit!
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_Exit(
|
||||
expr: Scalar_String(
|
||||
value: Exit!
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -9,90 +9,100 @@ 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
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
2: Stmt_Expression(
|
||||
expr: 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
|
||||
)
|
||||
byRef: true
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: true
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: f
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: true
|
||||
)
|
||||
byRef: false
|
||||
unpack: true
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@@ -7,27 +7,37 @@ A::B;
|
||||
A::class;
|
||||
-----
|
||||
array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: B
|
||||
)
|
||||
)
|
||||
name: B
|
||||
)
|
||||
2: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: class
|
||||
)
|
||||
)
|
||||
name: class
|
||||
)
|
||||
)
|
@@ -16,216 +16,238 @@ 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
|
||||
)
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Scalar_String(
|
||||
value: abc
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
2: Expr_ArrayDimFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Scalar_String(
|
||||
value: abc
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
dim: 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
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: 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
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_ArrayDimFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
3: Stmt_Expression(
|
||||
expr: 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
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
dim: 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
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
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
|
||||
4: Stmt_Expression(
|
||||
expr: 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: Stmt_Expression(
|
||||
expr: 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: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: FOO
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: BAR
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_ClassConstFetch(
|
||||
class: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
name: Identifier(
|
||||
name: BAR
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -16,114 +16,140 @@ $a->b['c']();
|
||||
a()['b'];
|
||||
-----
|
||||
array(
|
||||
0: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: a
|
||||
)
|
||||
comments: array(
|
||||
0: // function name variations
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // function name variations
|
||||
)
|
||||
)
|
||||
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(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: a
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
0: // function name variations
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
0: // function name variations
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
comments: array(
|
||||
0: // function name variations
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_Variable(
|
||||
name: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: a
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
|
@@ -8,48 +8,42 @@ New expression dereferencing
|
||||
(new A)['b']['c'];
|
||||
-----
|
||||
array(
|
||||
0: Expr_PropertyFetch(
|
||||
var: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_PropertyFetch(
|
||||
var: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_MethodCall(
|
||||
var: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
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(
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
@@ -63,8 +57,26 @@ array(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: 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
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -19,123 +19,162 @@ $a->b(){'c'}; // invalid PHP: drop Support?
|
||||
-----
|
||||
!!php5
|
||||
array(
|
||||
0: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // property fetch variations
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // property fetch variations
|
||||
)
|
||||
)
|
||||
name: b
|
||||
comments: array(
|
||||
0: // property fetch variations
|
||||
)
|
||||
)
|
||||
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
|
||||
comments: array(
|
||||
0: // method call variations
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // method call variations
|
||||
)
|
||||
)
|
||||
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
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Expr_ArrayDimFetch(
|
||||
var: Expr_MethodCall(
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // method call variations
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // method call variations
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // method call variations
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
8: Expr_ArrayDimFetch(
|
||||
var: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
9: Stmt_Nop(
|
||||
comments: array(
|
||||
|
@@ -9,16 +9,8 @@ $a{'b'};
|
||||
${$a}['b'];
|
||||
-----
|
||||
array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
1: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
@@ -26,37 +18,55 @@ array(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: 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(
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: null
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: 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
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -20,71 +20,65 @@ $a['b']::c();
|
||||
-----
|
||||
!!php5
|
||||
array(
|
||||
0: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
comments: array(
|
||||
0: // method name variations
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // method name variations
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // method name variations
|
||||
)
|
||||
)
|
||||
1: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
name: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
2: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
2: Stmt_Expression(
|
||||
expr: 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: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
4: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
)
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
@@ -92,82 +86,129 @@ array(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: d
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
5: Expr_ArrayDimFetch(
|
||||
var: Expr_StaticCall(
|
||||
4: Stmt_Expression(
|
||||
expr: 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: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
comments: array(
|
||||
0: // array dereferencing
|
||||
)
|
||||
)
|
||||
6: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: static
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: static
|
||||
)
|
||||
comments: array(
|
||||
0: // class name variations
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // class name variations
|
||||
)
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // class name variations
|
||||
)
|
||||
)
|
||||
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(
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_StaticCall(
|
||||
class: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
name: c
|
||||
args: array(
|
||||
)
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_StaticCall(
|
||||
class: Expr_Variable(
|
||||
name: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
9: Stmt_Expression(
|
||||
expr: Expr_StaticCall(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: c
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -14,73 +14,95 @@ A::$b{'c'};
|
||||
// class name variations can be found in staticCall.test
|
||||
-----
|
||||
array(
|
||||
0: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
comments: array(
|
||||
0: // property name variations
|
||||
)
|
||||
)
|
||||
name: b
|
||||
comments: array(
|
||||
0: // property name variations
|
||||
)
|
||||
)
|
||||
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(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
comments: array(
|
||||
0: // array access
|
||||
0: // property name variations
|
||||
)
|
||||
)
|
||||
name: b
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // array access
|
||||
0: // property name variations
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
comments: array(
|
||||
0: // array access
|
||||
0: // property name variations
|
||||
)
|
||||
)
|
||||
4: Expr_ArrayDimFetch(
|
||||
var: Expr_StaticPropertyFetch(
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: b
|
||||
name: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
comments: array(
|
||||
0: // array access
|
||||
)
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // array access
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
comments: array(
|
||||
0: // array access
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // array access
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Nop(
|
||||
|
@@ -8,33 +8,43 @@ require_once 'A.php';
|
||||
eval('A');
|
||||
-----
|
||||
array(
|
||||
0: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
)
|
||||
type: TYPE_INCLUDE (1)
|
||||
)
|
||||
type: 1
|
||||
)
|
||||
1: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
)
|
||||
type: TYPE_INCLUDE_ONCE (2)
|
||||
)
|
||||
type: 2
|
||||
)
|
||||
2: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
)
|
||||
type: TYPE_REQUIRE (3)
|
||||
)
|
||||
type: 3
|
||||
)
|
||||
3: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Include(
|
||||
expr: Scalar_String(
|
||||
value: A.php
|
||||
)
|
||||
type: TYPE_REQUIRE_ONCE (4)
|
||||
)
|
||||
type: 4
|
||||
)
|
||||
4: Expr_Eval(
|
||||
expr: Scalar_String(
|
||||
value: A
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_Eval(
|
||||
expr: Scalar_String(
|
||||
value: A
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -9,65 +9,75 @@ empty(foo());
|
||||
empty(array(1, 2, 3));
|
||||
-----
|
||||
array(
|
||||
0: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
2: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Empty(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
2: Expr_Variable(
|
||||
name: c
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Empty(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
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
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_Empty(
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
|
88
vendor/nikic/php-parser/test/code/parser/expr/listReferences.test
vendored
Normal file
88
vendor/nikic/php-parser/test/code/parser/expr/listReferences.test
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
List reference assignments (PHP 7.3)
|
||||
-----
|
||||
<?php
|
||||
|
||||
list(&$v) = $x;
|
||||
list('k' => &$v) = $x;
|
||||
[&$v] = $x;
|
||||
['k' => &$v] = $x;
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_List(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: v
|
||||
)
|
||||
byRef: true
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_List(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: k
|
||||
)
|
||||
value: Expr_Variable(
|
||||
name: v
|
||||
)
|
||||
byRef: true
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: v
|
||||
)
|
||||
byRef: true
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: k
|
||||
)
|
||||
value: Expr_Variable(
|
||||
name: v
|
||||
)
|
||||
byRef: true
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
79
vendor/nikic/php-parser/test/code/parser/expr/listWithKeys.test
vendored
Normal file
79
vendor/nikic/php-parser/test/code/parser/expr/listWithKeys.test
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
List destructing with keys
|
||||
-----
|
||||
<?php
|
||||
|
||||
list('a' => $b) = ['a' => 'b'];
|
||||
list('a' => list($b => $c), 'd' => $e) = $x;
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_List(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_List(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
value: Expr_List(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
value: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: d
|
||||
)
|
||||
value: Expr_Variable(
|
||||
name: e
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -21,103 +21,148 @@ $a = $b || $c;
|
||||
$a = $b or $c;
|
||||
-----
|
||||
array(
|
||||
0: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // boolean ops
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // boolean ops
|
||||
)
|
||||
)
|
||||
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
|
||||
comments: array(
|
||||
0: // logical ops
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // logical ops
|
||||
)
|
||||
)
|
||||
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(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // precedence
|
||||
0: // boolean ops
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
0: // boolean ops
|
||||
)
|
||||
)
|
||||
right: Expr_BinaryOp_BooleanAnd(
|
||||
comments: array(
|
||||
0: // boolean ops
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_BooleanOr(
|
||||
left: Expr_Variable(
|
||||
name: c
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: d
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_BooleanNot(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_BooleanNot(
|
||||
expr: Expr_BooleanNot(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_LogicalAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // logical ops
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // logical ops
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // logical ops
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_LogicalOr(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_LogicalXor(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_BooleanOr(
|
||||
left: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
right: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
8: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
8: Stmt_Expression(
|
||||
expr: 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: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_BinaryOp_BooleanOr(
|
||||
expr: Expr_BinaryOp_BooleanOr(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
@@ -126,34 +171,20 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
9: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_BinaryOp_BooleanOr(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
10: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_LogicalOr(
|
||||
left: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: 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
|
||||
)
|
||||
)
|
||||
)
|
@@ -34,223 +34,280 @@ $a ** $b ** $c;
|
||||
($a ** $b) ** $c;
|
||||
-----
|
||||
array(
|
||||
0: Expr_BitwiseNot(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_BitwiseNot(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
comments: array(
|
||||
0: // unary ops
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // unary ops
|
||||
)
|
||||
)
|
||||
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
|
||||
comments: array(
|
||||
0: // binary ops
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_UnaryPlus(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // binary ops
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_UnaryMinus(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
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(
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_BitwiseAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // associativity
|
||||
0: // binary ops
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // associativity
|
||||
0: // binary ops
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
comments: array(
|
||||
0: // binary ops
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_BitwiseOr(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_BitwiseXor(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Concat(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Div(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Minus(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
9: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Mod(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
10: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
11: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Plus(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
12: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_ShiftLeft(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
13: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_ShiftRight(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
14: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Pow(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
15: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Mul(
|
||||
left: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // associativity
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // associativity
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
comments: array(
|
||||
0: // associativity
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // associativity
|
||||
)
|
||||
)
|
||||
16: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_BinaryOp_Mul(
|
||||
16: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
right: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
17: Expr_BinaryOp_Plus(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
17: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Plus(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
right: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
right: Expr_BinaryOp_Mul(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
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
|
||||
comments: array(
|
||||
0: // pow is special
|
||||
)
|
||||
)
|
||||
right: Expr_BinaryOp_Pow(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
18: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Mul(
|
||||
left: Expr_BinaryOp_Plus(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
19: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Pow(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // pow is special
|
||||
)
|
||||
)
|
||||
right: Expr_BinaryOp_Pow(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // pow is special
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // pow is special
|
||||
)
|
||||
)
|
||||
20: Expr_BinaryOp_Pow(
|
||||
left: Expr_BinaryOp_Pow(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
20: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Pow(
|
||||
left: Expr_BinaryOp_Pow(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
name: c
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
@@ -19,128 +19,169 @@ new $a->b{'c'}();
|
||||
(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(
|
||||
)
|
||||
comments: array(
|
||||
0: // class name variations
|
||||
)
|
||||
)
|
||||
3: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
4: Expr_New(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
args: array(
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Expr_New(
|
||||
class: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: b
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // class name variations
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
comments: array(
|
||||
0: // class name variations
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
comments: array(
|
||||
0: // DNCR object access
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // DNCR object access
|
||||
)
|
||||
)
|
||||
6: Expr_New(
|
||||
class: Expr_PropertyFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_PropertyFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: c
|
||||
)
|
||||
name: b
|
||||
)
|
||||
name: c
|
||||
)
|
||||
args: array(
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
8: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
)
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: c
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
9: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
9: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
comments: array(
|
||||
0: // test regression introduces by new dereferencing syntax
|
||||
)
|
||||
)
|
||||
)
|
@@ -3,6 +3,23 @@ New without a class
|
||||
<?php
|
||||
new;
|
||||
-----
|
||||
!!php5
|
||||
Syntax error, unexpected ';' from 2:4 to 2:4
|
||||
array(
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
new;
|
||||
-----
|
||||
!!php7
|
||||
Syntax error, unexpected ';' from 2:4 to 2:4
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_Error(
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -4,9 +4,11 @@ Print
|
||||
print $a;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Print(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Print(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -8,38 +8,48 @@ Shell execution
|
||||
`test \"`;
|
||||
-----
|
||||
array(
|
||||
0: Expr_ShellExec(
|
||||
parts: array(
|
||||
)
|
||||
)
|
||||
1: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: test
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_ShellExec(
|
||||
parts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: test
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: test
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: test `
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: test
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: test \"
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: test `
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_ShellExec(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: test \"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@@ -17,38 +17,12 @@ $a ?? $b ? $c : $d;
|
||||
$a && $b ?? $c;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // ternary
|
||||
)
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
else: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
comments: array(
|
||||
0: // ternary
|
||||
)
|
||||
)
|
||||
1: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
if: null
|
||||
else: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
2: Expr_Ternary(
|
||||
cond: Expr_Ternary(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // precedence
|
||||
0: // ternary
|
||||
)
|
||||
)
|
||||
if: Expr_Variable(
|
||||
@@ -58,92 +32,143 @@ array(
|
||||
name: c
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
0: // ternary
|
||||
)
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
else: Expr_Variable(
|
||||
name: e
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
0: // ternary
|
||||
)
|
||||
)
|
||||
3: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
else: Expr_Ternary(
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
if: null
|
||||
else: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Ternary(
|
||||
cond: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
else: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
if: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
else: Expr_Variable(
|
||||
name: e
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // precedence
|
||||
)
|
||||
)
|
||||
4: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
3: Stmt_Expression(
|
||||
expr: 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: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // null coalesce
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // null coalesce
|
||||
)
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
comments: array(
|
||||
0: // null coalesce
|
||||
)
|
||||
)
|
||||
5: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: Expr_BinaryOp_Coalesce(
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
name: a
|
||||
)
|
||||
right: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: 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: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Coalesce(
|
||||
left: Expr_BinaryOp_BooleanAnd(
|
||||
left: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
right: 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
|
||||
)
|
||||
)
|
||||
)
|
140
vendor/nikic/php-parser/test/code/parser/expr/trailingCommas.test
vendored
Normal file
140
vendor/nikic/php-parser/test/code/parser/expr/trailingCommas.test
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
PHP 7.3 trailing comma additions
|
||||
-----
|
||||
<?php
|
||||
|
||||
foo($a, $b, );
|
||||
$foo->bar($a, $b, );
|
||||
Foo::bar($a, $b, );
|
||||
new Foo($a, $b, );
|
||||
unset($a, $b, );
|
||||
isset($a, $b, );
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
name: Identifier(
|
||||
name: bar
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: bar
|
||||
)
|
||||
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: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Unset(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -4,13 +4,24 @@ Non-simple variables are forbidden in PHP 7
|
||||
global $$foo->bar;
|
||||
-----
|
||||
!!php7
|
||||
Syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' from 2:13 to 2:14
|
||||
Syntax error, unexpected T_OBJECT_OPERATOR, expecting ';' from 2:13 to 2:14
|
||||
array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: bar
|
||||
0: Stmt_Global(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: bar
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -17,35 +17,8 @@ id(['udef', 'id'])[1]()('var_dump')(5);
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: id
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
@@ -55,7 +28,7 @@ array(
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: id
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
@@ -64,26 +37,17 @@ array(
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Name(
|
||||
@@ -92,123 +56,19 @@ array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 4
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: id
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: id
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: udef
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: id
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 5
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: x
|
||||
default: null
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Stmt_Return(
|
||||
expr: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: id
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
@@ -217,71 +77,23 @@ array(
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 8
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: f
|
||||
)
|
||||
expr: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: x
|
||||
default: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: f
|
||||
byRef: true
|
||||
)
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Stmt_Return(
|
||||
expr: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
if: null
|
||||
else: Expr_Variable(
|
||||
name: f
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: id
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
@@ -291,50 +103,309 @@ array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
value: Scalar_LNumber(
|
||||
value: 4
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 9
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: id
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: udef
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: id
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 5
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Stmt_Return(
|
||||
expr: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: id
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 8
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: obj
|
||||
)
|
||||
byRef: false
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: f
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: id
|
||||
)
|
||||
expr: Expr_Closure(
|
||||
static: false
|
||||
byRef: false
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
default: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
uses: array(
|
||||
0: Expr_ClosureUse(
|
||||
var: Expr_Variable(
|
||||
name: f
|
||||
)
|
||||
byRef: true
|
||||
)
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Stmt_Return(
|
||||
expr: Expr_Ternary(
|
||||
cond: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
if: null
|
||||
else: Expr_Variable(
|
||||
name: f
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 9
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: obj
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: id
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: id
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: id
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 10
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Scalar_String(
|
||||
value: id
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
@@ -351,8 +422,8 @@ array(
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: id
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
@@ -361,30 +432,26 @@ array(
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
value: Scalar_LNumber(
|
||||
value: 12
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 10
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Scalar_String(
|
||||
value: id
|
||||
name: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: i
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: d
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
@@ -392,7 +459,7 @@ array(
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: id
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
@@ -401,81 +468,40 @@ array(
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
value: Scalar_LNumber(
|
||||
value: 13
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 12
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
9: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: i
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: d
|
||||
)
|
||||
name: Scalar_String(
|
||||
value: \id
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
value: Scalar_LNumber(
|
||||
value: 14
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 13
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
9: Expr_FuncCall(
|
||||
name: Expr_FuncCall(
|
||||
name: Scalar_String(
|
||||
value: \id
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_String(
|
||||
value: var_dump
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 14
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -8,67 +8,77 @@ isset("str"->a);
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_BinaryOp_Plus(
|
||||
left: Expr_Array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_BinaryOp_Plus(
|
||||
left: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
right: Expr_Array(
|
||||
items: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_PropertyFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 0
|
||||
key: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
value: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
right: Expr_Array(
|
||||
items: array(
|
||||
)
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_PropertyFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_PropertyFetch(
|
||||
var: Scalar_String(
|
||||
value: str
|
||||
)
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_Isset(
|
||||
vars: array(
|
||||
0: Expr_PropertyFetch(
|
||||
var: Scalar_String(
|
||||
value: str
|
||||
)
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -10,100 +10,118 @@ A::A[0][1][2];
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
name: A
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_MethodCall(
|
||||
var: Scalar_String(
|
||||
value: string
|
||||
)
|
||||
name: Identifier(
|
||||
name: length
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Clone(
|
||||
expr: Expr_Variable(
|
||||
name: obj
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
2: Expr_MethodCall(
|
||||
var: Scalar_String(
|
||||
value: string
|
||||
)
|
||||
name: length
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
3: Expr_FuncCall(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_PropertyFetch(
|
||||
var: Expr_Clone(
|
||||
expr: Expr_Variable(
|
||||
name: obj
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Expr_Assign(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -11,85 +11,109 @@ new $weird[0]->foo::$className;
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Expr_New(
|
||||
class: Expr_Variable(
|
||||
name: className
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
1: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: array
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: className
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
2: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: array
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: className
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
3: Expr_New(
|
||||
class: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: obj
|
||||
)
|
||||
name: className
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
4: Expr_New(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
)
|
||||
)
|
||||
name: className
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
5: Expr_New(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_Variable(
|
||||
name: test
|
||||
name: className
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
name: className
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
6: Expr_New(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: array
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: className
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: array
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: className
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_PropertyFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: weird
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
var: Expr_Variable(
|
||||
name: obj
|
||||
)
|
||||
name: Identifier(
|
||||
name: className
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
)
|
||||
)
|
||||
name: foo
|
||||
name: VarLikeIdentifier(
|
||||
name: className
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
name: className
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
class: Expr_Variable(
|
||||
name: test
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: className
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
class: Expr_PropertyFetch(
|
||||
var: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: weird
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: className
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -12,82 +12,112 @@ A::$A::$b;
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
1: Expr_StaticPropertyFetch(
|
||||
class: Expr_Variable(
|
||||
name: A
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_StaticPropertyFetch(
|
||||
class: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
2: Expr_StaticPropertyFetch(
|
||||
class: Scalar_String(
|
||||
value: A
|
||||
)
|
||||
name: b
|
||||
)
|
||||
3: Expr_StaticPropertyFetch(
|
||||
class: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_StaticPropertyFetch(
|
||||
class: Scalar_String(
|
||||
value: A
|
||||
)
|
||||
right: Scalar_String(
|
||||
value:
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
4: Expr_StaticPropertyFetch(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Scalar_String(
|
||||
value: A
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
5: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
6: Expr_ArrayDimFetch(
|
||||
var: Expr_StaticPropertyFetch(
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_StaticPropertyFetch(
|
||||
class: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: A
|
||||
)
|
||||
right: Scalar_String(
|
||||
value:
|
||||
)
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_StaticPropertyFetch(
|
||||
class: Expr_ArrayDimFetch(
|
||||
var: Scalar_String(
|
||||
value: A
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Expr_Variable(
|
||||
name: c
|
||||
name: b
|
||||
)
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
7: Expr_StaticPropertyFetch(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_ArrayDimFetch(
|
||||
var: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
name: A
|
||||
dim: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
name: b
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_StaticPropertyFetch(
|
||||
class: Expr_StaticPropertyFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -11,45 +11,57 @@ $$a['b'];
|
||||
-----
|
||||
!!php5
|
||||
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(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
4: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Expr_Variable(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
57
vendor/nikic/php-parser/test/code/parser/exprStmtMode.test
vendored
Normal file
57
vendor/nikic/php-parser/test/code/parser/exprStmtMode.test
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
Expression statement mode
|
||||
-----
|
||||
<?php
|
||||
$a = $b;
|
||||
yield $x;
|
||||
-----
|
||||
!!exprStmts
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
$a = $b
|
||||
$c = $d
|
||||
-----
|
||||
!!exprStmts
|
||||
Syntax error, unexpected T_VARIABLE from 3:1 to 3:2
|
||||
Syntax error, unexpected EOF from 3:8 to 3:8
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
expr: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -17,44 +17,70 @@ B"Hi";
|
||||
"!\xFF!\377!\400!\0!";
|
||||
-----
|
||||
array(
|
||||
0: Scalar_String(
|
||||
value:
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value:
|
||||
)
|
||||
)
|
||||
1: Scalar_String(
|
||||
value:
|
||||
1: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value:
|
||||
)
|
||||
)
|
||||
2: Scalar_String(
|
||||
value:
|
||||
2: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value:
|
||||
)
|
||||
)
|
||||
3: Scalar_String(
|
||||
value:
|
||||
3: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value:
|
||||
)
|
||||
)
|
||||
4: Scalar_String(
|
||||
value: Hi
|
||||
4: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Hi
|
||||
)
|
||||
)
|
||||
5: Scalar_String(
|
||||
value: Hi
|
||||
5: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Hi
|
||||
)
|
||||
)
|
||||
6: Scalar_String(
|
||||
value: Hi
|
||||
6: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Hi
|
||||
)
|
||||
)
|
||||
7: Scalar_String(
|
||||
value: Hi
|
||||
7: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Hi
|
||||
)
|
||||
)
|
||||
8: Scalar_String(
|
||||
value: Hi
|
||||
8: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Hi
|
||||
)
|
||||
)
|
||||
9: Scalar_String(
|
||||
value: Hi
|
||||
9: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Hi
|
||||
)
|
||||
)
|
||||
10: Scalar_String(
|
||||
value: !'!\!\a!
|
||||
10: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: !'!\!\a!
|
||||
)
|
||||
)
|
||||
11: Scalar_String(
|
||||
value: !"!\!$!
|
||||
!@@{ "\r" }@@!@@{ "\t" }@@!@@{ "\f" }@@!@@{ "\v" }@@!@@{ chr(27) /* "\e" */ }@@!\a
|
||||
11: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: !"!\!$!
|
||||
!@@{ "\r" }@@!@@{ "\t" }@@!@@{ "\f" }@@!@@{ "\v" }@@!@@{ chr(27) /* "\e" */ }@@!\a
|
||||
)
|
||||
)
|
||||
12: Scalar_String(
|
||||
value: !@@{ chr(255) }@@!@@{ chr(255) }@@!@@{ chr(0) }@@!@@{ chr(0) }@@!
|
||||
12: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: !@@{ chr(255) }@@!@@{ chr(255) }@@!@@{ chr(0) }@@!@@{ chr(0) }@@!
|
||||
)
|
||||
)
|
||||
)
|
@@ -30,61 +30,86 @@ EOS;
|
||||
|
||||
-----
|
||||
array(
|
||||
0: Scalar_String(
|
||||
value:
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value:
|
||||
comments: array(
|
||||
0: // empty strings
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // empty strings
|
||||
)
|
||||
)
|
||||
1: Scalar_String(
|
||||
value:
|
||||
1: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value:
|
||||
)
|
||||
)
|
||||
2: Scalar_String(
|
||||
value: Test '" $a \n
|
||||
2: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Test '" $a \n
|
||||
comments: array(
|
||||
0: // constant encapsed strings
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // constant encapsed strings
|
||||
)
|
||||
)
|
||||
3: Scalar_String(
|
||||
value: Test '" $a
|
||||
3: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Test '" $a
|
||||
|
||||
)
|
||||
)
|
||||
4: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: Test
|
||||
4: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: Test
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: a
|
||||
comments: array(
|
||||
0: // encapsed strings
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // encapsed strings
|
||||
)
|
||||
)
|
||||
5: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: Test
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
2: Scalar_EncapsedStringPart(
|
||||
value: and
|
||||
)
|
||||
3: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
5: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: Test
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
2: Scalar_EncapsedStringPart(
|
||||
value: and
|
||||
)
|
||||
3: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
name: Identifier(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
4: Scalar_EncapsedStringPart(
|
||||
value: test
|
||||
)
|
||||
name: c
|
||||
)
|
||||
4: Scalar_EncapsedStringPart(
|
||||
value: test
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Scalar_String(
|
||||
value: Binary
|
||||
6: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Binary
|
||||
)
|
||||
)
|
||||
)
|
@@ -14,47 +14,63 @@ Trailing newlines in doc strings
|
||||
|
||||
-----
|
||||
array(
|
||||
0: Scalar_String(
|
||||
value:
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value:
|
||||
)
|
||||
)
|
||||
1: Scalar_String(
|
||||
value:
|
||||
1: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value:
|
||||
|
||||
)
|
||||
)
|
||||
2: Scalar_String(
|
||||
value: Foo
|
||||
2: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Foo
|
||||
|
||||
)
|
||||
)
|
||||
3: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: var
|
||||
)
|
||||
1: Scalar_EncapsedStringPart(
|
||||
value:
|
||||
3: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: var
|
||||
)
|
||||
1: Scalar_EncapsedStringPart(
|
||||
value:
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Scalar_String(
|
||||
value:
|
||||
4: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value:
|
||||
)
|
||||
)
|
||||
5: Scalar_String(
|
||||
value:
|
||||
5: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value:
|
||||
|
||||
)
|
||||
)
|
||||
6: Scalar_String(
|
||||
value: Foo
|
||||
6: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Foo
|
||||
|
||||
)
|
||||
)
|
||||
7: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: var
|
||||
)
|
||||
1: Scalar_EncapsedStringPart(
|
||||
value:
|
||||
7: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: var
|
||||
)
|
||||
1: Scalar_EncapsedStringPart(
|
||||
value:
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
82
vendor/nikic/php-parser/test/code/parser/scalar/encapsedNegVarOffset.test
vendored
Normal file
82
vendor/nikic/php-parser/test/code/parser/scalar/encapsedNegVarOffset.test
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
Encapsed string negative var offsets
|
||||
-----
|
||||
<?php
|
||||
"$a[-0]";
|
||||
"$a[-1]";
|
||||
"$a[-0x0]";
|
||||
"$a[-00]";
|
||||
"$a[@@{ -PHP_INT_MAX - 1 }@@]";
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: -0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: -1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: -0x0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: -00
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: @@{ -PHP_INT_MAX - 1 }@@
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -6,7 +6,11 @@ Encapsed strings
|
||||
"$A->B";
|
||||
"$A[B]";
|
||||
"$A[0]";
|
||||
"$A[1234]";
|
||||
"$A[9223372036854775808]";
|
||||
"$A[000]";
|
||||
"$A[0x0]";
|
||||
"$A[0b0]";
|
||||
"$A[$B]";
|
||||
"{$A}";
|
||||
"{$A['B']}";
|
||||
@@ -24,219 +28,317 @@ b"$A";
|
||||
B"$A";
|
||||
-----
|
||||
array(
|
||||
0: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
name: B
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: 0
|
||||
1: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
name: Identifier(
|
||||
name: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: 0x0
|
||||
2: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
3: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_LNumber(
|
||||
value: 1234
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: 9223372036854775808
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: 000
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: 0x0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: 0b0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
9: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Expr_Variable(
|
||||
name: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
10: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Expr_Variable(
|
||||
)
|
||||
)
|
||||
)
|
||||
11: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
12: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
13: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
14: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
15: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: \{
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
2: Scalar_EncapsedStringPart(
|
||||
value: }
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
16: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: \{
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
2: Scalar_EncapsedStringPart(
|
||||
value: }
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
17: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: \
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
18: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: \{
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
2: Scalar_EncapsedStringPart(
|
||||
value: }
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
19: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
1: Scalar_EncapsedStringPart(
|
||||
value: [B]
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
20: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: $
|
||||
)
|
||||
1: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
21: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: A
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: B
|
||||
2: Scalar_EncapsedStringPart(
|
||||
value: C
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
9: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
10: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
22: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
11: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: \{
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
2: Scalar_EncapsedStringPart(
|
||||
value: }
|
||||
)
|
||||
)
|
||||
)
|
||||
12: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: \{
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
2: Scalar_EncapsedStringPart(
|
||||
value: }
|
||||
)
|
||||
)
|
||||
)
|
||||
13: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: \
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
14: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: \{
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
2: Scalar_EncapsedStringPart(
|
||||
value: }
|
||||
)
|
||||
)
|
||||
)
|
||||
15: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: Expr_Variable(
|
||||
23: Stmt_Expression(
|
||||
expr: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
1: Scalar_EncapsedStringPart(
|
||||
value: [B]
|
||||
)
|
||||
)
|
||||
)
|
||||
16: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: $
|
||||
)
|
||||
1: Expr_ArrayDimFetch(
|
||||
var: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
dim: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
17: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Scalar_EncapsedStringPart(
|
||||
value: A
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: B
|
||||
)
|
||||
2: Scalar_EncapsedStringPart(
|
||||
value: C
|
||||
)
|
||||
)
|
||||
)
|
||||
18: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
19: Scalar_Encapsed(
|
||||
parts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -22,53 +22,87 @@ Different float syntaxes
|
||||
0b1111111111111111111111111111111111111111111111111111111111111111;
|
||||
-----
|
||||
array(
|
||||
0: Scalar_DNumber(
|
||||
value: 0
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
1: Scalar_DNumber(
|
||||
value: 0
|
||||
1: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
2: Scalar_DNumber(
|
||||
value: 0
|
||||
2: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
3: Scalar_DNumber(
|
||||
value: 0
|
||||
3: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
4: Scalar_DNumber(
|
||||
value: 0
|
||||
4: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
5: Scalar_DNumber(
|
||||
value: 0
|
||||
5: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
6: Scalar_DNumber(
|
||||
value: 0
|
||||
6: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
7: Scalar_DNumber(
|
||||
value: 302000000000
|
||||
7: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 302000000000
|
||||
)
|
||||
)
|
||||
8: Scalar_DNumber(
|
||||
value: 3.002E+102
|
||||
8: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 3.002E+102
|
||||
)
|
||||
)
|
||||
9: Scalar_DNumber(
|
||||
value: INF
|
||||
9: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: INF
|
||||
)
|
||||
)
|
||||
10: Scalar_DNumber(
|
||||
value: 1.844674407371E+19
|
||||
10: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 1.844674407371E+19
|
||||
comments: array(
|
||||
0: // various integer -> float overflows
|
||||
1: // (all are actually the same number, just in different representations)
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // various integer -> float overflows
|
||||
1: // (all are actually the same number, just in different representations)
|
||||
)
|
||||
)
|
||||
11: Scalar_DNumber(
|
||||
value: 1.844674407371E+19
|
||||
11: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 1.844674407371E+19
|
||||
)
|
||||
)
|
||||
12: Scalar_DNumber(
|
||||
value: 1.844674407371E+19
|
||||
12: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 1.844674407371E+19
|
||||
)
|
||||
)
|
||||
13: Scalar_DNumber(
|
||||
value: 1.844674407371E+19
|
||||
13: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 1.844674407371E+19
|
||||
)
|
||||
)
|
||||
14: Scalar_DNumber(
|
||||
value: 1.844674407371E+19
|
||||
14: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: 1.844674407371E+19
|
||||
)
|
||||
)
|
||||
)
|
@@ -13,31 +13,49 @@ Different integer syntaxes
|
||||
0b111000111000;
|
||||
-----
|
||||
array(
|
||||
0: Scalar_LNumber(
|
||||
value: 0
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
1: Scalar_LNumber(
|
||||
value: 1
|
||||
1: Stmt_Expression(
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
2: Scalar_LNumber(
|
||||
value: @@{ PHP_INT_MAX }@@
|
||||
2: Stmt_Expression(
|
||||
expr: Scalar_LNumber(
|
||||
value: @@{ PHP_INT_MAX }@@
|
||||
)
|
||||
)
|
||||
3: Scalar_DNumber(
|
||||
value: @@{ PHP_INT_MAX + 1 }@@
|
||||
3: Stmt_Expression(
|
||||
expr: Scalar_DNumber(
|
||||
value: @@{ PHP_INT_MAX + 1 }@@
|
||||
)
|
||||
)
|
||||
4: Scalar_LNumber(
|
||||
value: 4095
|
||||
4: Stmt_Expression(
|
||||
expr: Scalar_LNumber(
|
||||
value: 4095
|
||||
)
|
||||
)
|
||||
5: Scalar_LNumber(
|
||||
value: 4095
|
||||
5: Stmt_Expression(
|
||||
expr: Scalar_LNumber(
|
||||
value: 4095
|
||||
)
|
||||
)
|
||||
6: Scalar_LNumber(
|
||||
value: 4095
|
||||
6: Stmt_Expression(
|
||||
expr: Scalar_LNumber(
|
||||
value: 4095
|
||||
)
|
||||
)
|
||||
7: Scalar_LNumber(
|
||||
value: 511
|
||||
7: Stmt_Expression(
|
||||
expr: Scalar_LNumber(
|
||||
value: 511
|
||||
)
|
||||
)
|
||||
8: Scalar_LNumber(
|
||||
value: 3640
|
||||
8: Stmt_Expression(
|
||||
expr: Scalar_LNumber(
|
||||
value: 3640
|
||||
)
|
||||
)
|
||||
)
|
@@ -5,13 +5,22 @@ Invalid octal literals
|
||||
-----
|
||||
!!php7
|
||||
Invalid numeric literal from 2:1 to 2:4
|
||||
array(
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
0787;
|
||||
-----
|
||||
!!php5
|
||||
array(
|
||||
0: Scalar_LNumber(
|
||||
value: 7
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_LNumber(
|
||||
value: 7
|
||||
)
|
||||
)
|
||||
)
|
@@ -12,20 +12,36 @@ __NAMESPACE__;
|
||||
__TRAIT__;
|
||||
-----
|
||||
array(
|
||||
0: Scalar_MagicConst_Class(
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_MagicConst_Class(
|
||||
)
|
||||
)
|
||||
1: Scalar_MagicConst_Dir(
|
||||
1: Stmt_Expression(
|
||||
expr: Scalar_MagicConst_Dir(
|
||||
)
|
||||
)
|
||||
2: Scalar_MagicConst_File(
|
||||
2: Stmt_Expression(
|
||||
expr: Scalar_MagicConst_File(
|
||||
)
|
||||
)
|
||||
3: Scalar_MagicConst_Function(
|
||||
3: Stmt_Expression(
|
||||
expr: Scalar_MagicConst_Function(
|
||||
)
|
||||
)
|
||||
4: Scalar_MagicConst_Line(
|
||||
4: Stmt_Expression(
|
||||
expr: Scalar_MagicConst_Line(
|
||||
)
|
||||
)
|
||||
5: Scalar_MagicConst_Method(
|
||||
5: Stmt_Expression(
|
||||
expr: Scalar_MagicConst_Method(
|
||||
)
|
||||
)
|
||||
6: Scalar_MagicConst_Namespace(
|
||||
6: Stmt_Expression(
|
||||
expr: Scalar_MagicConst_Namespace(
|
||||
)
|
||||
)
|
||||
7: Scalar_MagicConst_Trait(
|
||||
7: Stmt_Expression(
|
||||
expr: Scalar_MagicConst_Trait(
|
||||
)
|
||||
)
|
||||
)
|
@@ -8,13 +8,19 @@ Unicode escape sequence
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Scalar_String(
|
||||
value: @@{"\0"}@@
|
||||
0: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: @@{"\0"}@@
|
||||
)
|
||||
)
|
||||
1: Scalar_String(
|
||||
value: Ĕ
|
||||
1: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: Ĕ
|
||||
)
|
||||
)
|
||||
2: Scalar_String(
|
||||
value: @@{"\xF0\x9F\x98\x82"}@@
|
||||
2: Stmt_Expression(
|
||||
expr: Scalar_String(
|
||||
value: @@{"\xF0\x9F\x98\x82"}@@
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -54,16 +54,20 @@ class Foo {
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
type: 0
|
||||
name: Test
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: Test
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
type: 0
|
||||
flags: 0
|
||||
byRef: false
|
||||
name: array
|
||||
name: Identifier(
|
||||
name: array
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -71,9 +75,11 @@ array(
|
||||
)
|
||||
)
|
||||
1: Stmt_ClassMethod(
|
||||
type: 0
|
||||
flags: 0
|
||||
byRef: false
|
||||
name: public
|
||||
name: Identifier(
|
||||
name: public
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -81,9 +87,11 @@ array(
|
||||
)
|
||||
)
|
||||
2: Stmt_ClassMethod(
|
||||
type: 8
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: list
|
||||
name: Identifier(
|
||||
name: list
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -91,9 +99,11 @@ array(
|
||||
)
|
||||
)
|
||||
3: Stmt_ClassMethod(
|
||||
type: 8
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: protected
|
||||
name: Identifier(
|
||||
name: protected
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -101,33 +111,42 @@ array(
|
||||
)
|
||||
)
|
||||
4: Stmt_Property(
|
||||
type: 1
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: class
|
||||
name: VarLikeIdentifier(
|
||||
name: class
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Property(
|
||||
type: 1
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: private
|
||||
name: VarLikeIdentifier(
|
||||
name: private
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_ClassConst(
|
||||
flags: 0
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: TRAIT
|
||||
name: Identifier(
|
||||
name: TRAIT
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
1: Const(
|
||||
name: FINAL
|
||||
name: Identifier(
|
||||
name: FINAL
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 4
|
||||
)
|
||||
@@ -135,140 +154,198 @@ array(
|
||||
)
|
||||
)
|
||||
7: Stmt_ClassConst(
|
||||
flags: 0
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: __CLASS__
|
||||
name: Identifier(
|
||||
name: __CLASS__
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
1: Const(
|
||||
name: __TRAIT__
|
||||
name: Identifier(
|
||||
name: __TRAIT__
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
2: Const(
|
||||
name: __FUNCTION__
|
||||
name: Identifier(
|
||||
name: __FUNCTION__
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
3: Const(
|
||||
name: __METHOD__
|
||||
name: Identifier(
|
||||
name: __METHOD__
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 4
|
||||
)
|
||||
)
|
||||
4: Const(
|
||||
name: __LINE__
|
||||
name: Identifier(
|
||||
name: __LINE__
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 5
|
||||
)
|
||||
)
|
||||
5: Const(
|
||||
name: __FILE__
|
||||
name: Identifier(
|
||||
name: __FILE__
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 6
|
||||
)
|
||||
)
|
||||
6: Const(
|
||||
name: __DIR__
|
||||
name: Identifier(
|
||||
name: __DIR__
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 7
|
||||
)
|
||||
)
|
||||
7: Const(
|
||||
name: __NAMESPACE__
|
||||
name: Identifier(
|
||||
name: __NAMESPACE__
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 8
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Nop(
|
||||
comments: array(
|
||||
0: // __halt_compiler does not work
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: t
|
||||
)
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: t
|
||||
)
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: t
|
||||
)
|
||||
name: Identifier(
|
||||
name: array
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: t
|
||||
)
|
||||
name: array
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
3: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: t
|
||||
)
|
||||
name: public
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
4: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: t
|
||||
)
|
||||
name: Identifier(
|
||||
name: public
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
name: list
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
5: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: list
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
name: protected
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
6: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: t
|
||||
)
|
||||
name: class
|
||||
)
|
||||
7: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: t
|
||||
)
|
||||
name: private
|
||||
)
|
||||
8: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_StaticCall(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: protected
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
name: TRAIT
|
||||
)
|
||||
9: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: t
|
||||
)
|
||||
name: Identifier(
|
||||
name: class
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_PropertyFetch(
|
||||
var: Expr_Variable(
|
||||
name: t
|
||||
)
|
||||
name: Identifier(
|
||||
name: private
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: TRAIT
|
||||
)
|
||||
)
|
||||
)
|
||||
9: Stmt_Expression(
|
||||
expr: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Test
|
||||
)
|
||||
)
|
||||
name: Identifier(
|
||||
name: FINAL
|
||||
)
|
||||
)
|
||||
name: FINAL
|
||||
)
|
||||
10: Stmt_Class(
|
||||
type: 0
|
||||
name: Foo
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: Foo
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
@@ -293,7 +370,9 @@ array(
|
||||
0: TraitA
|
||||
)
|
||||
)
|
||||
method: catch
|
||||
method: Identifier(
|
||||
name: catch
|
||||
)
|
||||
insteadof: array(
|
||||
0: Name_Relative(
|
||||
parts: array(
|
||||
@@ -308,9 +387,13 @@ array(
|
||||
0: TraitA
|
||||
)
|
||||
)
|
||||
method: list
|
||||
method: Identifier(
|
||||
name: list
|
||||
)
|
||||
newModifier: null
|
||||
newName: foreach
|
||||
newName: Identifier(
|
||||
name: foreach
|
||||
)
|
||||
)
|
||||
2: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: Name(
|
||||
@@ -318,9 +401,13 @@ array(
|
||||
0: TraitB
|
||||
)
|
||||
)
|
||||
method: throw
|
||||
newModifier: 2
|
||||
newName: public
|
||||
method: Identifier(
|
||||
name: throw
|
||||
)
|
||||
newModifier: MODIFIER_PROTECTED (2)
|
||||
newName: Identifier(
|
||||
name: public
|
||||
)
|
||||
)
|
||||
3: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: Name(
|
||||
@@ -328,15 +415,21 @@ array(
|
||||
0: TraitB
|
||||
)
|
||||
)
|
||||
method: self
|
||||
newModifier: 2
|
||||
method: Identifier(
|
||||
name: self
|
||||
)
|
||||
newModifier: MODIFIER_PROTECTED (2)
|
||||
newName: null
|
||||
)
|
||||
4: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: null
|
||||
method: exit
|
||||
method: Identifier(
|
||||
name: exit
|
||||
)
|
||||
newModifier: null
|
||||
newName: die
|
||||
newName: Identifier(
|
||||
name: die
|
||||
)
|
||||
)
|
||||
5: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: Name_FullyQualified(
|
||||
@@ -344,9 +437,13 @@ array(
|
||||
0: TraitC
|
||||
)
|
||||
)
|
||||
method: exit
|
||||
method: Identifier(
|
||||
name: exit
|
||||
)
|
||||
newModifier: null
|
||||
newName: bye
|
||||
newName: Identifier(
|
||||
name: bye
|
||||
)
|
||||
)
|
||||
6: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: Name_Relative(
|
||||
@@ -354,9 +451,13 @@ array(
|
||||
0: TraitC
|
||||
)
|
||||
)
|
||||
method: exit
|
||||
method: Identifier(
|
||||
name: exit
|
||||
)
|
||||
newModifier: null
|
||||
newName: byebye
|
||||
newName: Identifier(
|
||||
name: byebye
|
||||
)
|
||||
)
|
||||
7: Stmt_TraitUseAdaptation_Precedence(
|
||||
trait: Name(
|
||||
@@ -364,7 +465,14 @@ array(
|
||||
0: TraitA
|
||||
)
|
||||
)
|
||||
method: catch
|
||||
method: Identifier(
|
||||
name: catch
|
||||
comments: array(
|
||||
0: //
|
||||
1: /** doc comment */
|
||||
2: #
|
||||
)
|
||||
)
|
||||
insteadof: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
|
@@ -22,8 +22,10 @@ array(
|
||||
name: a
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
elseifs: array(
|
||||
@@ -32,16 +34,20 @@ array(
|
||||
name: b
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: B
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
else: Stmt_Else(
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: C
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: C
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -54,8 +60,10 @@ array(
|
||||
loop: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: foo
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -69,8 +77,10 @@ array(
|
||||
name: b
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: AB
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: AB
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -79,33 +89,41 @@ array(
|
||||
name: a
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Do(
|
||||
stmts: array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: A
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Declare(
|
||||
declares: array(
|
||||
0: Stmt_DeclareDeclare(
|
||||
key: a
|
||||
key: Identifier(
|
||||
name: a
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: C
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: C
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@@ -9,16 +9,20 @@ abstract class A {
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
type: 16
|
||||
name: A
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
type: 1
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: a
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -26,9 +30,11 @@ array(
|
||||
)
|
||||
)
|
||||
1: Stmt_ClassMethod(
|
||||
type: 17
|
||||
flags: MODIFIER_PUBLIC | MODIFIER_ABSTRACT (17)
|
||||
byRef: false
|
||||
name: b
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -36,4 +42,4 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -22,131 +22,147 @@ class A {
|
||||
}
|
||||
-----
|
||||
array(
|
||||
0: Expr_New(
|
||||
class: Stmt_Class(
|
||||
type: 0
|
||||
name: null
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
type: 1
|
||||
byRef: false
|
||||
name: test
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Stmt_Class(
|
||||
flags: 0
|
||||
name: null
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
1: Expr_New(
|
||||
class: Stmt_Class(
|
||||
type: 0
|
||||
name: null
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
1: Name(
|
||||
parts: array(
|
||||
0: C
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
2: Expr_New(
|
||||
class: Stmt_Class(
|
||||
type: 0
|
||||
name: null
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
type: 1
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: foo
|
||||
default: null
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_New(
|
||||
class: Stmt_Class(
|
||||
type: 0
|
||||
name: null
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Stmt_Class(
|
||||
flags: 0
|
||||
name: null
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
)
|
||||
)
|
||||
1: Name(
|
||||
parts: array(
|
||||
0: C
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
args: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_TraitUse(
|
||||
traits: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: T
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Stmt_Class(
|
||||
flags: 0
|
||||
name: null
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: foo
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
adaptations: array(
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Stmt_Class(
|
||||
flags: 0
|
||||
name: null
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_TraitUse(
|
||||
traits: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: T
|
||||
)
|
||||
)
|
||||
)
|
||||
adaptations: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
1: Arg(
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_Class(
|
||||
type: 0
|
||||
name: A
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
type: 1
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: test
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -154,7 +170,7 @@ array(
|
||||
0: Stmt_Return(
|
||||
expr: Expr_New(
|
||||
class: Stmt_Class(
|
||||
type: 0
|
||||
flags: 0
|
||||
name: null
|
||||
extends: Name(
|
||||
parts: array(
|
||||
@@ -165,9 +181,12 @@ array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: 0
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: A
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
@@ -191,4 +210,4 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -17,8 +17,10 @@ array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Class(
|
||||
type: 0
|
||||
name: A
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
|
137
vendor/nikic/php-parser/test/code/parser/stmt/class/constModifierErrors.test
vendored
Normal file
137
vendor/nikic/php-parser/test/code/parser/stmt/class/constModifierErrors.test
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
Invalid class constant modifiers
|
||||
-----
|
||||
<?php
|
||||
class A {
|
||||
static const X = 1;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
Cannot use 'static' as constant modifier from 3:5 to 3:10
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: X
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
class A {
|
||||
abstract const X = 1;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
Cannot use 'abstract' as constant modifier from 3:5 to 3:12
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: X
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
class A {
|
||||
final const X = 1;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
Cannot use 'final' as constant modifier from 3:5 to 3:9
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: MODIFIER_FINAL (32)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: X
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php
|
||||
class A {
|
||||
public public const X = 1;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
Multiple access type modifiers are not allowed from 3:12 to 3:17
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: X
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
77
vendor/nikic/php-parser/test/code/parser/stmt/class/constModifiers.test
vendored
Normal file
77
vendor/nikic/php-parser/test/code/parser/stmt/class/constModifiers.test
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
Class constant modifiers
|
||||
-----
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
const A = 1;
|
||||
public const B = 2;
|
||||
protected const C = 3;
|
||||
private const D = 4;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: Foo
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: 0
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_ClassConst(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: B
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 2
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_ClassConst(
|
||||
flags: MODIFIER_PROTECTED (2)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: C
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 3
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_ClassConst(
|
||||
flags: MODIFIER_PRIVATE (4)
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: Identifier(
|
||||
name: D
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 4
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -6,8 +6,10 @@ final class A {}
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
type: 32
|
||||
name: A
|
||||
flags: MODIFIER_FINAL (32)
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
|
@@ -14,43 +14,53 @@ abstract class A {
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
type: 16
|
||||
name: A
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
type: 0
|
||||
flags: 0
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: a
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Property(
|
||||
type: 8
|
||||
flags: MODIFIER_STATIC (8)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: b
|
||||
name: VarLikeIdentifier(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_ClassMethod(
|
||||
type: 16
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
byRef: false
|
||||
name: c
|
||||
name: Identifier(
|
||||
name: c
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: null
|
||||
)
|
||||
3: Stmt_ClassMethod(
|
||||
type: 32
|
||||
flags: MODIFIER_FINAL (32)
|
||||
byRef: false
|
||||
name: d
|
||||
name: Identifier(
|
||||
name: d
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -58,9 +68,11 @@ array(
|
||||
)
|
||||
)
|
||||
4: Stmt_ClassMethod(
|
||||
type: 8
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: e
|
||||
name: Identifier(
|
||||
name: e
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -68,9 +80,11 @@ array(
|
||||
)
|
||||
)
|
||||
5: Stmt_ClassMethod(
|
||||
type: 40
|
||||
flags: MODIFIER_STATIC | MODIFIER_FINAL (40)
|
||||
byRef: false
|
||||
name: f
|
||||
name: Identifier(
|
||||
name: f
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -78,9 +92,11 @@ array(
|
||||
)
|
||||
)
|
||||
6: Stmt_ClassMethod(
|
||||
type: 0
|
||||
flags: 0
|
||||
byRef: false
|
||||
name: g
|
||||
name: Identifier(
|
||||
name: g
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -89,4 +105,4 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -8,7 +8,9 @@ interface A extends C, D {
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: A
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
@@ -23,9 +25,11 @@ array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
type: 1
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: a
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -33,4 +37,4 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -2,27 +2,172 @@ Invalid modifier combination
|
||||
-----
|
||||
<?php class A { public public $a; }
|
||||
-----
|
||||
Multiple access type modifiers are not allowed on line 1
|
||||
Multiple access type modifiers are not allowed from 1:24 to 1:29
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { public protected $a; }
|
||||
-----
|
||||
Multiple access type modifiers are not allowed on line 1
|
||||
Multiple access type modifiers are not allowed from 1:24 to 1:32
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_PUBLIC | MODIFIER_PROTECTED (3)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { abstract abstract a(); }
|
||||
<?php class A { abstract abstract function a(); }
|
||||
-----
|
||||
Multiple abstract modifiers are not allowed on line 1
|
||||
Multiple abstract modifiers are not allowed from 1:26 to 1:33
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static static $a; }
|
||||
-----
|
||||
Multiple static modifiers are not allowed on line 1
|
||||
Multiple static modifiers are not allowed from 1:24 to 1:29
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { final final a() {} }
|
||||
<?php class A { final final function a() {} }
|
||||
-----
|
||||
Multiple final modifiers are not allowed on line 1
|
||||
Multiple final modifiers are not allowed from 1:23 to 1:27
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_FINAL (32)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { abstract final a(); }
|
||||
<?php class A { abstract final function a(); }
|
||||
-----
|
||||
Cannot use the final modifier on an abstract class member on line 1
|
||||
Cannot use the final modifier on an abstract class member from 1:26 to 1:30
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_ABSTRACT | MODIFIER_FINAL (48)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php abstract final class A { }
|
||||
// Type in the partial parse could conceivably be any of 0, 16 or 32
|
||||
@@ -30,8 +175,10 @@ Cannot use the final modifier on an abstract class member on line 1
|
||||
Syntax error, unexpected T_FINAL, expecting T_CLASS from 1:16 to 1:20
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
type: 32
|
||||
name: A
|
||||
flags: MODIFIER_FINAL (32)
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
@@ -47,8 +194,56 @@ array(
|
||||
-----
|
||||
<?php class A { abstract $a; }
|
||||
-----
|
||||
Properties cannot be declared abstract on line 1
|
||||
Properties cannot be declared abstract from 1:17 to 1:24
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_ABSTRACT (16)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { final $a; }
|
||||
-----
|
||||
Properties cannot be declared final on line 1
|
||||
Properties cannot be declared final from 1:17 to 1:21
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
flags: MODIFIER_FINAL (32)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -2,11 +2,37 @@ Invalid class name
|
||||
-----
|
||||
<?php class self {}
|
||||
-----
|
||||
Cannot use 'self' as class name as it is reserved on line 1
|
||||
Cannot use 'self' as class name as it is reserved from 1:13 to 1:16
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: self
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class PARENT {}
|
||||
-----
|
||||
Cannot use 'PARENT' as class name as it is reserved on line 1
|
||||
Cannot use 'PARENT' as class name as it is reserved from 1:13 to 1:18
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: PARENT
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class static {}
|
||||
-----
|
||||
@@ -17,38 +43,161 @@ array(
|
||||
<?php class A extends self {}
|
||||
-----
|
||||
Cannot use 'self' as class name as it is reserved from 1:23 to 1:26
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: self
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A extends PARENT {}
|
||||
-----
|
||||
Cannot use 'PARENT' as class name as it is reserved from 1:23 to 1:28
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: PARENT
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A extends static {}
|
||||
-----
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR from 1:23 to 1:28
|
||||
Cannot use 'static' as class name as it is reserved from 1:23 to 1:28
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: static
|
||||
)
|
||||
)
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A implements self {}
|
||||
-----
|
||||
Cannot use 'self' as interface name as it is reserved from 1:26 to 1:29
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: self
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A implements PARENT {}
|
||||
-----
|
||||
Cannot use 'PARENT' as interface name as it is reserved from 1:26 to 1:31
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: PARENT
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A implements static {}
|
||||
-----
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR from 1:26 to 1:31
|
||||
Cannot use 'static' as interface name as it is reserved from 1:26 to 1:31
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: static
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php interface self {}
|
||||
-----
|
||||
Cannot use 'self' as class name as it is reserved on line 1
|
||||
Cannot use 'self' as class name as it is reserved from 1:17 to 1:20
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: self
|
||||
)
|
||||
extends: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php interface PARENT {}
|
||||
-----
|
||||
Cannot use 'PARENT' as class name as it is reserved on line 1
|
||||
Cannot use 'PARENT' as class name as it is reserved from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: PARENT
|
||||
)
|
||||
extends: array(
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php interface static {}
|
||||
-----
|
||||
@@ -59,13 +208,59 @@ array(
|
||||
<?php interface A extends self {}
|
||||
-----
|
||||
Cannot use 'self' as interface name as it is reserved from 1:27 to 1:30
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: self
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php interface A extends PARENT {}
|
||||
-----
|
||||
Cannot use 'PARENT' as interface name as it is reserved from 1:27 to 1:32
|
||||
array(
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: PARENT
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php interface A extends static {}
|
||||
-----
|
||||
Syntax error, unexpected T_STATIC, expecting T_STRING or T_NAMESPACE or T_NS_SEPARATOR from 1:27 to 1:32
|
||||
Cannot use 'static' as interface name as it is reserved from 1:27 to 1:32
|
||||
array(
|
||||
)
|
||||
0: Stmt_Interface(
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: static
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
@@ -10,25 +10,31 @@ class A {
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
type: 0
|
||||
name: A
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Property(
|
||||
type: 0
|
||||
flags: 0
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: foo
|
||||
name: VarLikeIdentifier(
|
||||
name: foo
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_ClassMethod(
|
||||
type: 0
|
||||
flags: 0
|
||||
byRef: false
|
||||
name: bar
|
||||
name: Identifier(
|
||||
name: bar
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -36,9 +42,11 @@ array(
|
||||
)
|
||||
)
|
||||
2: Stmt_ClassMethod(
|
||||
type: 24
|
||||
flags: MODIFIER_ABSTRACT | MODIFIER_STATIC (24)
|
||||
byRef: false
|
||||
name: baz
|
||||
name: Identifier(
|
||||
name: baz
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -47,4 +55,4 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -18,8 +18,10 @@ class A extends B implements C, D {
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
type: 0
|
||||
name: A
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
@@ -39,15 +41,20 @@ array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassConst(
|
||||
flags: 0
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: A
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
1: Const(
|
||||
name: C
|
||||
name: Identifier(
|
||||
name: C
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: D
|
||||
)
|
||||
@@ -55,16 +62,20 @@ array(
|
||||
)
|
||||
)
|
||||
1: Stmt_Property(
|
||||
type: 1
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: a
|
||||
name: VarLikeIdentifier(
|
||||
name: a
|
||||
)
|
||||
default: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
1: Stmt_PropertyProperty(
|
||||
name: c
|
||||
name: VarLikeIdentifier(
|
||||
name: c
|
||||
)
|
||||
default: Scalar_String(
|
||||
value: d
|
||||
)
|
||||
@@ -72,27 +83,33 @@ array(
|
||||
)
|
||||
)
|
||||
2: Stmt_Property(
|
||||
type: 2
|
||||
flags: MODIFIER_PROTECTED (2)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: e
|
||||
name: VarLikeIdentifier(
|
||||
name: e
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Property(
|
||||
type: 4
|
||||
flags: MODIFIER_PRIVATE (4)
|
||||
props: array(
|
||||
0: Stmt_PropertyProperty(
|
||||
name: f
|
||||
name: VarLikeIdentifier(
|
||||
name: f
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
)
|
||||
4: Stmt_ClassMethod(
|
||||
type: 1
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: a
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -100,15 +117,19 @@ array(
|
||||
)
|
||||
)
|
||||
5: Stmt_ClassMethod(
|
||||
type: 9
|
||||
flags: MODIFIER_PUBLIC | MODIFIER_STATIC (9)
|
||||
byRef: false
|
||||
name: b
|
||||
name: Identifier(
|
||||
name: b
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: a
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
@@ -117,9 +138,11 @@ array(
|
||||
)
|
||||
)
|
||||
6: Stmt_ClassMethod(
|
||||
type: 33
|
||||
flags: MODIFIER_PUBLIC | MODIFIER_FINAL (33)
|
||||
byRef: false
|
||||
name: c
|
||||
name: Identifier(
|
||||
name: c
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: Name(
|
||||
@@ -131,9 +154,11 @@ array(
|
||||
)
|
||||
)
|
||||
7: Stmt_ClassMethod(
|
||||
type: 2
|
||||
flags: MODIFIER_PROTECTED (2)
|
||||
byRef: false
|
||||
name: d
|
||||
name: Identifier(
|
||||
name: d
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -141,9 +166,11 @@ array(
|
||||
)
|
||||
)
|
||||
8: Stmt_ClassMethod(
|
||||
type: 4
|
||||
flags: MODIFIER_PRIVATE (4)
|
||||
byRef: false
|
||||
name: e
|
||||
name: Identifier(
|
||||
name: e
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -152,4 +179,4 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -2,24 +2,174 @@ Some special methods cannot be static
|
||||
-----
|
||||
<?php class A { static function __construct() {} }
|
||||
-----
|
||||
Constructor __construct() cannot be static on line 1
|
||||
Constructor __construct() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __construct
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static function __destruct() {} }
|
||||
-----
|
||||
Destructor __destruct() cannot be static on line 1
|
||||
Destructor __destruct() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __destruct
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static function __clone() {} }
|
||||
-----
|
||||
Clone method __clone() cannot be static on line 1
|
||||
Clone method __clone() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __clone
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static function __CONSTRUCT() {} }
|
||||
-----
|
||||
Constructor __CONSTRUCT() cannot be static on line 1
|
||||
Constructor __CONSTRUCT() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __CONSTRUCT
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static function __Destruct() {} }
|
||||
-----
|
||||
Destructor __Destruct() cannot be static on line 1
|
||||
Destructor __Destruct() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __Destruct
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
-----
|
||||
<?php class A { static function __cLoNe() {} }
|
||||
-----
|
||||
Clone method __cLoNe() cannot be static on line 1
|
||||
Clone method __cLoNe() cannot be static from 1:17 to 1:22
|
||||
array(
|
||||
0: Stmt_Class(
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
flags: MODIFIER_STATIC (8)
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: __cLoNe
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -23,12 +23,16 @@ class B {
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Trait(
|
||||
name: A
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_ClassMethod(
|
||||
type: 1
|
||||
flags: MODIFIER_PUBLIC (1)
|
||||
byRef: false
|
||||
name: a
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -38,8 +42,10 @@ array(
|
||||
)
|
||||
)
|
||||
1: Stmt_Class(
|
||||
type: 0
|
||||
name: B
|
||||
flags: 0
|
||||
name: Identifier(
|
||||
name: B
|
||||
)
|
||||
extends: null
|
||||
implements: array(
|
||||
)
|
||||
@@ -66,20 +72,30 @@ array(
|
||||
adaptations: array(
|
||||
0: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: null
|
||||
method: a
|
||||
newModifier: 2
|
||||
newName: b
|
||||
method: Identifier(
|
||||
name: a
|
||||
)
|
||||
newModifier: MODIFIER_PROTECTED (2)
|
||||
newName: Identifier(
|
||||
name: b
|
||||
)
|
||||
)
|
||||
1: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: null
|
||||
method: c
|
||||
method: Identifier(
|
||||
name: c
|
||||
)
|
||||
newModifier: null
|
||||
newName: d
|
||||
newName: Identifier(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
2: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: null
|
||||
method: e
|
||||
newModifier: 4
|
||||
method: Identifier(
|
||||
name: e
|
||||
)
|
||||
newModifier: MODIFIER_PRIVATE (4)
|
||||
newName: null
|
||||
)
|
||||
)
|
||||
@@ -109,7 +125,9 @@ array(
|
||||
0: E
|
||||
)
|
||||
)
|
||||
method: a
|
||||
method: Identifier(
|
||||
name: a
|
||||
)
|
||||
insteadof: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
@@ -129,9 +147,13 @@ array(
|
||||
0: E
|
||||
)
|
||||
)
|
||||
method: b
|
||||
newModifier: 2
|
||||
newName: c
|
||||
method: Identifier(
|
||||
name: b
|
||||
)
|
||||
newModifier: MODIFIER_PROTECTED (2)
|
||||
newName: Identifier(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
2: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: Name(
|
||||
@@ -139,9 +161,13 @@ array(
|
||||
0: E
|
||||
)
|
||||
)
|
||||
method: d
|
||||
method: Identifier(
|
||||
name: d
|
||||
)
|
||||
newModifier: null
|
||||
newName: e
|
||||
newName: Identifier(
|
||||
name: e
|
||||
)
|
||||
)
|
||||
3: Stmt_TraitUseAdaptation_Alias(
|
||||
trait: Name(
|
||||
@@ -149,12 +175,14 @@ array(
|
||||
0: E
|
||||
)
|
||||
)
|
||||
method: f
|
||||
newModifier: 4
|
||||
method: Identifier(
|
||||
name: f
|
||||
)
|
||||
newModifier: MODIFIER_PRIVATE (4)
|
||||
newName: null
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -8,25 +8,33 @@ array(
|
||||
0: Stmt_Const(
|
||||
consts: array(
|
||||
0: Const(
|
||||
name: A
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
value: Scalar_LNumber(
|
||||
value: 0
|
||||
)
|
||||
)
|
||||
1: Const(
|
||||
name: B
|
||||
name: Identifier(
|
||||
name: B
|
||||
)
|
||||
value: Scalar_DNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
2: Const(
|
||||
name: C
|
||||
name: Identifier(
|
||||
name: C
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: A
|
||||
)
|
||||
)
|
||||
3: Const(
|
||||
name: D
|
||||
name: Identifier(
|
||||
name: D
|
||||
)
|
||||
value: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
|
@@ -47,9 +47,13 @@ array(
|
||||
)
|
||||
)
|
||||
7: Stmt_Label(
|
||||
name: label
|
||||
name: Identifier(
|
||||
name: label
|
||||
)
|
||||
)
|
||||
8: Stmt_Goto(
|
||||
name: label
|
||||
name: Identifier(
|
||||
name: label
|
||||
)
|
||||
)
|
||||
)
|
@@ -13,7 +13,9 @@ array(
|
||||
0: Stmt_Declare(
|
||||
declares: array(
|
||||
0: Stmt_DeclareDeclare(
|
||||
key: X
|
||||
key: Identifier(
|
||||
name: X
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: Y
|
||||
)
|
||||
@@ -24,13 +26,17 @@ array(
|
||||
1: Stmt_Declare(
|
||||
declares: array(
|
||||
0: Stmt_DeclareDeclare(
|
||||
key: A
|
||||
key: Identifier(
|
||||
name: A
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
1: Stmt_DeclareDeclare(
|
||||
key: C
|
||||
key: Identifier(
|
||||
name: C
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: D
|
||||
)
|
||||
@@ -42,13 +48,17 @@ array(
|
||||
2: Stmt_Declare(
|
||||
declares: array(
|
||||
0: Stmt_DeclareDeclare(
|
||||
key: A
|
||||
key: Identifier(
|
||||
name: A
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: B
|
||||
)
|
||||
)
|
||||
1: Stmt_DeclareDeclare(
|
||||
key: C
|
||||
key: Identifier(
|
||||
name: C
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: D
|
||||
)
|
||||
|
87
vendor/nikic/php-parser/test/code/parser/stmt/function/builtinTypeDeclarations.test
vendored
Normal file
87
vendor/nikic/php-parser/test/code/parser/stmt/function/builtinTypeDeclarations.test
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
Scalar type declarations
|
||||
-----
|
||||
<?php
|
||||
function test(bool $a, Int $b, FLOAT $c, StRiNg $d, iterable $e, object $f) : void {}
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: Identifier(
|
||||
name: bool
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
1: Param(
|
||||
type: Identifier(
|
||||
name: int
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
2: Param(
|
||||
type: Identifier(
|
||||
name: float
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
default: null
|
||||
)
|
||||
3: Param(
|
||||
type: Identifier(
|
||||
name: string
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
default: null
|
||||
)
|
||||
4: Param(
|
||||
type: Identifier(
|
||||
name: iterable
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: e
|
||||
)
|
||||
default: null
|
||||
)
|
||||
5: Param(
|
||||
type: Identifier(
|
||||
name: object
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: f
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
returnType: Identifier(
|
||||
name: void
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
@@ -8,13 +8,17 @@ function &a($b) {}
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: a
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: true
|
||||
variadic: false
|
||||
name: b
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
@@ -24,13 +28,17 @@ array(
|
||||
)
|
||||
1: Stmt_Function(
|
||||
byRef: true
|
||||
name: a
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: b
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
@@ -38,4 +46,4 @@ array(
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -18,7 +18,9 @@ array(
|
||||
stmts: array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: A
|
||||
name: Identifier(
|
||||
name: A
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -30,4 +32,4 @@ array(
|
||||
)
|
||||
else: null
|
||||
)
|
||||
)
|
||||
)
|
@@ -17,13 +17,17 @@ function a(
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: a
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: b
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
default: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
@@ -36,7 +40,9 @@ array(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: c
|
||||
var: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
default: Scalar_String(
|
||||
value: foo
|
||||
)
|
||||
@@ -45,21 +51,27 @@ array(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: d
|
||||
var: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
default: Expr_ClassConstFetch(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
name: B
|
||||
name: Identifier(
|
||||
name: B
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: f
|
||||
var: Expr_Variable(
|
||||
name: f
|
||||
)
|
||||
default: Expr_UnaryPlus(
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
@@ -70,7 +82,9 @@ array(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: g
|
||||
var: Expr_Variable(
|
||||
name: g
|
||||
)
|
||||
default: Expr_UnaryMinus(
|
||||
expr: Scalar_DNumber(
|
||||
value: 1
|
||||
@@ -81,7 +95,9 @@ array(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: h
|
||||
var: Expr_Variable(
|
||||
name: h
|
||||
)
|
||||
default: Expr_Array(
|
||||
items: array(
|
||||
)
|
||||
@@ -91,7 +107,9 @@ array(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: i
|
||||
var: Expr_Variable(
|
||||
name: i
|
||||
)
|
||||
default: Expr_Array(
|
||||
items: array(
|
||||
)
|
||||
@@ -101,7 +119,9 @@ array(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: j
|
||||
var: Expr_Variable(
|
||||
name: j
|
||||
)
|
||||
default: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
@@ -118,7 +138,9 @@ array(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: k
|
||||
var: Expr_Variable(
|
||||
name: k
|
||||
)
|
||||
default: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
@@ -145,4 +167,4 @@ array(
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
55
vendor/nikic/php-parser/test/code/parser/stmt/function/nullableTypes.test
vendored
Normal file
55
vendor/nikic/php-parser/test/code/parser/stmt/function/nullableTypes.test
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
Nullable types
|
||||
-----
|
||||
<?php
|
||||
|
||||
function test(?Foo $bar, ?string $foo) : ?Baz {
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: NullableType(
|
||||
type: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: bar
|
||||
)
|
||||
default: null
|
||||
)
|
||||
1: Param(
|
||||
type: NullableType(
|
||||
type: Identifier(
|
||||
name: string
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
var: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
returnType: NullableType(
|
||||
type: Name(
|
||||
parts: array(
|
||||
0: Baz
|
||||
)
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
@@ -10,7 +10,9 @@ function test4() : Foo\Bar {}
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: test1
|
||||
name: Identifier(
|
||||
name: test1
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -19,25 +21,35 @@ array(
|
||||
)
|
||||
1: Stmt_Function(
|
||||
byRef: false
|
||||
name: test2
|
||||
name: Identifier(
|
||||
name: test2
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: array
|
||||
returnType: Identifier(
|
||||
name: array
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
2: Stmt_Function(
|
||||
byRef: false
|
||||
name: test3
|
||||
name: Identifier(
|
||||
name: test3
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: callable
|
||||
returnType: Identifier(
|
||||
name: callable
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
3: Stmt_Function(
|
||||
byRef: false
|
||||
name: test4
|
||||
name: Identifier(
|
||||
name: test4
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: Name(
|
||||
@@ -49,4 +61,4 @@ array(
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -1,45 +0,0 @@
|
||||
Scalar type declarations
|
||||
-----
|
||||
<?php
|
||||
function test(bool $a, Int $b, FLOAT $c, StRiNg $d) {}
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: test
|
||||
params: array(
|
||||
0: Param(
|
||||
type: bool
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: a
|
||||
default: null
|
||||
)
|
||||
1: Param(
|
||||
type: int
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: b
|
||||
default: null
|
||||
)
|
||||
2: Param(
|
||||
type: float
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: c
|
||||
default: null
|
||||
)
|
||||
3: Param(
|
||||
type: string
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: d
|
||||
default: null
|
||||
)
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
@@ -10,7 +10,9 @@ function a() {
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: a
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
@@ -35,11 +37,15 @@ array(
|
||||
1: Stmt_Static(
|
||||
vars: array(
|
||||
0: Stmt_StaticVar(
|
||||
name: c
|
||||
var: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
default: null
|
||||
)
|
||||
1: Stmt_StaticVar(
|
||||
name: d
|
||||
var: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
default: Scalar_String(
|
||||
value: e
|
||||
)
|
||||
@@ -48,4 +54,4 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -7,27 +7,39 @@ function a($b, array $c, callable $d, E $f) {}
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: a
|
||||
name: Identifier(
|
||||
name: a
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: b
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
1: Param(
|
||||
type: array
|
||||
type: Identifier(
|
||||
name: array
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: c
|
||||
var: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
default: null
|
||||
)
|
||||
2: Param(
|
||||
type: callable
|
||||
type: Identifier(
|
||||
name: callable
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: d
|
||||
var: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
default: null
|
||||
)
|
||||
3: Param(
|
||||
@@ -38,7 +50,9 @@ array(
|
||||
)
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: f
|
||||
var: Expr_Variable(
|
||||
name: f
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
@@ -46,4 +60,4 @@ array(
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -9,20 +9,26 @@ function test($a, Type &... $b) {}
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: test
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: a
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
1: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: true
|
||||
name: b
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
@@ -32,20 +38,26 @@ array(
|
||||
)
|
||||
1: Stmt_Function(
|
||||
byRef: false
|
||||
name: test
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: a
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
1: Param(
|
||||
type: null
|
||||
byRef: true
|
||||
variadic: true
|
||||
name: b
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
@@ -55,13 +67,17 @@ array(
|
||||
)
|
||||
2: Stmt_Function(
|
||||
byRef: false
|
||||
name: test
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: a
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
1: Param(
|
||||
@@ -72,7 +88,9 @@ array(
|
||||
)
|
||||
byRef: false
|
||||
variadic: true
|
||||
name: b
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
@@ -82,13 +100,17 @@ array(
|
||||
)
|
||||
3: Stmt_Function(
|
||||
byRef: false
|
||||
name: test
|
||||
name: Identifier(
|
||||
name: test
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: false
|
||||
name: a
|
||||
var: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
default: null
|
||||
)
|
||||
1: Param(
|
||||
@@ -99,7 +121,9 @@ array(
|
||||
)
|
||||
byRef: true
|
||||
variadic: true
|
||||
name: b
|
||||
var: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
default: null
|
||||
)
|
||||
)
|
||||
@@ -107,4 +131,4 @@ array(
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -4,3 +4,28 @@ Invalid variadic function
|
||||
function foo(...$foo = []) {}
|
||||
-----
|
||||
Variadic parameter cannot have a default value from 2:24 to 2:25
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: Identifier(
|
||||
name: foo
|
||||
)
|
||||
params: array(
|
||||
0: Param(
|
||||
type: null
|
||||
byRef: false
|
||||
variadic: true
|
||||
var: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
default: Expr_Array(
|
||||
items: array(
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
@@ -34,51 +34,26 @@ function gen() {
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: gen
|
||||
name: Identifier(
|
||||
name: gen
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Expr_Yield(
|
||||
key: null
|
||||
value: null
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: null
|
||||
comments: array(
|
||||
0: // statements
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // statements
|
||||
)
|
||||
)
|
||||
1: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: value
|
||||
)
|
||||
)
|
||||
2: Expr_Yield(
|
||||
key: Expr_Variable(
|
||||
name: key
|
||||
)
|
||||
value: Expr_Variable(
|
||||
name: value
|
||||
)
|
||||
)
|
||||
3: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: data
|
||||
comments: array(
|
||||
0: // expressions
|
||||
)
|
||||
)
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: null
|
||||
)
|
||||
comments: array(
|
||||
0: // expressions
|
||||
)
|
||||
)
|
||||
4: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: data
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
@@ -86,10 +61,7 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: data
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Yield(
|
||||
key: Expr_Variable(
|
||||
name: key
|
||||
@@ -99,6 +71,54 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: data
|
||||
comments: array(
|
||||
0: // expressions
|
||||
)
|
||||
)
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: null
|
||||
)
|
||||
comments: array(
|
||||
0: // expressions
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // expressions
|
||||
)
|
||||
)
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: data
|
||||
)
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: value
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_Assign(
|
||||
var: Expr_Variable(
|
||||
name: data
|
||||
)
|
||||
expr: Expr_Yield(
|
||||
key: Expr_Variable(
|
||||
name: key
|
||||
)
|
||||
value: Expr_Variable(
|
||||
name: value
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_If(
|
||||
cond: Expr_Yield(
|
||||
key: null
|
||||
@@ -159,14 +179,14 @@ array(
|
||||
)
|
||||
)
|
||||
9: Stmt_Do(
|
||||
stmts: array(
|
||||
)
|
||||
cond: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
10: Stmt_Switch(
|
||||
cond: Expr_Yield(
|
||||
@@ -178,100 +198,119 @@ array(
|
||||
cases: array(
|
||||
)
|
||||
)
|
||||
11: Expr_Exit(
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: foo
|
||||
11: Stmt_Expression(
|
||||
expr: Expr_Exit(
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
12: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: func
|
||||
12: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: func
|
||||
)
|
||||
comments: array(
|
||||
0: // yield in function calls
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // yield in function calls
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
0: // yield in function calls
|
||||
)
|
||||
)
|
||||
13: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
name: func
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: foo
|
||||
13: Stmt_Expression(
|
||||
expr: Expr_MethodCall(
|
||||
var: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
name: Identifier(
|
||||
name: func
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
14: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
14: Stmt_Expression(
|
||||
expr: Expr_New(
|
||||
class: Name(
|
||||
parts: array(
|
||||
0: Foo
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: foo
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
15: Expr_YieldFrom(
|
||||
expr: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
16: Expr_BinaryOp_LogicalAnd(
|
||||
left: Expr_YieldFrom(
|
||||
15: Stmt_Expression(
|
||||
expr: Expr_YieldFrom(
|
||||
expr: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
right: Expr_YieldFrom(
|
||||
expr: Expr_Variable(
|
||||
name: bar
|
||||
)
|
||||
16: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_LogicalAnd(
|
||||
left: Expr_YieldFrom(
|
||||
expr: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
)
|
||||
right: Expr_YieldFrom(
|
||||
expr: Expr_Variable(
|
||||
name: bar
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
17: Expr_YieldFrom(
|
||||
expr: Expr_BinaryOp_Plus(
|
||||
left: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: bar
|
||||
17: Stmt_Expression(
|
||||
expr: Expr_YieldFrom(
|
||||
expr: Expr_BinaryOp_Plus(
|
||||
left: Expr_Variable(
|
||||
name: foo
|
||||
)
|
||||
right: Expr_Variable(
|
||||
name: bar
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@@ -18,154 +18,85 @@ function gen() {
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: gen
|
||||
name: Identifier(
|
||||
name: gen
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_BinaryOp_LogicalOr(
|
||||
left: Expr_Yield(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
)
|
||||
right: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
)
|
||||
2: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Expr_BinaryOp_LogicalOr(
|
||||
left: Expr_Yield(
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_LogicalOr(
|
||||
left: Expr_Yield(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
)
|
||||
right: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k
|
||||
)
|
||||
value: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
)
|
||||
right: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
)
|
||||
4: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: var_dump
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k1
|
||||
)
|
||||
value: Expr_Yield(
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_LogicalOr(
|
||||
left: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k2
|
||||
value: k
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Expr_Yield(
|
||||
key: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k1
|
||||
)
|
||||
value: Expr_Yield(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: k2
|
||||
value: a
|
||||
)
|
||||
)
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
right: Expr_Exit(
|
||||
expr: null
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: var_dump
|
||||
4: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: var_dump
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k1
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k2
|
||||
value: k
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
@@ -176,55 +107,144 @@ array(
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: var_dump
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k1
|
||||
)
|
||||
value: Expr_Yield(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: k2
|
||||
)
|
||||
)
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
5: Stmt_Expression(
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k1
|
||||
)
|
||||
value: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k2
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
6: Stmt_Expression(
|
||||
expr: Expr_Yield(
|
||||
key: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k1
|
||||
)
|
||||
value: Expr_Yield(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: k2
|
||||
)
|
||||
)
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: var_dump
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k1
|
||||
)
|
||||
value: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k2
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: var_dump
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_Array(
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: Expr_Yield(
|
||||
key: Scalar_String(
|
||||
value: k1
|
||||
)
|
||||
value: Expr_Yield(
|
||||
key: null
|
||||
value: Scalar_String(
|
||||
value: k2
|
||||
)
|
||||
)
|
||||
)
|
||||
value: Expr_BinaryOp_Concat(
|
||||
left: Scalar_String(
|
||||
value: a
|
||||
)
|
||||
right: Scalar_String(
|
||||
value: b
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -11,38 +11,46 @@ function gen() {
|
||||
array(
|
||||
0: Stmt_Function(
|
||||
byRef: false
|
||||
name: gen
|
||||
name: Identifier(
|
||||
name: gen
|
||||
)
|
||||
params: array(
|
||||
)
|
||||
returnType: null
|
||||
stmts: array(
|
||||
0: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_UnaryPlus(
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_UnaryMinus(
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Expr_BinaryOp_Mul(
|
||||
left: Expr_Yield(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: null
|
||||
value: Expr_UnaryPlus(
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
right: Expr_UnaryMinus(
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
1: Stmt_Expression(
|
||||
expr: Expr_Yield(
|
||||
key: null
|
||||
value: Expr_UnaryMinus(
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_BinaryOp_Mul(
|
||||
left: Expr_Yield(
|
||||
key: null
|
||||
value: null
|
||||
)
|
||||
right: Expr_UnaryMinus(
|
||||
expr: Scalar_LNumber(
|
||||
value: 1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
@@ -8,8 +8,10 @@ __halt_compiler()
|
||||
Hallo World!
|
||||
-----
|
||||
array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
1: Stmt_HaltCompiler(
|
||||
remaining: Hallo World!
|
||||
@@ -22,8 +24,10 @@ $a;
|
||||
__halt_compiler();Hallo World!
|
||||
-----
|
||||
array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
1: Stmt_HaltCompiler(
|
||||
remaining: Hallo World!
|
||||
@@ -44,8 +48,10 @@ array(
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@@ -3,4 +3,4 @@ Invalid __halt_compiler() syntax
|
||||
<?php
|
||||
__halt_compiler()
|
||||
-----
|
||||
__HALT_COMPILER must be followed by "();" on line 2
|
||||
__HALT_COMPILER must be followed by "();" on line 2
|
@@ -7,23 +7,25 @@ __halt_compiler();
|
||||
Foo
|
||||
-----
|
||||
array(
|
||||
0: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: var_dump
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_FuncCall(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: var_dump
|
||||
)
|
||||
)
|
||||
)
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: __HALT_COMPILER_OFFSET__
|
||||
args: array(
|
||||
0: Arg(
|
||||
value: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: __HALT_COMPILER_OFFSET__
|
||||
)
|
||||
)
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
byRef: false
|
||||
unpack: false
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -31,4 +33,4 @@ array(
|
||||
remaining:
|
||||
Foo
|
||||
)
|
||||
)
|
||||
)
|
@@ -5,4 +5,4 @@ if (true) {
|
||||
__halt_compiler();
|
||||
}
|
||||
-----
|
||||
__HALT_COMPILER() can only be used from the outermost scope from 3:5 to 3:19
|
||||
__HALT_COMPILER() can only be used from the outermost scope from 3:5 to 3:19
|
@@ -23,4 +23,4 @@ array(
|
||||
2: Stmt_InlineHTML(
|
||||
value: #!/usr/bin/env php
|
||||
)
|
||||
)
|
||||
)
|
@@ -11,17 +11,23 @@ $c;
|
||||
$d;
|
||||
-----
|
||||
array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
)
|
||||
1: Stmt_InlineHTML(
|
||||
value: B
|
||||
|
||||
)
|
||||
2: Expr_Variable(
|
||||
name: c
|
||||
2: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
)
|
||||
3: Expr_Variable(
|
||||
name: d
|
||||
3: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: d
|
||||
)
|
||||
)
|
||||
)
|
@@ -8,10 +8,10 @@ do {
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Do(
|
||||
stmts: array(
|
||||
)
|
||||
cond: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
stmts: array(
|
||||
)
|
||||
)
|
||||
)
|
@@ -80,12 +80,20 @@ array(
|
||||
keyVar: null
|
||||
byRef: false
|
||||
valueVar: Expr_List(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: a
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: a
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: Expr_Variable(
|
||||
name: b
|
||||
1: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -101,13 +109,21 @@ array(
|
||||
)
|
||||
byRef: false
|
||||
valueVar: Expr_List(
|
||||
vars: array(
|
||||
0: Expr_Variable(
|
||||
name: b
|
||||
items: array(
|
||||
0: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: b
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
1: null
|
||||
2: Expr_Variable(
|
||||
name: c
|
||||
2: Expr_ArrayItem(
|
||||
key: null
|
||||
value: Expr_Variable(
|
||||
name: c
|
||||
)
|
||||
byRef: false
|
||||
)
|
||||
)
|
||||
)
|
||||
|
75
vendor/nikic/php-parser/test/code/parser/stmt/multiCatch.test
vendored
Normal file
75
vendor/nikic/php-parser/test/code/parser/stmt/multiCatch.test
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
Try/catch with multiple classes
|
||||
-----
|
||||
<?php
|
||||
try {
|
||||
$x;
|
||||
} catch (X|Y $e1) {
|
||||
$y;
|
||||
} catch (\A|B\C $e2) {
|
||||
$z;
|
||||
}
|
||||
-----
|
||||
!!php7
|
||||
array(
|
||||
0: Stmt_TryCatch(
|
||||
stmts: array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: x
|
||||
)
|
||||
)
|
||||
)
|
||||
catches: array(
|
||||
0: Stmt_Catch(
|
||||
types: array(
|
||||
0: Name(
|
||||
parts: array(
|
||||
0: X
|
||||
)
|
||||
)
|
||||
1: Name(
|
||||
parts: array(
|
||||
0: Y
|
||||
)
|
||||
)
|
||||
)
|
||||
var: Expr_Variable(
|
||||
name: e1
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: y
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Catch(
|
||||
types: array(
|
||||
0: Name_FullyQualified(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
1: Name(
|
||||
parts: array(
|
||||
0: B
|
||||
1: C
|
||||
)
|
||||
)
|
||||
)
|
||||
var: Expr_Variable(
|
||||
name: e2
|
||||
)
|
||||
stmts: array(
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_Variable(
|
||||
name: z
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
finally: null
|
||||
)
|
||||
)
|
@@ -18,70 +18,74 @@ use const foo\BAR as BAZ;
|
||||
-----
|
||||
array(
|
||||
0: Stmt_Use(
|
||||
type: 1
|
||||
type: TYPE_NORMAL (1)
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
type: 0
|
||||
type: TYPE_UNKNOWN (0)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
1: B
|
||||
)
|
||||
)
|
||||
alias: B
|
||||
alias: null
|
||||
)
|
||||
)
|
||||
)
|
||||
1: Stmt_Use(
|
||||
type: 1
|
||||
type: TYPE_NORMAL (1)
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
type: 0
|
||||
type: TYPE_UNKNOWN (0)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: C
|
||||
1: D
|
||||
)
|
||||
)
|
||||
alias: E
|
||||
alias: Identifier(
|
||||
name: E
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
2: Stmt_Use(
|
||||
type: 1
|
||||
type: TYPE_NORMAL (1)
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
type: 0
|
||||
type: TYPE_UNKNOWN (0)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: F
|
||||
1: G
|
||||
)
|
||||
)
|
||||
alias: H
|
||||
alias: Identifier(
|
||||
name: H
|
||||
)
|
||||
)
|
||||
1: Stmt_UseUse(
|
||||
type: 0
|
||||
type: TYPE_UNKNOWN (0)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: J
|
||||
)
|
||||
)
|
||||
alias: J
|
||||
alias: null
|
||||
)
|
||||
)
|
||||
)
|
||||
3: Stmt_Use(
|
||||
type: 1
|
||||
type: TYPE_NORMAL (1)
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
type: 0
|
||||
type: TYPE_UNKNOWN (0)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
alias: A
|
||||
alias: null
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
@@ -89,31 +93,33 @@ array(
|
||||
)
|
||||
)
|
||||
4: Stmt_Use(
|
||||
type: 1
|
||||
type: TYPE_NORMAL (1)
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
type: 0
|
||||
type: TYPE_UNKNOWN (0)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: A
|
||||
)
|
||||
)
|
||||
alias: B
|
||||
alias: Identifier(
|
||||
name: B
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
5: Stmt_Use(
|
||||
type: 2
|
||||
type: TYPE_FUNCTION (2)
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
type: 0
|
||||
type: TYPE_UNKNOWN (0)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
1: bar
|
||||
)
|
||||
)
|
||||
alias: bar
|
||||
alias: null
|
||||
)
|
||||
)
|
||||
comments: array(
|
||||
@@ -121,47 +127,51 @@ array(
|
||||
)
|
||||
)
|
||||
6: Stmt_Use(
|
||||
type: 2
|
||||
type: TYPE_FUNCTION (2)
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
type: 0
|
||||
type: TYPE_UNKNOWN (0)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
1: bar
|
||||
)
|
||||
)
|
||||
alias: baz
|
||||
alias: Identifier(
|
||||
name: baz
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
7: Stmt_Use(
|
||||
type: 3
|
||||
type: TYPE_CONSTANT (3)
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
type: 0
|
||||
type: TYPE_UNKNOWN (0)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
1: BAR
|
||||
)
|
||||
)
|
||||
alias: BAR
|
||||
alias: null
|
||||
)
|
||||
)
|
||||
)
|
||||
8: Stmt_Use(
|
||||
type: 3
|
||||
type: TYPE_CONSTANT (3)
|
||||
uses: array(
|
||||
0: Stmt_UseUse(
|
||||
type: 0
|
||||
type: TYPE_UNKNOWN (0)
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
1: BAR
|
||||
)
|
||||
)
|
||||
alias: BAZ
|
||||
alias: Identifier(
|
||||
name: BAZ
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@@ -18,10 +18,12 @@ array(
|
||||
)
|
||||
)
|
||||
stmts: array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: foo
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -30,10 +32,12 @@ array(
|
||||
1: Stmt_Namespace(
|
||||
name: null
|
||||
stmts: array(
|
||||
0: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: bar
|
||||
0: Stmt_Expression(
|
||||
expr: Expr_ConstFetch(
|
||||
name: Name(
|
||||
parts: array(
|
||||
0: bar
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user