php-parser/php5/php5_test.go

3681 lines
90 KiB
Go
Raw Normal View History

2018-02-10 22:11:56 +00:00
package php5_test
import (
"bytes"
"reflect"
"testing"
"github.com/kylelemons/godebug/pretty"
"github.com/z7zmey/php-parser/node/expr"
2018-02-19 11:12:09 +00:00
"github.com/z7zmey/php-parser/node/expr/assign"
"github.com/z7zmey/php-parser/node/expr/binary"
2018-02-10 22:11:56 +00:00
"github.com/z7zmey/php-parser/node/expr/cast"
"github.com/z7zmey/php-parser/node/name"
"github.com/z7zmey/php-parser/node/scalar"
"github.com/z7zmey/php-parser/php5"
"github.com/z7zmey/php-parser/node"
"github.com/z7zmey/php-parser/node/stmt"
)
func assertEqual(t *testing.T, expected interface{}, actual interface{}) {
if !reflect.DeepEqual(expected, actual) {
diff := pretty.Compare(expected, actual)
if diff != "" {
t.Errorf("diff: (-expected +actual)\n%s", diff)
} else {
t.Errorf("expected and actual are not equal\n")
}
}
}
2018-02-12 10:09:56 +00:00
func TestPhp5(t *testing.T) {
2018-02-10 22:11:56 +00:00
src := `<?
foo($a, ...$b);
$foo($a, ...$b);
$foo->bar($a, ...$b);
foo::bar($a, ...$b);
$foo::bar($a, ...$b);
new foo($a, ...$b);
function foo(bar $bar=null, baz &...$baz) {}
class foo {public function foo(bar $bar=null, baz &...$baz) {}}
function(bar $bar=null, baz &...$baz) {};
static function(bar $bar=null, baz &...$baz) {};
"test";
"\$test";
"
test
";
'$test';
'
$test
';
<<<CAD
2018-02-14 10:30:41 +00:00
CAD;
<<<CAD
2018-02-10 22:11:56 +00:00
hello
CAD;
<<<"CAD"
hello
2018-02-14 15:28:20 +00:00
CAD;
<<<"CAD"
hello $world
2018-02-10 22:11:56 +00:00
CAD;
<<<'CAD'
hello $world
CAD;
1234567890123456789;
12345678901234567890;
0.;
0b0111111111111111111111111111111111111111111111111111111111111111;
0b1111111111111111111111111111111111111111111111111111111111111111;
0x007111111111111111;
0x8111111111111111;
__CLASS__;
__DIR__;
__FILE__;
__FUNCTION__;
__LINE__;
__NAMESPACE__;
__METHOD__;
__TRAIT__;
"test $var";
2018-02-14 19:02:57 +00:00
"test $var[1]";
"test $var[1234567890123456789012345678901234567890]";
"test $var[bar]";
"test $var[$bar]";
"$foo $bar";
2018-02-10 22:11:56 +00:00
"test $foo->bar()";
"test ${foo}";
"test ${foo[0]}";
"test {$foo->bar()}";
if ($a) :
endif;
if ($a) :
elseif ($b):
endif;
if ($a) :
else:
endif;
if ($a) :
elseif ($b):
elseif ($c):
else:
endif;
while (1) { break; }
while (1) { break 2; }
2018-02-12 21:10:53 +00:00
while (1) : break(3); endwhile;
2018-02-10 22:11:56 +00:00
class foo{ const FOO = 1, BAR = 2; }
class foo{ function bar() {} }
class foo{ public static function &bar() {} }
2018-02-13 10:16:53 +00:00
class foo{ final private function bar() {} protected function baz() {} }
abstract class foo{ abstract public function bar(); }
2018-02-10 22:11:56 +00:00
final class foo extends bar { }
final class foo implements bar { }
final class foo implements bar, baz { }
const FOO = 1, BAR = 2;
while (1) { continue; }
while (1) { continue 2; }
while (1) { continue(3); }
declare(ticks=1);
2018-02-12 21:10:53 +00:00
declare(ticks=1, strict_types=1) {}
2018-02-10 22:11:56 +00:00
declare(ticks=1): enddeclare;
do {} while(1);
echo $a, 1;
echo($a);
for($i = 0; $i < 10; $i++, $i++) {}
2018-02-13 10:33:21 +00:00
for(; $i < 10; $i++) : endfor;
2018-02-10 22:11:56 +00:00
foreach ($a as $v) {}
2018-02-12 13:08:08 +00:00
foreach ([] as $v) {}
2018-02-10 22:11:56 +00:00
foreach ($a as $v) : endforeach;
foreach ($a as $k => $v) {}
2018-02-12 13:08:08 +00:00
foreach ([] as $k => $v) {}
2018-02-10 22:11:56 +00:00
foreach ($a as $k => &$v) {}
foreach ($a as $k => list($v)) {}
function foo() {}
2018-02-12 13:08:08 +00:00
function foo() {
__halt_compiler();
function bar() {}
class Baz {}
return $a;
}
2018-02-12 21:10:53 +00:00
function foo(array $a, callable $b) {return;}
2018-02-10 22:11:56 +00:00
function &foo() {return 1;}
function &foo() {}
2018-02-12 21:10:53 +00:00
global $a, $b, $$c, ${foo()};
2018-02-10 22:11:56 +00:00
a:
goto a;
__halt_compiler();
if ($a) {}
if ($a) {} elseif ($b) {}
if ($a) {} else {}
if ($a) {} elseif ($b) {} elseif ($c) {} else {}
if ($a) {} elseif ($b) {} else if ($c) {} else {}
?> <div></div> <?
interface Foo {}
interface Foo extends Bar {}
interface Foo extends Bar, Baz {}
namespace Foo;
2018-02-12 13:08:08 +00:00
namespace Foo\Bar {}
2018-02-10 22:11:56 +00:00
namespace {}
class foo {var $a;}
class foo {public static $a, $b = 1;}
2018-02-13 10:33:21 +00:00
class foo {public static $a = 1, $b;}
2018-02-10 22:11:56 +00:00
static $a, $b = 1;
2018-02-12 21:10:53 +00:00
static $a = 1, $b;
2018-02-10 22:11:56 +00:00
switch (1) :
case 1:
default:
2018-02-12 21:10:53 +00:00
case 2:
endswitch;
switch (1) :;
case 1;
2018-02-10 22:11:56 +00:00
case 2;
endswitch;
switch (1) {
case 1: break;
2018-02-12 21:10:53 +00:00
case 2: break;
}
switch (1) {;
case 1; break;
2018-02-10 22:11:56 +00:00
case 2; break;
}
throw $e;
trait Foo {}
class Foo { use Bar; }
2018-02-13 10:16:53 +00:00
class Foo { use Bar, Baz {} }
class Foo { use Bar, Baz { one as public; } }
class Foo { use Bar, Baz { one as public two; } }
2018-02-10 22:11:56 +00:00
class Foo { use Bar, Baz { Bar::one insteadof Baz, Quux; Baz::one as two; } }
try {}
try {} catch (Exception $e) {}
try {} catch (Exception $e) {} catch (RuntimeException $e) {}
2018-02-13 17:38:37 +00:00
try {} catch (Exception $e) {} catch (\RuntimeException $e) {} catch (namespace\AdditionException $e) {}
2018-02-10 22:11:56 +00:00
try {} catch (Exception $e) {} finally {}
unset($a, $b);
use Foo;
2018-02-12 13:08:08 +00:00
use \Foo;
use \Foo as Bar;
2018-02-10 22:11:56 +00:00
use Foo, Bar;
use Foo, Bar as Baz;
2018-02-12 13:08:08 +00:00
use function Foo, \Bar;
use function Foo as foo, \Bar as bar;
use const Foo, \Bar;
use const Foo as foo, \Bar as bar;
2018-02-10 22:11:56 +00:00
$a[1];
$a[1][2];
array();
array(1);
array(1=>1, &$b,);
2018-02-14 19:02:57 +00:00
array(3 =>&$b);
array(&$b, 1=>1, 1, 3 =>&$b);
2018-02-10 22:11:56 +00:00
~$a;
!$a;
Foo::Bar;
clone($a);
clone $a;
function(){};
function($a, $b) use ($c, &$d) {};
2018-02-13 15:42:00 +00:00
function($a, $b) use (&$c, $d) {};
2018-02-10 22:11:56 +00:00
function() {};
foo;
namespace\foo;
\foo;
empty($a);
2018-02-14 19:02:57 +00:00
empty(Foo);
2018-02-10 22:11:56 +00:00
@$a;
eval($a);
exit;
exit($a);
2018-02-14 10:30:41 +00:00
die();
2018-02-10 22:11:56 +00:00
die($a);
foo();
2018-02-12 21:10:53 +00:00
namespace\foo(&$a);
\foo([]);
$foo(yield $a);
2018-02-10 22:11:56 +00:00
$a--;
$a++;
--$a;
++$a;
include $a;
include_once $a;
require $a;
require_once $a;
$a instanceof Foo;
$a instanceof namespace\Foo;
$a instanceof \Foo;
isset($a, $b);
2018-02-14 19:02:57 +00:00
isset(Foo);
list() = $b;
list($a, $b) = $b;
2018-02-10 22:11:56 +00:00
list($a[]) = $b;
list(list($a)) = $b;
$a->foo();
2018-02-13 11:38:57 +00:00
new Foo;
2018-02-10 22:11:56 +00:00
new namespace\Foo();
new \Foo();
print($a);
$a->foo;
2018-02-14 19:02:57 +00:00
$a->foo[1];
$a->foo->bar->baz()->quux[0];
$a->foo()[1][1];
2018-02-14 10:30:41 +00:00
` + "`cmd $a`;" + `
` + "`cmd`;" + `
` + "``;" + `
2018-02-10 22:11:56 +00:00
[];
[1];
[1=>1, &$b,];
Foo::bar();
namespace\Foo::bar();
\Foo::bar();
2018-02-13 17:38:37 +00:00
Foo::$bar();
$foo::$bar();
2018-02-10 22:11:56 +00:00
Foo::$bar;
namespace\Foo::$bar;
\Foo::$bar;
$a ? $b : $c;
$a ? : $c;
$a ? $b ? $c : $d : $e;
$a ? $b : $c ? $d : $e;
-$a;
+$a;
$$a;
2018-02-14 19:02:57 +00:00
$$$a;
2018-02-10 22:11:56 +00:00
yield;
yield $a;
yield $a => $b;
2018-02-14 15:28:20 +00:00
yield Foo::class;
yield $a => Foo::class;
2018-02-10 22:11:56 +00:00
(array)$a;
(boolean)$a;
(bool)$a;
(double)$a;
(float)$a;
(integer)$a;
(int)$a;
(object)$a;
(string)$a;
(unset)$a;
$a & $b;
$a | $b;
$a ^ $b;
$a && $b;
$a || $b;
$a . $b;
$a / $b;
$a == $b;
$a >= $b;
$a > $b;
$a === $b;
$a and $b;
$a or $b;
$a xor $b;
$a - $b;
$a % $b;
$a * $b;
$a != $b;
$a !== $b;
$a + $b;
$a ** $b;
$a << $b;
$a >> $b;
$a <= $b;
$a < $b;
$a =& $b;
2018-02-13 11:38:57 +00:00
$a =& new Foo;
$a =& new Foo($b);
2018-02-10 22:11:56 +00:00
$a = $b;
$a &= $b;
$a |= $b;
$a ^= $b;
$a .= $b;
$a /= $b;
$a -= $b;
$a %= $b;
$a *= $b;
$a += $b;
$a **= $b;
$a <<= $b;
$a >>= $b;
2018-02-13 11:15:28 +00:00
(new \Foo());
(new \Foo())->bar()->baz;
(new \Foo())[0][0];
(new \Foo())[0]->bar();
2018-02-13 12:58:10 +00:00
array([0])[0][0];
"foo"[0];
foo[0];
2018-02-13 17:38:37 +00:00
static::foo;
2018-02-14 10:14:08 +00:00
new $foo;
2018-02-14 19:02:57 +00:00
new $foo::$bar;
2018-02-14 10:14:08 +00:00
new $a->b[0];
2018-02-14 14:23:10 +00:00
new $a->b{$b ?: null}->$c->d[0];static $a = [1][0];
static $a = !1;
static $a = ~1;
static $a = +1;
static $a = -1;
static $a = (1);
static $a = 1 ?: 2;
static $a = 1 ? 2 : 3;
static $a = 1 & 2;
static $a = 1 | 2;
static $a = 1 ^ 2;
static $a = 1 && 2;
static $a = 1 || 2;
static $a = 1 . 2;
static $a = 1 / 2;
static $a = 1 == 2;
static $a = 1 >= 2;
static $a = 1 > 2;
static $a = 1 === 2;
static $a = 1 and 2;
static $a = 1 or 2;
static $a = 1 xor 2;
static $a = 1 - 2;
static $a = 1 % 2;
static $a = 1 * 2;
static $a = 1 != 2;
static $a = 1 !== 2;
static $a = 1 + 2;
static $a = 1 ** 2;
static $a = 1 << 2;
static $a = 1 >> 2;
static $a = 1 <= 2;
static $a = 1 < 2;
static $a = Foo::bar;
static $a = Foo::class;
static $a = __CLASS__;
static $a = Foo;
static $a = namespace\Foo;
static $a = \Foo;
static $a = array();
2018-02-14 15:28:20 +00:00
static $a = array(1 => 1, 2);
static $a = [1, 2 => 2][0];
2018-02-14 19:02:57 +00:00
if (yield 1) {}
Foo::$$bar;
$foo();
$foo()[0][0];
$a{$b};
${$a};
$foo::{$bar}();
$foo::bar;
2018-02-10 22:11:56 +00:00
`
expectedParams := []node.Node{
&node.Parameter{
ByRef: false,
Variadic: false,
VariableType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "bar"}}},
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$bar"}},
2018-02-12 10:09:56 +00:00
DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}},
2018-02-10 22:11:56 +00:00
},
&node.Parameter{
ByRef: true,
Variadic: true,
VariableType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "baz"}}},
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$baz"}},
},
}
expected := &stmt.StmtList{
Stmts: []node.Node{
&stmt.Expression{
Expr: &expr.FunctionCall{
Function: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}},
Arguments: []node.Node{
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}},
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}},
},
},
},
&stmt.Expression{
Expr: &expr.FunctionCall{
Function: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Arguments: []node.Node{
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}},
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}},
},
},
},
&stmt.Expression{
Expr: &expr.MethodCall{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Method: &node.Identifier{Value: "bar"},
Arguments: []node.Node{
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}},
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}},
},
},
},
&stmt.Expression{
Expr: &expr.StaticCall{
Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}},
Call: &node.Identifier{Value: "bar"},
Arguments: []node.Node{
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}},
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}},
},
},
},
&stmt.Expression{
Expr: &expr.StaticCall{
Class: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Call: &node.Identifier{Value: "bar"},
Arguments: []node.Node{
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}},
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}},
},
},
},
&stmt.Expression{
Expr: &expr.New{
Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}},
Arguments: []node.Node{
&node.Argument{Variadic: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}},
&node.Argument{Variadic: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "$b"}}},
},
},
},
&stmt.Function{
ReturnsRef: false,
PhpDocComment: "",
FunctionName: &node.Identifier{Value: "foo"},
Params: expectedParams,
Stmts: []node.Node{},
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{
&stmt.ClassMethod{
MethodName: &node.Identifier{Value: "foo"},
Modifiers: []node.Node{&node.Identifier{Value: "public"}},
Params: expectedParams,
Stmts: []node.Node{},
},
},
},
&stmt.Expression{
Expr: &expr.Closure{
Params: expectedParams,
Uses: []node.Node{},
Stmts: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.Closure{
Static: true,
Params: expectedParams,
Uses: []node.Node{},
Stmts: []node.Node{},
},
},
&stmt.Expression{
Expr: &scalar.String{Value: "\"test\""},
},
&stmt.Expression{
Expr: &scalar.String{Value: "\"\\$test\""},
},
&stmt.Expression{
Expr: &scalar.String{Value: "\"\n\t\t\ttest\n\t\t\""},
},
&stmt.Expression{
Expr: &scalar.String{Value: "'$test'"},
},
&stmt.Expression{
Expr: &scalar.String{Value: "'\n\t\t\t$test\n\t\t'"},
},
2018-02-14 10:30:41 +00:00
&stmt.Expression{
Expr: &scalar.Encapsed{},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &scalar.String{Value: "\thello\n"},
},
&stmt.Expression{
Expr: &scalar.String{Value: "\thello\n"},
},
2018-02-14 15:28:20 +00:00
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "\thello "},
&expr.Variable{VarName: &node.Identifier{Value: "$world"}},
&scalar.EncapsedStringPart{Value: "\n"},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &scalar.String{Value: "\thello $world\n"},
},
&stmt.Expression{
Expr: &scalar.Lnumber{Value: "1234567890123456789"},
},
&stmt.Expression{
Expr: &scalar.Dnumber{Value: "12345678901234567890"},
},
&stmt.Expression{
Expr: &scalar.Dnumber{Value: "0."},
},
&stmt.Expression{
Expr: &scalar.Lnumber{Value: "0b0111111111111111111111111111111111111111111111111111111111111111"},
},
&stmt.Expression{
Expr: &scalar.Dnumber{Value: "0b1111111111111111111111111111111111111111111111111111111111111111"},
},
&stmt.Expression{
Expr: &scalar.Lnumber{Value: "0x007111111111111111"},
},
&stmt.Expression{
Expr: &scalar.Dnumber{Value: "0x8111111111111111"},
},
&stmt.Expression{
Expr: &scalar.MagicConstant{Value: "__CLASS__"},
},
&stmt.Expression{
Expr: &scalar.MagicConstant{Value: "__DIR__"},
},
&stmt.Expression{
Expr: &scalar.MagicConstant{Value: "__FILE__"},
},
&stmt.Expression{
Expr: &scalar.MagicConstant{Value: "__FUNCTION__"},
},
&stmt.Expression{
Expr: &scalar.MagicConstant{Value: "__LINE__"},
},
&stmt.Expression{
Expr: &scalar.MagicConstant{Value: "__NAMESPACE__"},
},
&stmt.Expression{
Expr: &scalar.MagicConstant{Value: "__METHOD__"},
},
&stmt.Expression{
Expr: &scalar.MagicConstant{Value: "__TRAIT__"},
},
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "test "},
&expr.Variable{VarName: &node.Identifier{Value: "$var"}},
},
},
},
2018-02-14 19:02:57 +00:00
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "test "},
&expr.ArrayDimFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$var"}},
2018-02-14 19:21:32 +00:00
Dim: &scalar.Lnumber{Value: "1"},
2018-02-14 19:02:57 +00:00
},
},
},
},
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "test "},
&expr.ArrayDimFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$var"}},
2018-02-14 19:21:32 +00:00
Dim: &scalar.String{Value: "1234567890123456789012345678901234567890"},
2018-02-14 19:02:57 +00:00
},
},
},
},
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "test "},
&expr.ArrayDimFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$var"}},
2018-02-14 19:21:32 +00:00
Dim: &scalar.String{Value: "bar"},
2018-02-14 19:02:57 +00:00
},
},
},
},
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "test "},
&expr.ArrayDimFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$var"}},
2018-02-14 19:21:32 +00:00
Dim: &expr.Variable{VarName: &node.Identifier{Value: "$bar"}},
2018-02-14 19:02:57 +00:00
},
},
},
},
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
&scalar.EncapsedStringPart{Value: " "},
&expr.Variable{VarName: &node.Identifier{Value: "$bar"}},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "test "},
&expr.PropertyFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Property: &node.Identifier{Value: "bar"},
},
&scalar.EncapsedStringPart{Value: "()"},
},
},
},
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "test "},
&expr.Variable{VarName: &node.Identifier{Value: "foo"}},
},
},
},
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "test "},
&expr.ArrayDimFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}},
Dim: &scalar.Lnumber{Value: "0"},
},
},
},
},
&stmt.Expression{
Expr: &scalar.Encapsed{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "test "},
&expr.MethodCall{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Method: &node.Identifier{Value: "bar"},
Arguments: []node.Node{},
},
},
},
},
&stmt.AltIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
&stmt.AltIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
ElseIf: []node.Node{
&stmt.AltElseIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
},
},
&stmt.AltIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
Else: &stmt.AltElse{
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
},
&stmt.AltIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
ElseIf: []node.Node{
&stmt.AltElseIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
&stmt.AltElseIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
},
Else: &stmt.AltElse{
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
},
&stmt.While{
Cond: &scalar.Lnumber{Value: "1"},
Stmt: &stmt.StmtList{
Stmts: []node.Node{
&stmt.Break{},
},
},
},
&stmt.While{
Cond: &scalar.Lnumber{Value: "1"},
Stmt: &stmt.StmtList{
Stmts: []node.Node{
&stmt.Break{
Expr: &scalar.Lnumber{Value: "2"},
},
},
},
},
2018-02-18 17:44:17 +00:00
&stmt.AltWhile{
2018-02-10 22:11:56 +00:00
Cond: &scalar.Lnumber{Value: "1"},
Stmt: &stmt.StmtList{
Stmts: []node.Node{
&stmt.Break{
Expr: &scalar.Lnumber{Value: "3"},
},
},
},
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{
&stmt.ClassConstList{
Consts: []node.Node{
&stmt.Constant{
PhpDocComment: "",
ConstantName: &node.Identifier{Value: "FOO"},
Expr: &scalar.Lnumber{Value: "1"},
},
&stmt.Constant{
PhpDocComment: "",
ConstantName: &node.Identifier{Value: "BAR"},
Expr: &scalar.Lnumber{Value: "2"},
},
},
},
},
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{
&stmt.ClassMethod{
PhpDocComment: "",
MethodName: &node.Identifier{Value: "bar"},
Stmts: []node.Node{},
},
},
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{
&stmt.ClassMethod{
PhpDocComment: "",
ReturnsRef: true,
MethodName: &node.Identifier{Value: "bar"},
Modifiers: []node.Node{
&node.Identifier{Value: "public"},
&node.Identifier{Value: "static"},
},
Stmts: []node.Node{},
},
},
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{
&stmt.ClassMethod{
PhpDocComment: "",
2018-02-13 10:16:53 +00:00
ReturnsRef: false,
2018-02-10 22:11:56 +00:00
MethodName: &node.Identifier{Value: "bar"},
Modifiers: []node.Node{
2018-02-13 10:16:53 +00:00
&node.Identifier{Value: "final"},
&node.Identifier{Value: "private"},
},
Stmts: []node.Node{},
},
&stmt.ClassMethod{
PhpDocComment: "",
ReturnsRef: false,
MethodName: &node.Identifier{Value: "baz"},
Modifiers: []node.Node{
&node.Identifier{Value: "protected"},
2018-02-10 22:11:56 +00:00
},
Stmts: []node.Node{},
},
},
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Modifiers: []node.Node{
&node.Identifier{Value: "abstract"},
},
2018-02-13 10:16:53 +00:00
Stmts: []node.Node{
&stmt.ClassMethod{
PhpDocComment: "",
ReturnsRef: false,
MethodName: &node.Identifier{Value: "bar"},
Modifiers: []node.Node{
&node.Identifier{Value: "abstract"},
&node.Identifier{Value: "public"},
},
},
},
2018-02-10 22:11:56 +00:00
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Modifiers: []node.Node{
&node.Identifier{Value: "final"},
},
Extends: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "bar"},
},
},
Stmts: []node.Node{},
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Modifiers: []node.Node{
&node.Identifier{Value: "final"},
},
Implements: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "bar"},
},
},
},
Stmts: []node.Node{},
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Modifiers: []node.Node{
&node.Identifier{Value: "final"},
},
Implements: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "bar"},
},
},
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "baz"},
},
},
},
Stmts: []node.Node{},
},
&stmt.ConstList{
Consts: []node.Node{
&stmt.Constant{
PhpDocComment: "",
ConstantName: &node.Identifier{Value: "FOO"},
Expr: &scalar.Lnumber{Value: "1"},
},
&stmt.Constant{
PhpDocComment: "",
ConstantName: &node.Identifier{Value: "BAR"},
Expr: &scalar.Lnumber{Value: "2"},
},
},
},
&stmt.While{
Cond: &scalar.Lnumber{Value: "1"},
Stmt: &stmt.StmtList{
Stmts: []node.Node{
&stmt.Continue{Expr: nil},
},
},
},
&stmt.While{
Cond: &scalar.Lnumber{Value: "1"},
Stmt: &stmt.StmtList{
Stmts: []node.Node{
&stmt.Continue{
Expr: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.While{
Cond: &scalar.Lnumber{Value: "1"},
Stmt: &stmt.StmtList{
Stmts: []node.Node{
&stmt.Continue{
Expr: &scalar.Lnumber{Value: "3"},
},
},
},
},
&stmt.Declare{
Consts: []node.Node{
&stmt.Constant{
PhpDocComment: "",
ConstantName: &node.Identifier{Value: "ticks"},
Expr: &scalar.Lnumber{Value: "1"},
},
},
Stmt: &stmt.Nop{},
},
&stmt.Declare{
Consts: []node.Node{
&stmt.Constant{
PhpDocComment: "",
ConstantName: &node.Identifier{Value: "ticks"},
Expr: &scalar.Lnumber{Value: "1"},
},
2018-02-12 21:10:53 +00:00
&stmt.Constant{
PhpDocComment: "",
ConstantName: &node.Identifier{Value: "strict_types"},
Expr: &scalar.Lnumber{Value: "1"},
},
2018-02-10 22:11:56 +00:00
},
Stmt: &stmt.StmtList{
Stmts: []node.Node{},
},
},
&stmt.Declare{
Consts: []node.Node{
&stmt.Constant{
PhpDocComment: "",
ConstantName: &node.Identifier{Value: "ticks"},
Expr: &scalar.Lnumber{Value: "1"},
},
},
Stmt: &stmt.StmtList{
Stmts: []node.Node{},
},
},
&stmt.Do{
Stmt: &stmt.StmtList{
Stmts: []node.Node{},
},
Cond: &scalar.Lnumber{Value: "1"},
},
&stmt.Echo{
Exprs: []node.Node{
&expr.Variable{
VarName: &node.Identifier{Value: "$a"},
},
&scalar.Lnumber{Value: "1"},
},
},
&stmt.Echo{
Exprs: []node.Node{
&expr.Variable{
VarName: &node.Identifier{Value: "$a"},
},
},
},
&stmt.For{
Init: []node.Node{
2018-02-19 11:12:09 +00:00
&assign.Assign{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
Expression: &scalar.Lnumber{Value: "0"},
},
},
Cond: []node.Node{
2018-02-19 11:12:09 +00:00
&binary.Smaller{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
Right: &scalar.Lnumber{Value: "10"},
},
},
Loop: []node.Node{
&expr.PostInc{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
},
&expr.PostInc{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
},
},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
2018-02-18 17:57:54 +00:00
&stmt.AltFor{
2018-02-12 13:08:08 +00:00
Cond: []node.Node{
2018-02-19 11:12:09 +00:00
&binary.Smaller{
2018-02-12 13:08:08 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
Right: &scalar.Lnumber{Value: "10"},
},
},
Loop: []node.Node{
&expr.PostInc{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$i"}},
},
},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
2018-02-10 22:11:56 +00:00
&stmt.Foreach{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$v"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
2018-02-12 13:08:08 +00:00
&stmt.Foreach{
Expr: &expr.ShortArray{Items: []node.Node{}},
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$v"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
2018-02-18 18:29:33 +00:00
&stmt.AltForeach{
2018-02-10 22:11:56 +00:00
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$v"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
&stmt.Foreach{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Key: &expr.Variable{VarName: &node.Identifier{Value: "$k"}},
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$v"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
2018-02-12 13:08:08 +00:00
&stmt.Foreach{
Expr: &expr.ShortArray{Items: []node.Node{}},
Key: &expr.Variable{VarName: &node.Identifier{Value: "$k"}},
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$v"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
2018-02-10 22:11:56 +00:00
&stmt.Foreach{
ByRef: true,
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Key: &expr.Variable{VarName: &node.Identifier{Value: "$k"}},
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$v"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
&stmt.Foreach{
ByRef: false,
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Key: &expr.Variable{VarName: &node.Identifier{Value: "$k"}},
Variable: &expr.List{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Val: &expr.Variable{VarName: &node.Identifier{Value: "$v"}},
},
},
},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
&stmt.Function{
ReturnsRef: false,
PhpDocComment: "",
FunctionName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{},
},
2018-02-12 13:08:08 +00:00
&stmt.Function{
ReturnsRef: false,
PhpDocComment: "",
FunctionName: &node.Identifier{Value: "foo"},
2018-02-12 21:10:53 +00:00
Stmts: []node.Node{
2018-02-12 13:08:08 +00:00
&stmt.HaltCompiler{},
&stmt.Function{
ReturnsRef: false,
PhpDocComment: "",
FunctionName: &node.Identifier{Value: "bar"},
Stmts: []node.Node{},
},
&stmt.Class{
PhpDocComment: "",
2018-02-12 21:10:53 +00:00
ClassName: &node.Identifier{Value: "Baz"},
Stmts: []node.Node{},
2018-02-12 13:08:08 +00:00
},
&stmt.Return{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Function{
ReturnsRef: false,
PhpDocComment: "",
FunctionName: &node.Identifier{Value: "foo"},
2018-02-12 21:10:53 +00:00
Params: []node.Node{
&node.Parameter{
ByRef: false,
Variadic: false,
VariableType: &node.Identifier{Value: "array"},
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
&node.Parameter{
ByRef: false,
Variadic: false,
VariableType: &node.Identifier{Value: "callable"},
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
2018-02-10 22:11:56 +00:00
Stmts: []node.Node{
&stmt.Return{},
},
},
&stmt.Function{
ReturnsRef: true,
PhpDocComment: "",
FunctionName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{
&stmt.Return{
Expr: &scalar.Lnumber{Value: "1"},
},
},
},
&stmt.Function{
ReturnsRef: true,
PhpDocComment: "",
FunctionName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{},
},
&stmt.Global{
Vars: []node.Node{
&expr.Variable{VarName: &node.Identifier{Value: "$a"}},
&expr.Variable{VarName: &node.Identifier{Value: "$b"}},
2018-02-12 21:10:53 +00:00
&expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "$c"}}},
&expr.Variable{
VarName: &expr.FunctionCall{
Function: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "foo"},
},
},
Arguments: []node.Node{},
},
},
2018-02-10 22:11:56 +00:00
},
},
&stmt.Label{
LabelName: &node.Identifier{Value: "a"},
},
&stmt.Goto{
Label: &node.Identifier{Value: "a"},
},
&stmt.HaltCompiler{},
&stmt.If{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
&stmt.If{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
ElseIf: []node.Node{
&stmt.ElseIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
},
},
&stmt.If{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
Else: &stmt.Else{
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
},
&stmt.If{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
ElseIf: []node.Node{
&stmt.ElseIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
&stmt.ElseIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
},
Else: &stmt.Else{
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
},
&stmt.If{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
ElseIf: []node.Node{
&stmt.ElseIf{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
},
Else: &stmt.Else{
Stmt: &stmt.If{
Cond: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
Else: &stmt.Else{
Stmt: &stmt.StmtList{Stmts: []node.Node{}},
},
},
},
},
&stmt.Nop{},
&stmt.InlineHtml{Value: "<div></div> "},
&stmt.Interface{
PhpDocComment: "",
InterfaceName: &node.Identifier{Value: "Foo"},
Stmts: []node.Node{},
},
&stmt.Interface{
PhpDocComment: "",
InterfaceName: &node.Identifier{Value: "Foo"},
Extends: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
},
Stmts: []node.Node{},
},
&stmt.Interface{
PhpDocComment: "",
InterfaceName: &node.Identifier{Value: "Foo"},
Extends: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Baz"},
},
},
},
Stmts: []node.Node{},
},
&stmt.Namespace{
NamespaceName: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
&stmt.Namespace{
NamespaceName: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
2018-02-12 13:08:08 +00:00
&name.NamePart{Value: "Bar"},
2018-02-10 22:11:56 +00:00
},
},
Stmts: []node.Node{},
},
&stmt.Namespace{
Stmts: []node.Node{},
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{
&stmt.PropertyList{
Modifiers: []node.Node{
&node.Identifier{Value: "var"},
},
Properties: []node.Node{
&stmt.Property{
PhpDocComment: "",
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
},
},
},
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{
&stmt.PropertyList{
Modifiers: []node.Node{
&node.Identifier{Value: "public"},
&node.Identifier{Value: "static"},
},
Properties: []node.Node{
&stmt.Property{
PhpDocComment: "",
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
&stmt.Property{
PhpDocComment: "",
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
Expr: &scalar.Lnumber{Value: "1"},
},
},
},
},
},
2018-02-13 10:33:21 +00:00
&stmt.Class{
ClassName: &node.Identifier{Value: "foo"},
Stmts: []node.Node{
&stmt.PropertyList{
Modifiers: []node.Node{
&node.Identifier{Value: "public"},
&node.Identifier{Value: "static"},
},
Properties: []node.Node{
&stmt.Property{
PhpDocComment: "",
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &scalar.Lnumber{Value: "1"},
},
&stmt.Property{
PhpDocComment: "",
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
Expr: &scalar.Lnumber{Value: "1"},
},
},
},
2018-02-12 21:10:53 +00:00
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &scalar.Lnumber{Value: "1"},
},
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
},
2018-02-18 18:39:41 +00:00
&stmt.AltSwitch{
2018-02-10 22:11:56 +00:00
Cond: &scalar.Lnumber{Value: "1"},
Cases: []node.Node{
&stmt.Case{
Cond: &scalar.Lnumber{Value: "1"},
Stmts: []node.Node{},
},
&stmt.Default{
Stmts: []node.Node{},
},
&stmt.Case{
Cond: &scalar.Lnumber{Value: "2"},
Stmts: []node.Node{},
},
},
},
2018-02-18 18:39:41 +00:00
&stmt.AltSwitch{
2018-02-12 21:10:53 +00:00
Cond: &scalar.Lnumber{Value: "1"},
Cases: []node.Node{
&stmt.Case{
Cond: &scalar.Lnumber{Value: "1"},
Stmts: []node.Node{},
},
&stmt.Case{
Cond: &scalar.Lnumber{Value: "2"},
Stmts: []node.Node{},
},
},
},
&stmt.Switch{
Cond: &scalar.Lnumber{Value: "1"},
Cases: []node.Node{
&stmt.Case{
Cond: &scalar.Lnumber{Value: "1"},
Stmts: []node.Node{
&stmt.Break{},
},
},
&stmt.Case{
Cond: &scalar.Lnumber{Value: "2"},
Stmts: []node.Node{
&stmt.Break{},
},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Switch{
Cond: &scalar.Lnumber{Value: "1"},
Cases: []node.Node{
&stmt.Case{
Cond: &scalar.Lnumber{Value: "1"},
Stmts: []node.Node{
&stmt.Break{},
},
},
&stmt.Case{
Cond: &scalar.Lnumber{Value: "2"},
Stmts: []node.Node{
&stmt.Break{},
},
},
},
},
&stmt.Throw{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$e"}},
},
&stmt.Trait{
PhpDocComment: "",
TraitName: &node.Identifier{Value: "Foo"},
Stmts: []node.Node{},
},
&stmt.Class{
PhpDocComment: "",
ClassName: &node.Identifier{Value: "Foo"},
Stmts: []node.Node{
&stmt.TraitUse{
Traits: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
},
},
},
},
&stmt.Class{
PhpDocComment: "",
ClassName: &node.Identifier{Value: "Foo"},
Stmts: []node.Node{
&stmt.TraitUse{
Traits: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Baz"},
},
},
},
},
},
},
2018-02-13 10:16:53 +00:00
&stmt.Class{
PhpDocComment: "",
ClassName: &node.Identifier{Value: "Foo"},
Stmts: []node.Node{
&stmt.TraitUse{
Traits: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Baz"},
},
},
},
Adaptations: []node.Node{
&stmt.TraitUseAlias{
Ref: &stmt.TraitMethodRef{
Method: &node.Identifier{Value: "one"},
},
Modifier: &node.Identifier{Value: "public"},
},
},
},
},
},
&stmt.Class{
PhpDocComment: "",
ClassName: &node.Identifier{Value: "Foo"},
Stmts: []node.Node{
&stmt.TraitUse{
Traits: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Baz"},
},
},
},
Adaptations: []node.Node{
&stmt.TraitUseAlias{
Ref: &stmt.TraitMethodRef{
Method: &node.Identifier{Value: "one"},
},
Modifier: &node.Identifier{Value: "public"},
2018-02-14 19:02:57 +00:00
Alias: &node.Identifier{Value: "two"},
2018-02-13 10:16:53 +00:00
},
},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Class{
PhpDocComment: "",
ClassName: &node.Identifier{Value: "Foo"},
Stmts: []node.Node{
&stmt.TraitUse{
Traits: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Baz"},
},
},
},
Adaptations: []node.Node{
&stmt.TraitUsePrecedence{
Ref: &stmt.TraitMethodRef{
Trait: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
Method: &node.Identifier{Value: "one"},
},
Insteadof: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Baz"},
},
},
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Quux"},
},
},
},
},
&stmt.TraitUseAlias{
Ref: &stmt.TraitMethodRef{
Trait: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Baz"},
},
},
Method: &node.Identifier{Value: "one"},
},
Alias: &node.Identifier{Value: "two"},
},
},
},
},
},
&stmt.Try{
Stmts: []node.Node{},
Catches: []node.Node{},
},
&stmt.Try{
Stmts: []node.Node{},
Catches: []node.Node{
&stmt.Catch{
Types: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Exception"},
},
},
},
Variable: &expr.Variable{
VarName: &node.Identifier{Value: "$e"},
},
Stmts: []node.Node{},
},
},
},
&stmt.Try{
Stmts: []node.Node{},
Catches: []node.Node{
&stmt.Catch{
Types: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Exception"},
},
},
},
Variable: &expr.Variable{
VarName: &node.Identifier{Value: "$e"},
},
Stmts: []node.Node{},
},
&stmt.Catch{
Types: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "RuntimeException"},
},
},
},
Variable: &expr.Variable{
VarName: &node.Identifier{Value: "$e"},
},
Stmts: []node.Node{},
},
},
},
2018-02-12 13:08:08 +00:00
&stmt.Try{
Stmts: []node.Node{},
Catches: []node.Node{
&stmt.Catch{
Types: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Exception"},
},
},
},
Variable: &expr.Variable{
VarName: &node.Identifier{Value: "$e"},
},
Stmts: []node.Node{},
},
&stmt.Catch{
Types: []node.Node{
2018-02-13 17:38:37 +00:00
&name.FullyQualified{
2018-02-12 13:08:08 +00:00
Parts: []node.Node{
&name.NamePart{Value: "RuntimeException"},
},
},
},
Variable: &expr.Variable{
VarName: &node.Identifier{Value: "$e"},
},
Stmts: []node.Node{},
},
&stmt.Catch{
Types: []node.Node{
2018-02-13 17:38:37 +00:00
&name.Relative{
2018-02-12 13:08:08 +00:00
Parts: []node.Node{
&name.NamePart{Value: "AdditionException"},
},
},
},
Variable: &expr.Variable{
VarName: &node.Identifier{Value: "$e"},
},
Stmts: []node.Node{},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Try{
Stmts: []node.Node{},
Catches: []node.Node{
&stmt.Catch{
Types: []node.Node{
&name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Exception"},
},
},
},
Variable: &expr.Variable{
VarName: &node.Identifier{Value: "$e"},
},
Stmts: []node.Node{},
},
},
Finally: &stmt.Finally{
Stmts: []node.Node{},
},
},
&stmt.Unset{
Vars: []node.Node{
&expr.Variable{VarName: &node.Identifier{Value: "$a"}},
&expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.UseList{
Uses: []node.Node{
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
},
},
2018-02-12 13:08:08 +00:00
&stmt.UseList{
Uses: []node.Node{
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
},
},
&stmt.UseList{
Uses: []node.Node{
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Alias: &node.Identifier{Value: "Bar"},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.UseList{
Uses: []node.Node{
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
},
},
},
&stmt.UseList{
Uses: []node.Node{
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
Alias: &node.Identifier{Value: "Baz"},
},
},
},
&stmt.UseList{
UseType: &node.Identifier{Value: "function"},
Uses: []node.Node{
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
},
},
},
2018-02-12 13:08:08 +00:00
&stmt.UseList{
UseType: &node.Identifier{Value: "function"},
Uses: []node.Node{
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Alias: &node.Identifier{Value: "foo"},
},
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
Alias: &node.Identifier{Value: "bar"},
},
},
},
&stmt.UseList{
UseType: &node.Identifier{Value: "const"},
Uses: []node.Node{
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.UseList{
UseType: &node.Identifier{Value: "const"},
Uses: []node.Node{
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
2018-02-12 13:08:08 +00:00
Alias: &node.Identifier{Value: "foo"},
2018-02-10 22:11:56 +00:00
},
&stmt.Use{
Use: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Bar"},
},
},
2018-02-12 13:08:08 +00:00
Alias: &node.Identifier{Value: "bar"},
2018-02-10 22:11:56 +00:00
},
},
},
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Dim: &scalar.Lnumber{Value: "1"},
},
},
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &expr.ArrayDimFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Dim: &scalar.Lnumber{Value: "1"},
},
Dim: &scalar.Lnumber{Value: "2"},
},
},
&stmt.Expression{
Expr: &expr.Array{
Items: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.Array{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Val: &scalar.Lnumber{Value: "1"},
},
},
},
},
&stmt.Expression{
Expr: &expr.Array{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Key: &scalar.Lnumber{Value: "1"},
Val: &scalar.Lnumber{Value: "1"},
},
&expr.ArrayItem{
ByRef: true,
Val: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
},
},
2018-02-14 19:02:57 +00:00
&stmt.Expression{
Expr: &expr.Array{
Items: []node.Node{
&expr.ArrayItem{
ByRef: true,
Key: &scalar.Lnumber{Value: "3"},
Val: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
},
},
&stmt.Expression{
Expr: &expr.Array{
Items: []node.Node{
&expr.ArrayItem{
ByRef: true,
Val: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
&expr.ArrayItem{
ByRef: false,
Key: &scalar.Lnumber{Value: "1"},
Val: &scalar.Lnumber{Value: "1"},
},
&expr.ArrayItem{
ByRef: false,
Val: &scalar.Lnumber{Value: "1"},
},
&expr.ArrayItem{
ByRef: true,
Key: &scalar.Lnumber{Value: "3"},
Val: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &expr.BitwiseNot{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.BooleanNot{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.ClassConstFetch{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
ConstantName: &node.Identifier{Value: "Bar"},
},
},
&stmt.Expression{
Expr: &expr.Clone{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.Clone{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.Closure{
ReturnsRef: false,
Static: false,
PhpDocComment: "",
Uses: []node.Node{},
Stmts: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.Closure{
ReturnsRef: false,
Static: false,
PhpDocComment: "",
Params: []node.Node{
&node.Parameter{
ByRef: false,
Variadic: false,
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
&node.Parameter{
ByRef: false,
Variadic: false,
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
Uses: []node.Node{
&expr.ClosureUse{
ByRef: false,
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
},
&expr.ClosureUse{
ByRef: true,
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$d"}},
},
},
Stmts: []node.Node{},
},
},
2018-02-13 15:42:00 +00:00
&stmt.Expression{
Expr: &expr.Closure{
ReturnsRef: false,
Static: false,
PhpDocComment: "",
Params: []node.Node{
&node.Parameter{
ByRef: false,
Variadic: false,
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
&node.Parameter{
ByRef: false,
Variadic: false,
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
Uses: []node.Node{
&expr.ClosureUse{
ByRef: true,
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
},
&expr.ClosureUse{
ByRef: false,
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$d"}},
},
},
Stmts: []node.Node{},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &expr.Closure{
ReturnsRef: false,
Static: false,
PhpDocComment: "",
Uses: []node.Node{},
Stmts: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.ConstFetch{
Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "foo"}}},
},
},
&stmt.Expression{
Expr: &expr.ConstFetch{
Constant: &name.Relative{Parts: []node.Node{&name.NamePart{Value: "foo"}}},
},
},
&stmt.Expression{
Expr: &expr.ConstFetch{
Constant: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "foo"}}},
},
},
&stmt.Expression{
Expr: &expr.Empty{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
2018-02-14 19:02:57 +00:00
&stmt.Expression{
Expr: &expr.Empty{
Expr: &expr.ConstFetch{
Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &expr.ErrorSuppress{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.Eval{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
2018-02-18 17:09:18 +00:00
Expr: &expr.Exit{},
2018-02-10 22:11:56 +00:00
},
&stmt.Expression{
Expr: &expr.Exit{
2018-02-18 17:09:18 +00:00
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-10 22:11:56 +00:00
},
},
&stmt.Expression{
2018-02-18 17:09:18 +00:00
Expr: &expr.Die{},
2018-02-10 22:11:56 +00:00
},
&stmt.Expression{
2018-02-18 17:09:18 +00:00
Expr: &expr.Die{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-10 22:11:56 +00:00
},
},
&stmt.Expression{
Expr: &expr.FunctionCall{
Function: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "foo"},
},
},
Arguments: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.FunctionCall{
Function: &name.Relative{
Parts: []node.Node{
&name.NamePart{Value: "foo"},
},
},
2018-02-12 21:10:53 +00:00
Arguments: []node.Node{
&node.Argument{
Variadic: false,
IsReference: true,
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
2018-02-10 22:11:56 +00:00
},
},
&stmt.Expression{
Expr: &expr.FunctionCall{
Function: &name.FullyQualified{
Parts: []node.Node{
&name.NamePart{Value: "foo"},
},
},
2018-02-12 21:10:53 +00:00
Arguments: []node.Node{
&node.Argument{
Variadic: false,
IsReference: false,
Expr: &expr.ShortArray{
Items: []node.Node{},
},
},
},
2018-02-10 22:11:56 +00:00
},
},
&stmt.Expression{
Expr: &expr.FunctionCall{
2018-02-12 21:10:53 +00:00
Function: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Arguments: []node.Node{
&node.Argument{
Variadic: false,
IsReference: false,
Expr: &expr.Yield{
Value: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
},
2018-02-10 22:11:56 +00:00
},
},
&stmt.Expression{
Expr: &expr.PostDec{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.PostInc{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.PreDec{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.PreInc{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.Include{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.IncludeOnce{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.Require{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.RequireOnce{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.InstanceOf{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
},
&stmt.Expression{
Expr: &expr.InstanceOf{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Class: &name.Relative{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
},
&stmt.Expression{
Expr: &expr.InstanceOf{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Class: &name.FullyQualified{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
},
&stmt.Expression{
Expr: &expr.Isset{
Variables: []node.Node{
&expr.Variable{VarName: &node.Identifier{Value: "$a"}},
&expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
},
2018-02-14 19:02:57 +00:00
&stmt.Expression{
Expr: &expr.Isset{
Variables: []node.Node{
&expr.ConstFetch{
Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
},
},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Assign{
2018-02-14 19:02:57 +00:00
Variable: &expr.List{
Items: []node.Node{},
},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Assign{
2018-02-10 22:11:56 +00:00
Variable: &expr.List{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Val: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
2018-02-14 19:02:57 +00:00
&expr.ArrayItem{
ByRef: false,
Val: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
2018-02-10 22:11:56 +00:00
},
},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Assign{
2018-02-10 22:11:56 +00:00
Variable: &expr.List{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Val: &expr.ArrayDimFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
},
},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Assign{
2018-02-10 22:11:56 +00:00
Variable: &expr.List{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Val: &expr.List{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Val: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
},
},
},
},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
Expr: &expr.MethodCall{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Method: &node.Identifier{Value: "foo"},
Arguments: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.New{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
},
&stmt.Expression{
Expr: &expr.New{
Class: &name.Relative{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Arguments: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.New{
Class: &name.FullyQualified{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Arguments: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.Print{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.PropertyFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Property: &node.Identifier{Value: "foo"},
},
},
2018-02-14 19:02:57 +00:00
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Property: &node.Identifier{Value: "foo"},
},
Dim: &scalar.Lnumber{Value: "1"},
},
},
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.MethodCall{
Variable: &expr.PropertyFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Property: &node.Identifier{Value: "foo"},
},
Property: &node.Identifier{Value: "bar"},
},
Method: &node.Identifier{Value: "baz"},
Arguments: []node.Node{},
},
Property: &node.Identifier{Value: "quux"},
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &expr.ArrayDimFetch{
Variable: &expr.MethodCall{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Method: &node.Identifier{Value: "foo"},
Arguments: []node.Node{},
},
Dim: &scalar.Lnumber{Value: "1"},
},
Dim: &scalar.Lnumber{Value: "1"},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &expr.ShellExec{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "cmd "},
&expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
},
2018-02-14 10:30:41 +00:00
&stmt.Expression{
Expr: &expr.ShellExec{
Parts: []node.Node{
&scalar.EncapsedStringPart{Value: "cmd"},
},
},
},
&stmt.Expression{
Expr: &expr.ShellExec{
Parts: []node.Node{},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &expr.ShortArray{
Items: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.ShortArray{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Val: &scalar.Lnumber{Value: "1"},
},
},
},
},
&stmt.Expression{
Expr: &expr.ShortArray{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Key: &scalar.Lnumber{Value: "1"},
Val: &scalar.Lnumber{Value: "1"},
},
&expr.ArrayItem{
ByRef: true,
Val: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
},
},
&stmt.Expression{
Expr: &expr.StaticCall{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Call: &node.Identifier{Value: "bar"},
Arguments: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.StaticCall{
Class: &name.Relative{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Call: &node.Identifier{Value: "bar"},
Arguments: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.StaticCall{
Class: &name.FullyQualified{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Call: &node.Identifier{Value: "bar"},
Arguments: []node.Node{},
},
},
2018-02-13 17:38:37 +00:00
&stmt.Expression{
Expr: &expr.StaticCall{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Call: &expr.Variable{VarName: &node.Identifier{Value: "$bar"}},
Arguments: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.StaticCall{
Class: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Call: &expr.Variable{VarName: &node.Identifier{Value: "$bar"}},
Arguments: []node.Node{},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &expr.StaticPropertyFetch{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Property: &expr.Variable{VarName: &node.Identifier{Value: "$bar"}},
},
},
&stmt.Expression{
Expr: &expr.StaticPropertyFetch{
Class: &name.Relative{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Property: &expr.Variable{VarName: &node.Identifier{Value: "$bar"}},
},
},
&stmt.Expression{
Expr: &expr.StaticPropertyFetch{
Class: &name.FullyQualified{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Property: &expr.Variable{VarName: &node.Identifier{Value: "$bar"}},
},
},
&stmt.Expression{
Expr: &expr.Ternary{
Condition: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
},
},
&stmt.Expression{
Expr: &expr.Ternary{
Condition: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
},
},
&stmt.Expression{
Expr: &expr.Ternary{
Condition: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
IfTrue: &expr.Ternary{
Condition: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "$d"}},
},
IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "$e"}},
},
},
&stmt.Expression{
Expr: &expr.Ternary{
Condition: &expr.Ternary{
Condition: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
},
IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "$d"}},
IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "$e"}},
},
},
&stmt.Expression{
Expr: &expr.UnaryMinus{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.UnaryPlus{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}},
},
2018-02-14 19:02:57 +00:00
&stmt.Expression{
Expr: &expr.Variable{VarName: &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}}},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &expr.Yield{},
},
&stmt.Expression{
Expr: &expr.Yield{
Value: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &expr.Yield{
Key: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Value: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
2018-02-13 15:42:00 +00:00
&stmt.Expression{
Expr: &expr.Yield{
2018-02-14 15:28:20 +00:00
Value: &expr.ClassConstFetch{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
ConstantName: &node.Identifier{Value: "class"},
},
2018-02-13 15:42:00 +00:00
},
},
&stmt.Expression{
Expr: &expr.Yield{
2018-02-14 19:02:57 +00:00
Key: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 15:28:20 +00:00
Value: &expr.ClassConstFetch{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
ConstantName: &node.Identifier{Value: "class"},
},
2018-02-13 15:42:00 +00:00
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
Expr: &cast.CastArray{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &cast.CastBool{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &cast.CastBool{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &cast.CastDouble{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &cast.CastDouble{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &cast.CastInt{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &cast.CastInt{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &cast.CastObject{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &cast.CastString{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
Expr: &cast.CastUnset{
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.BitwiseAnd{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.BitwiseOr{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.BitwiseXor{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.BooleanAnd{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.BooleanOr{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Concat{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Div{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Equal{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.GreaterOrEqual{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Greater{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Identical{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.LogicalAnd{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.LogicalOr{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.LogicalXor{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Minus{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Mod{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Mul{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.NotEqual{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.NotIdentical{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Plus{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Pow{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.ShiftLeft{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.ShiftRight{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.SmallerOrEqual{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &binary.Smaller{
2018-02-10 22:11:56 +00:00
Left: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Right: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.AssignRef{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
2018-02-13 11:38:57 +00:00
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.AssignRef{
2018-02-14 19:02:57 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-13 11:38:57 +00:00
Expression: &expr.New{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.AssignRef{
2018-02-14 19:02:57 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-13 11:38:57 +00:00
Expression: &expr.New{
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Arguments: []node.Node{
&node.Argument{
2018-02-14 19:02:57 +00:00
Variadic: false,
2018-02-13 11:38:57 +00:00
IsReference: false,
2018-02-14 19:02:57 +00:00
Expr: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
2018-02-13 11:38:57 +00:00
},
},
},
},
},
2018-02-10 22:11:56 +00:00
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Assign{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.BitwiseAnd{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.BitwiseOr{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.BitwiseXor{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Concat{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Div{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Minus{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Mod{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Mul{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Plus{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.Pow{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.ShiftLeft{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
2018-02-19 11:12:09 +00:00
Expr: &assign.ShiftRight{
2018-02-10 22:11:56 +00:00
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expression: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
2018-02-13 11:15:28 +00:00
&stmt.Expression{
Expr: &expr.New{
Class: &name.FullyQualified{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Arguments: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.PropertyFetch{
Variable: &expr.MethodCall{
Variable: &expr.New{
Class: &name.FullyQualified{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Arguments: []node.Node{},
},
2018-02-14 19:02:57 +00:00
Method: &node.Identifier{Value: "bar"},
2018-02-13 11:15:28 +00:00
Arguments: []node.Node{},
},
Property: &node.Identifier{Value: "baz"},
},
},
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &expr.ArrayDimFetch{
Variable: &expr.New{
Class: &name.FullyQualified{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Arguments: []node.Node{},
},
Dim: &scalar.Lnumber{Value: "0"},
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
&stmt.Expression{
Expr: &expr.MethodCall{
Variable: &expr.ArrayDimFetch{
Variable: &expr.New{
Class: &name.FullyQualified{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
Arguments: []node.Node{},
},
Dim: &scalar.Lnumber{Value: "0"},
},
2018-02-14 19:02:57 +00:00
Method: &node.Identifier{Value: "bar"},
2018-02-13 11:15:28 +00:00
Arguments: []node.Node{},
},
},
2018-02-13 12:58:10 +00:00
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &expr.ArrayDimFetch{
Variable: &expr.Array{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
Val: &expr.ShortArray{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
2018-02-14 19:02:57 +00:00
Val: &scalar.Lnumber{Value: "0"},
2018-02-13 12:58:10 +00:00
},
},
},
},
},
},
Dim: &scalar.Lnumber{Value: "0"},
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &scalar.String{Value: "\"foo\""},
2018-02-14 19:02:57 +00:00
Dim: &scalar.Lnumber{Value: "0"},
2018-02-13 12:58:10 +00:00
},
},
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &expr.ConstFetch{
Constant: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "foo"},
},
},
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
2018-02-13 17:38:37 +00:00
&stmt.Expression{
Expr: &expr.ClassConstFetch{
2018-02-14 19:02:57 +00:00
Class: &node.Identifier{Value: "static"},
2018-02-13 17:38:37 +00:00
ConstantName: &node.Identifier{Value: "foo"},
},
},
2018-02-14 10:14:08 +00:00
&stmt.Expression{
Expr: &expr.New{
Class: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
},
},
2018-02-14 19:02:57 +00:00
&stmt.Expression{
Expr: &expr.New{
Class: &expr.StaticPropertyFetch{
Class: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Property: &expr.Variable{VarName: &node.Identifier{Value: "$bar"}},
},
},
},
2018-02-14 10:14:08 +00:00
&stmt.Expression{
Expr: &expr.New{
Class: &expr.ArrayDimFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Property: &node.Identifier{Value: "b"},
2018-02-14 10:14:08 +00:00
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
},
&stmt.Expression{
Expr: &expr.New{
Class: &expr.ArrayDimFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.ArrayDimFetch{
Variable: &expr.PropertyFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Property: &node.Identifier{Value: "b"},
},
Dim: &expr.Ternary{
Condition: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
IfFalse: &expr.ConstFetch{
Constant: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "null"},
},
},
},
},
},
2018-02-14 19:02:57 +00:00
Property: &expr.Variable{VarName: &node.Identifier{Value: "$c"}},
2018-02-14 10:14:08 +00:00
},
2018-02-14 19:02:57 +00:00
Property: &node.Identifier{Value: "d"},
2018-02-14 10:14:08 +00:00
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
},
2018-02-14 14:23:10 +00:00
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.ArrayDimFetch{
Variable: &expr.ShortArray{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
2018-02-14 19:02:57 +00:00
Val: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
},
},
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.BooleanNot{
Expr: &scalar.Lnumber{Value: "1"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.BitwiseNot{
Expr: &scalar.Lnumber{Value: "1"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.UnaryPlus{
Expr: &scalar.Lnumber{Value: "1"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.UnaryMinus{
Expr: &scalar.Lnumber{Value: "1"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &expr.Ternary{
2018-02-14 14:23:10 +00:00
Condition: &scalar.Lnumber{Value: "1"},
2018-02-14 19:02:57 +00:00
IfFalse: &scalar.Lnumber{Value: "2"},
2018-02-14 14:23:10 +00:00
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &expr.Ternary{
2018-02-14 14:23:10 +00:00
Condition: &scalar.Lnumber{Value: "1"},
2018-02-14 19:02:57 +00:00
IfTrue: &scalar.Lnumber{Value: "2"},
IfFalse: &scalar.Lnumber{Value: "3"},
2018-02-14 14:23:10 +00:00
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.BitwiseAnd{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.BitwiseOr{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.BitwiseXor{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.BooleanAnd{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.BooleanOr{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Concat{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Div{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Equal{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.GreaterOrEqual{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Greater{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Identical{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.LogicalAnd{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.LogicalOr{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.LogicalXor{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Minus{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Mod{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Mul{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.NotEqual{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.NotIdentical{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Plus{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Pow{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.ShiftLeft{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.ShiftRight{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.SmallerOrEqual{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-19 11:12:09 +00:00
Expr: &binary.Smaller{
2018-02-14 19:02:57 +00:00
Left: &scalar.Lnumber{Value: "1"},
2018-02-14 14:23:10 +00:00
Right: &scalar.Lnumber{Value: "2"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &expr.ClassConstFetch{
2018-02-14 14:23:10 +00:00
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
ConstantName: &node.Identifier{Value: "bar"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &expr.ClassConstFetch{
2018-02-14 14:23:10 +00:00
Class: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
ConstantName: &node.Identifier{Value: "class"},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &scalar.MagicConstant{Value: "__CLASS__"},
2018-02-14 14:23:10 +00:00
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &expr.ConstFetch{
2018-02-14 14:23:10 +00:00
Constant: &name.Name{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &expr.ConstFetch{
2018-02-14 14:23:10 +00:00
Constant: &name.Relative{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &expr.ConstFetch{
2018-02-14 14:23:10 +00:00
Constant: &name.FullyQualified{
Parts: []node.Node{
&name.NamePart{Value: "Foo"},
},
},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &expr.Array{},
2018-02-14 14:23:10 +00:00
},
},
},
2018-02-14 15:28:20 +00:00
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
2018-02-14 19:02:57 +00:00
Expr: &expr.Array{
2018-02-14 15:28:20 +00:00
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
2018-02-14 19:02:57 +00:00
Key: &scalar.Lnumber{Value: "1"},
Val: &scalar.Lnumber{Value: "1"},
2018-02-14 15:28:20 +00:00
},
&expr.ArrayItem{
ByRef: false,
2018-02-14 19:02:57 +00:00
Val: &scalar.Lnumber{Value: "2"},
2018-02-14 15:28:20 +00:00
},
},
},
},
},
},
&stmt.Static{
Vars: []node.Node{
&stmt.StaticVar{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Expr: &expr.ArrayDimFetch{
Variable: &expr.ShortArray{
Items: []node.Node{
&expr.ArrayItem{
ByRef: false,
2018-02-14 19:02:57 +00:00
Val: &scalar.Lnumber{Value: "1"},
2018-02-14 15:28:20 +00:00
},
&expr.ArrayItem{
ByRef: false,
2018-02-14 19:02:57 +00:00
Key: &scalar.Lnumber{Value: "2"},
Val: &scalar.Lnumber{Value: "2"},
2018-02-14 15:28:20 +00:00
},
},
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
},
},
2018-02-14 19:02:57 +00:00
&stmt.If{
Cond: &expr.Yield{
Value: &scalar.Lnumber{Value: "1"},
},
Stmt: &stmt.StmtList{
Stmts: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.StaticPropertyFetch{
Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}},
Property: &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "$bar"}}},
},
},
&stmt.Expression{
Expr: &expr.FunctionCall{
Function: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Arguments: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &expr.ArrayDimFetch{
Variable: &expr.FunctionCall{
Function: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Arguments: []node.Node{},
},
Dim: &scalar.Lnumber{Value: "0"},
},
Dim: &scalar.Lnumber{Value: "0"},
},
},
&stmt.Expression{
Expr: &expr.ArrayDimFetch{
Variable: &expr.Variable{VarName: &node.Identifier{Value: "$a"}},
Dim: &expr.Variable{VarName: &node.Identifier{Value: "$b"}},
},
},
&stmt.Expression{
Expr: &expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "$a"}}},
},
&stmt.Expression{
Expr: &expr.StaticCall{
Class: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
Call: &expr.Variable{VarName: &node.Identifier{Value: "$bar"}},
Arguments: []node.Node{},
},
},
&stmt.Expression{
Expr: &expr.ClassConstFetch{
2018-02-14 19:21:32 +00:00
Class: &expr.Variable{VarName: &node.Identifier{Value: "$foo"}},
2018-02-14 19:02:57 +00:00
ConstantName: &node.Identifier{Value: "bar"},
},
},
2018-02-10 22:11:56 +00:00
},
}
actual, _, _ := php5.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual)
}