Represent names using string rather than array of parts

In most circumstances we are interested in the whole string, not
the parts split by namespace separator. As names are common, this
representation measurably improves memory usage and performance.
This commit is contained in:
Nikita Popov 2023-05-21 21:14:50 +02:00
parent df3a7057ab
commit 23647573e8
86 changed files with 423 additions and 1198 deletions

View File

@ -5,11 +5,8 @@ namespace PhpParser\Node;
use PhpParser\NodeAbstract;
class Name extends NodeAbstract {
/**
* @var string[] Parts of the name
* @deprecated Use getParts() instead
*/
public $parts;
/** @var string Name as string */
public $name;
/** @var array<string, bool> */
private static $specialClassNames = [
@ -26,11 +23,11 @@ class Name extends NodeAbstract {
*/
final public function __construct($name, array $attributes = []) {
$this->attributes = $attributes;
$this->parts = self::prepareName($name);
$this->name = self::prepareName($name);
}
public function getSubNodeNames(): array {
return ['parts'];
return ['name'];
}
/**
@ -39,7 +36,7 @@ class Name extends NodeAbstract {
* @return string[] Parts of name
*/
public function getParts(): array {
return $this->parts;
return \explode('\\', $this->name);
}
/**
@ -48,7 +45,10 @@ class Name extends NodeAbstract {
* @return string First part of the name
*/
public function getFirst(): string {
return $this->parts[0];
if (false !== $pos = \strpos($this->name, '\\')) {
return \substr($this->name, 0, $pos);
}
return $this->name;
}
/**
@ -57,7 +57,10 @@ class Name extends NodeAbstract {
* @return string Last part of the name
*/
public function getLast(): string {
return $this->parts[count($this->parts) - 1];
if (false !== $pos = \strrpos($this->name, '\\')) {
return \substr($this->name, $pos + 1);
}
return $this->name;
}
/**
@ -66,7 +69,7 @@ class Name extends NodeAbstract {
* @return bool Whether the name is unqualified
*/
public function isUnqualified(): bool {
return 1 === count($this->parts);
return false === \strpos($this->name, '\\');
}
/**
@ -75,7 +78,7 @@ class Name extends NodeAbstract {
* @return bool Whether the name is qualified
*/
public function isQualified(): bool {
return 1 < count($this->parts);
return false !== \strpos($this->name, '\\');
}
/**
@ -103,7 +106,7 @@ class Name extends NodeAbstract {
* @return string String representation
*/
public function toString(): string {
return implode('\\', $this->parts);
return $this->name;
}
/**
@ -123,7 +126,7 @@ class Name extends NodeAbstract {
* @return string Lowercased string representation
*/
public function toLowerString(): string {
return strtolower(implode('\\', $this->parts));
return strtolower($this->name);
}
/**
@ -132,8 +135,7 @@ class Name extends NodeAbstract {
* @return bool Whether identifier is a special class name
*/
public function isSpecialClassName(): bool {
return count($this->parts) === 1
&& isset(self::$specialClassNames[strtolower($this->parts[0])]);
return isset(self::$specialClassNames[strtolower($this->name)]);
}
/**
@ -143,7 +145,7 @@ class Name extends NodeAbstract {
* @return string String representation
*/
public function __toString(): string {
return implode('\\', $this->parts);
return $this->name;
}
/**
@ -163,7 +165,16 @@ class Name extends NodeAbstract {
* @return static|null Sliced name
*/
public function slice(int $offset, ?int $length = null) {
$numParts = count($this->parts);
if ($offset === 1 && $length === null) {
// Short-circuit the common case.
if (false !== $pos = \strpos($this->name, '\\')) {
return new static(\substr($this->name, $pos + 1));
}
return null;
}
$parts = \explode('\\', $this->name);
$numParts = \count($parts);
$realOffset = $offset < 0 ? $offset + $numParts : $offset;
if ($realOffset < 0 || $realOffset > $numParts) {
@ -184,7 +195,7 @@ class Name extends NodeAbstract {
return null;
}
return new static(array_slice($this->parts, $realOffset, $realLength), $this->attributes);
return new static(array_slice($parts, $realOffset, $realLength), $this->attributes);
}
/**
@ -209,42 +220,42 @@ class Name extends NodeAbstract {
return null;
}
if (null === $name1) {
return new static(self::prepareName($name2), $attributes);
return new static($name2, $attributes);
}
if (null === $name2) {
return new static(self::prepareName($name1), $attributes);
return new static($name1, $attributes);
} else {
return new static(
array_merge(self::prepareName($name1), self::prepareName($name2)), $attributes
self::prepareName($name1) . '\\' . self::prepareName($name2), $attributes
);
}
}
/**
* Prepares a (string, array or Name node) name for use in name changing methods by converting
* it to an array.
* it to a string.
*
* @param string|string[]|self $name Name to prepare
*
* @return string[] Prepared name
* @return string Prepared name
*/
private static function prepareName($name): array {
private static function prepareName($name): string {
if (\is_string($name)) {
if ('' === $name) {
throw new \InvalidArgumentException('Name cannot be empty');
}
return explode('\\', $name);
return $name;
}
if (\is_array($name)) {
if (empty($name)) {
throw new \InvalidArgumentException('Name cannot be empty');
}
return $name;
return implode('\\', $name);
}
if ($name instanceof self) {
return $name->parts;
return $name->name;
}
throw new \InvalidArgumentException(

View File

@ -80,15 +80,15 @@ class Standard extends PrettyPrinterAbstract {
// Names
protected function pName(Name $node): string {
return implode('\\', $node->parts);
return $node->name;
}
protected function pName_FullyQualified(Name\FullyQualified $node): string {
return '\\' . implode('\\', $node->parts);
return '\\' . $node->name;
}
protected function pName_Relative(Name\Relative $node): string {
return 'namespace\\' . implode('\\', $node->parts);
return 'namespace\\' . $node->name;
}
// Magic Constants

View File

@ -5,13 +5,13 @@ namespace PhpParser\Node;
class NameTest extends \PHPUnit\Framework\TestCase {
public function testConstruct() {
$name = new Name(['foo', 'bar']);
$this->assertSame(['foo', 'bar'], $name->parts);
$this->assertSame('foo\bar', $name->name);
$name = new Name('foo\bar');
$this->assertSame(['foo', 'bar'], $name->parts);
$this->assertSame('foo\bar', $name->name);
$name = new Name($name);
$this->assertSame(['foo', 'bar'], $name->parts);
$this->assertSame('foo\bar', $name->name);
}
public function testGet() {

View File

@ -34,10 +34,7 @@ class NodeDumperTest extends \PHPUnit\Framework\TestCase {
[
new Node\Name(['Hallo', 'World']),
'Name(
parts: array(
0: Hallo
1: World
)
name: Hallo\World
)'
],
[

View File

@ -460,7 +460,7 @@ EOC;
$stmt = $stmts[0];
$assign = $stmt->stmts[1]->expr;
$this->assertSame(['Bar', 'Baz'], $assign->expr->class->parts);
$this->assertSame('Bar\\Baz', $assign->expr->class->name);
}
public function testSpecialClassNamesAreCaseInsensitive() {

View File

@ -141,7 +141,7 @@ function test() {
namespace
Foo;
-----
$stmts[0]->name->parts[0] = 'Xyz';
$stmts[0]->name->name = 'Xyz';
-----
<?php
namespace

View File

@ -7,9 +7,7 @@ array(
0: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: foo
)
name: foo
)
)
)
@ -22,9 +20,7 @@ array(
0: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: foo
)
name: foo
)
)
)

View File

@ -13,9 +13,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
name: foo
)
args: array(
)
@ -24,9 +22,7 @@ array(
1: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: bar
)
name: bar
)
args: array(
)
@ -35,9 +31,7 @@ array(
2: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: baz
)
name: baz
)
args: array(
)
@ -56,9 +50,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
name: foo
)
args: array(
)
@ -67,9 +59,7 @@ array(
1: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: bar
)
name: bar
)
args: array(
)
@ -78,9 +68,7 @@ array(
2: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: baz
)
name: baz
)
args: array(
)
@ -99,9 +87,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
name: foo
)
args: array(
)
@ -110,9 +96,7 @@ array(
1: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: bar
)
name: bar
)
args: array(
)
@ -121,9 +105,7 @@ array(
2: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: baz
)
name: baz
)
args: array(
)
@ -140,9 +122,7 @@ array(
0: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: abc
)
name: abc
)
)
)
@ -339,9 +319,7 @@ array(
0: Stmt_Expression(
expr: Expr_New(
class: Name(
parts: array(
0: T
)
name: T
)
args: array(
)
@ -402,9 +380,7 @@ array(
0: Stmt_Expression(
expr: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
name: Expr_Error(
)
@ -420,9 +396,7 @@ array(
0: Stmt_Expression(
expr: Expr_ClassConstFetch(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
name: Expr_Error(
)
@ -455,9 +429,7 @@ Syntax error, unexpected T_THROW, expecting ';' from 15:1 to 15:5
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: Foo
)
name: Foo
)
stmts: array(
0: Stmt_Use(
@ -466,9 +438,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: A
)
name: A
)
alias: null
)
@ -480,9 +450,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: a
)
name: a
)
alias: null
)
@ -491,17 +459,13 @@ array(
2: Stmt_GroupUse(
type: TYPE_UNKNOWN (0)
prefix: Name(
parts: array(
0: A
)
name: A
)
uses: array(
0: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: B
)
name: B
)
alias: null
)
@ -619,17 +583,13 @@ array(
0: Stmt_GroupUse(
type: TYPE_UNKNOWN (0)
prefix: Name(
parts: array(
0: A
)
name: A
)
uses: array(
0: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: B
)
name: B
)
alias: null
)
@ -638,17 +598,13 @@ array(
1: Stmt_GroupUse(
type: TYPE_FUNCTION (2)
prefix: Name(
parts: array(
0: A
)
name: A
)
uses: array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: b
)
name: b
)
alias: null
)
@ -660,9 +616,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: A
)
name: A
)
alias: null
)
@ -690,18 +644,14 @@ array(
extends: null
implements: array(
0: Name(
parts: array(
0: Y
)
name: Y
)
)
stmts: array(
0: Stmt_TraitUse(
traits: array(
0: Name(
parts: array(
0: A
)
name: A
)
)
adaptations: array(
@ -710,26 +660,20 @@ array(
1: Stmt_TraitUse(
traits: array(
0: Name(
parts: array(
0: A
)
name: A
)
)
adaptations: array(
0: Stmt_TraitUseAdaptation_Precedence(
trait: Name(
parts: array(
0: A
)
name: A
)
method: Identifier(
name: b
)
insteadof: array(
0: Name(
parts: array(
0: C
)
name: C
)
)
)
@ -775,9 +719,7 @@ array(
)
extends: array(
0: Name(
parts: array(
0: J
)
name: J
)
)
stmts: array(
@ -867,18 +809,14 @@ array(
0: Stmt_Expression[3:1 - 3:11](
expr: Expr_FuncCall[3:1 - 3:10](
name: Name[3:1 - 3:3](
parts: array(
0: foo
)
name: foo
)
args: array(
0: Arg[3:5 - 3:9](
name: null
value: Expr_ClassConstFetch[3:5 - 3:9](
class: Name[3:5 - 3:7](
parts: array(
0: Bar
)
name: Bar
)
name: Expr_Error[3:10 - 3:9](
)
@ -1018,9 +956,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: Type
)
name: Type
)
byRef: false
variadic: false
@ -1051,9 +987,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: Type1
)
name: Type1
)
byRef: false
variadic: false
@ -1067,9 +1001,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: Type2
)
name: Type2
)
byRef: false
variadic: false
@ -1158,9 +1090,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: Bar
)
name: Bar
)
byRef: false
variadic: false
@ -1198,9 +1128,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: Baz
)
name: Baz
)
byRef: false
variadic: false
@ -1227,9 +1155,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: Foo
)
name: Foo
)
byRef: false
variadic: false

View File

@ -220,9 +220,7 @@ array(
key: null
value: Expr_FuncCall(
name: Name(
parts: array(
0: getArr
)
name: getArr
)
args: array(
)
@ -240,9 +238,7 @@ array(
key: null
value: Expr_FuncCall(
name: Name(
parts: array(
0: arrGen
)
name: arrGen
)
args: array(
)
@ -260,9 +256,7 @@ array(
key: null
value: Expr_New(
class: Name(
parts: array(
0: ArrayIterator
)
name: ArrayIterator
)
args: array(
0: Arg(
@ -329,9 +323,7 @@ array(
key: null
value: Expr_FuncCall(
name: Name(
parts: array(
0: getArr
)
name: getArr
)
args: array(
)
@ -383,9 +375,7 @@ array(
key: null
value: Expr_FuncCall(
name: Name(
parts: array(
0: arrGen
)
name: arrGen
)
args: array(
)

View File

@ -12,9 +12,7 @@ array(
)
expr: Expr_New(
class: Name(
parts: array(
0: B
)
name: B
)
args: array(
)
@ -36,9 +34,7 @@ array(
)
expr: Expr_New(
class: Name(
parts: array(
0: B
)
name: B
)
args: array(
)

View File

@ -190,10 +190,7 @@ array(
)
)
returnType: Name_FullyQualified(
parts: array(
0: Foo
1: Bar
)
name: Foo\Bar
)
stmts: array(
)

View File

@ -110,9 +110,7 @@ array(
name: a
)
class: Name(
parts: array(
0: B
)
name: B
)
)
)

View File

@ -682,9 +682,7 @@ array(
value: Expr_BooleanNot(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: false
)
name: false
)
)
)

View File

@ -8,15 +8,11 @@ array(
0: Stmt_Expression(
expr: Expr_ClassConstFetch(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
name: Expr_FuncCall(
name: Name(
parts: array(
0: bar
)
name: bar
)
args: array(
)
@ -30,9 +26,7 @@ array(
)
name: Expr_FuncCall(
name: Name(
parts: array(
0: bar
)
name: bar
)
args: array(
)

View File

@ -12,9 +12,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: f
)
name: f
)
args: array(
)
@ -23,9 +21,7 @@ array(
1: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: f
)
name: f
)
args: array(
0: Arg(
@ -42,9 +38,7 @@ array(
2: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: f
)
name: f
)
args: array(
0: Arg(
@ -69,9 +63,7 @@ array(
3: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: f
)
name: f
)
args: array(
0: Arg(
@ -88,9 +80,7 @@ array(
4: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: f
)
name: f
)
args: array(
0: Arg(

View File

@ -12,18 +12,14 @@ array(
0: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: A
)
name: A
)
)
)
1: Stmt_Expression(
expr: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: B
@ -33,9 +29,7 @@ array(
2: Stmt_Expression(
expr: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: class

View File

@ -210,9 +210,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_ConstFetch(
name: Name(
parts: array(
0: FOO
)
name: FOO
)
)
dim: Scalar_Int(
@ -224,9 +222,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_ClassConstFetch(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
name: Identifier(
name: BAR

View File

@ -19,9 +19,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: a
)
name: a
comments: array(
0: // function name variations
)
@ -131,9 +129,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_FuncCall(
name: Name(
parts: array(
0: a
)
name: a
comments: array(
0: // array dereferencing
)

View File

@ -8,9 +8,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
name: foo
)
args: array(
0: Arg(
@ -39,9 +37,7 @@ array(
1: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: bar
)
name: bar
)
args: array(
0: Arg(

View File

@ -12,9 +12,7 @@ array(
expr: Expr_PropertyFetch(
var: Expr_New(
class: Name(
parts: array(
0: A
)
name: A
)
args: array(
)
@ -28,9 +26,7 @@ array(
expr: Expr_MethodCall(
var: Expr_New(
class: Name(
parts: array(
0: A
)
name: A
)
args: array(
)
@ -46,9 +42,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_New(
class: Name(
parts: array(
0: A
)
name: A
)
args: array(
)
@ -63,9 +57,7 @@ array(
var: Expr_ArrayDimFetch(
var: Expr_New(
class: Name(
parts: array(
0: A
)
name: A
)
args: array(
)

View File

@ -22,9 +22,7 @@ array(
0: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
name: A
comments: array(
0: // method name variations
)
@ -45,9 +43,7 @@ array(
1: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
name: A
)
name: Scalar_String(
value: b
@ -59,9 +55,7 @@ array(
2: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
name: A
)
name: Expr_Variable(
name: b
@ -75,9 +69,7 @@ array(
name: Expr_ArrayDimFetch(
var: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: VarLikeIdentifier(
name: b
@ -97,9 +89,7 @@ array(
var: Expr_ArrayDimFetch(
var: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: VarLikeIdentifier(
name: b
@ -121,9 +111,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
name: A
comments: array(
0: // array dereferencing
)
@ -151,9 +139,7 @@ array(
6: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: static
)
name: static
comments: array(
0: // class name variations
)

View File

@ -17,9 +17,7 @@ array(
0: Stmt_Expression(
expr: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
comments: array(
0: // property name variations
)
@ -38,9 +36,7 @@ array(
1: Stmt_Expression(
expr: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Expr_Variable(
name: b
@ -50,9 +46,7 @@ array(
2: Stmt_Expression(
expr: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Scalar_String(
value: b
@ -63,9 +57,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
comments: array(
0: // array access
)
@ -92,9 +84,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: VarLikeIdentifier(
name: b

View File

@ -16,9 +16,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
name: foo
)
args: array(
0: VariadicPlaceholder(
@ -43,9 +41,7 @@ array(
2: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: foo
@ -59,9 +55,7 @@ array(
3: Stmt_Expression(
expr: Expr_New(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
args: array(
0: VariadicPlaceholder(
@ -95,9 +89,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: Foo
)
name: Foo
)
args: array(
0: VariadicPlaceholder(

View File

@ -44,9 +44,7 @@ array(
expr: Expr_Empty(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
name: foo
)
args: array(
)

View File

@ -14,55 +14,41 @@ private\protected\public\static\abstract\final();
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: fn
)
name: fn
)
stmts: array(
)
)
1: Stmt_Namespace(
name: Name(
parts: array(
0: fn
1: use
)
name: fn\use
)
stmts: array(
)
)
2: Stmt_Namespace(
name: Name(
parts: array(
0: self
)
name: self
)
stmts: array(
)
)
3: Stmt_Namespace(
name: Name(
parts: array(
0: parent
)
name: parent
)
stmts: array(
)
)
4: Stmt_Namespace(
name: Name(
parts: array(
0: static
)
name: static
)
stmts: array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: fn
1: use
)
name: fn\use
)
args: array(
)
@ -71,10 +57,7 @@ array(
1: Stmt_Expression(
expr: Expr_FuncCall(
name: Name_FullyQualified(
parts: array(
0: fn
1: use
)
name: fn\use
)
args: array(
)
@ -83,10 +66,7 @@ array(
2: Stmt_Expression(
expr: Expr_FuncCall(
name: Name_Relative(
parts: array(
0: fn
1: use
)
name: fn\use
)
args: array(
)
@ -95,14 +75,7 @@ array(
3: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: private
1: protected
2: public
3: static
4: abstract
5: final
)
name: private\protected\public\static\abstract\final
)
args: array(
)

View File

@ -105,9 +105,7 @@ array(
conds: array(
0: Expr_ClassConstFetch(
class: Name(
parts: array(
0: BinaryOperator
)
name: BinaryOperator
)
name: Identifier(
name: ADD

View File

@ -22,9 +22,7 @@ array(
0: Stmt_Expression(
expr: Expr_New(
class: Name(
parts: array(
0: A
)
name: A
)
args: array(
)
@ -33,9 +31,7 @@ array(
1: Stmt_Expression(
expr: Expr_New(
class: Name(
parts: array(
0: A
)
name: A
)
args: array(
0: Arg(
@ -82,9 +78,7 @@ array(
expr: Expr_New(
class: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: VarLikeIdentifier(
name: b
@ -174,9 +168,7 @@ array(
9: Stmt_Expression(
expr: Expr_New(
class: Name(
parts: array(
0: A
)
name: A
)
args: array(
)

View File

@ -8,9 +8,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: test
)
name: test
)
args: array(
0: Arg(
@ -34,9 +32,7 @@ array(
right: Expr_Throw(
expr: Expr_New(
class: Name(
parts: array(
0: Exception
)
name: Exception
)
args: array(
)

View File

@ -13,9 +13,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
name: foo
)
args: array(
0: Arg(
@ -68,9 +66,7 @@ array(
2: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
name: Identifier(
name: bar
@ -98,9 +94,7 @@ array(
3: Stmt_Expression(
expr: Expr_New(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
args: array(
0: Arg(

View File

@ -26,9 +26,7 @@ array(
expr: Expr_PropertyFetch(
var: Expr_ConstFetch(
name: Name(
parts: array(
0: A
)
name: A
)
)
name: Identifier(
@ -40,9 +38,7 @@ array(
expr: Expr_MethodCall(
var: Expr_ConstFetch(
name: Name(
parts: array(
0: A
)
name: A
)
)
name: Identifier(
@ -56,9 +52,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_ConstFetch(
name: Name(
parts: array(
0: A
)
name: A
)
)
dim: Scalar_Int(
@ -72,9 +66,7 @@ array(
var: Expr_ArrayDimFetch(
var: Expr_ConstFetch(
name: Name(
parts: array(
0: A
)
name: A
)
)
dim: Scalar_Int(
@ -94,9 +86,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_ConstFetch(
name: Name(
parts: array(
0: A
)
name: A
)
)
dim: Scalar_Int(
@ -108,9 +98,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: B
@ -127,9 +115,7 @@ array(
var: Expr_ArrayDimFetch(
var: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: B
@ -152,9 +138,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: B
@ -169,9 +153,7 @@ array(
expr: Expr_PropertyFetch(
var: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: B
@ -186,9 +168,7 @@ array(
expr: Expr_MethodCall(
var: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: B
@ -205,9 +185,7 @@ array(
expr: Expr_ClassConstFetch(
class: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: B
@ -222,9 +200,7 @@ array(
expr: Expr_StaticPropertyFetch(
class: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: B
@ -239,9 +215,7 @@ array(
expr: Expr_StaticCall(
class: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: B
@ -276,9 +250,7 @@ array(
expr: Expr_MethodCall(
var: Expr_ConstFetch(
name: Name(
parts: array(
0: __FUNCIONT__
)
name: __FUNCIONT__
)
)
name: Identifier(

View File

@ -17,9 +17,7 @@ array(
1: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: bar
)
name: bar
)
)
)

View File

@ -20,9 +20,7 @@ array(
expr: Expr_FuncCall(
name: Expr_FuncCall(
name: Name(
parts: array(
0: id
)
name: id
)
args: array(
0: Arg(
@ -52,9 +50,7 @@ array(
name: Expr_FuncCall(
name: Expr_FuncCall(
name: Name(
parts: array(
0: id
)
name: id
)
args: array(
0: Arg(
@ -96,9 +92,7 @@ array(
name: Expr_FuncCall(
name: Expr_FuncCall(
name: Name(
parts: array(
0: id
)
name: id
)
args: array(
)
@ -136,9 +130,7 @@ array(
name: Expr_ArrayDimFetch(
var: Expr_FuncCall(
name: Name(
parts: array(
0: id
)
name: id
)
args: array(
0: Arg(
@ -294,9 +286,7 @@ array(
)
default: Expr_ConstFetch(
name: Name(
parts: array(
0: null
)
name: null
)
)
)

View File

@ -65,9 +65,7 @@ array(
expr: Expr_New(
class: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: Test
)
name: Test
)
name: VarLikeIdentifier(
name: className

View File

@ -14,9 +14,7 @@ array(
0: Stmt_Expression(
expr: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: VarLikeIdentifier(
name: b
@ -76,9 +74,7 @@ array(
5: Stmt_Expression(
expr: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Expr_Variable(
name: b
@ -89,9 +85,7 @@ array(
expr: Expr_ArrayDimFetch(
var: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Expr_Variable(
name: c
@ -106,9 +100,7 @@ array(
expr: Expr_StaticPropertyFetch(
class: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: VarLikeIdentifier(
name: A

View File

@ -26,9 +26,7 @@ array(
expr: Expr_Variable(
name: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
name: foo
)
args: array(
)

View File

@ -58,9 +58,7 @@ array(
5: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: _100
)
name: _100
comments: array(
0: // already a valid constant name
)
@ -87,9 +85,7 @@ array(
7: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: _
)
name: _
)
)
)
@ -101,9 +97,7 @@ array(
9: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: __1
)
name: __1
)
)
)
@ -115,9 +109,7 @@ array(
11: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: _
)
name: _
)
)
)
@ -134,9 +126,7 @@ array(
14: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: _0
)
name: _0
)
)
)
@ -148,9 +138,7 @@ array(
16: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: x_123
)
name: x_123
)
)
)
@ -162,9 +150,7 @@ array(
18: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: b_101
)
name: b_101
)
)
)
@ -176,9 +162,7 @@ array(
20: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: _e2
)
name: _e2
)
)
)
@ -190,9 +174,7 @@ array(
22: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: e_2
)
name: e_2
)
)
)

View File

@ -258,9 +258,7 @@ array(
)
expr: Expr_New(
class: Name(
parts: array(
0: Test
)
name: Test
)
args: array(
)
@ -294,9 +292,7 @@ array(
4: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: Test
)
name: Test
)
name: Identifier(
name: list
@ -308,9 +304,7 @@ array(
5: Stmt_Expression(
expr: Expr_StaticCall(
class: Name(
parts: array(
0: Test
)
name: Test
)
name: Identifier(
name: protected
@ -342,9 +336,7 @@ array(
8: Stmt_Expression(
expr: Expr_ClassConstFetch(
class: Name(
parts: array(
0: Test
)
name: Test
)
name: Identifier(
name: TRAIT
@ -354,9 +346,7 @@ array(
9: Stmt_Expression(
expr: Expr_ClassConstFetch(
class: Name(
parts: array(
0: Test
)
name: Test
)
name: Identifier(
name: FINAL
@ -377,39 +367,29 @@ array(
0: Stmt_TraitUse(
traits: array(
0: Name(
parts: array(
0: TraitA
)
name: TraitA
)
1: Name(
parts: array(
0: TraitB
)
name: TraitB
)
)
adaptations: array(
0: Stmt_TraitUseAdaptation_Precedence(
trait: Name(
parts: array(
0: TraitA
)
name: TraitA
)
method: Identifier(
name: catch
)
insteadof: array(
0: Name_Relative(
parts: array(
0: TraitB
)
name: TraitB
)
)
)
1: Stmt_TraitUseAdaptation_Alias(
trait: Name(
parts: array(
0: TraitA
)
name: TraitA
)
method: Identifier(
name: list
@ -421,9 +401,7 @@ array(
)
2: Stmt_TraitUseAdaptation_Alias(
trait: Name(
parts: array(
0: TraitB
)
name: TraitB
)
method: Identifier(
name: throw
@ -435,9 +413,7 @@ array(
)
3: Stmt_TraitUseAdaptation_Alias(
trait: Name(
parts: array(
0: TraitB
)
name: TraitB
)
method: Identifier(
name: self
@ -457,9 +433,7 @@ array(
)
5: Stmt_TraitUseAdaptation_Alias(
trait: Name_FullyQualified(
parts: array(
0: TraitC
)
name: TraitC
)
method: Identifier(
name: exit
@ -471,9 +445,7 @@ array(
)
6: Stmt_TraitUseAdaptation_Alias(
trait: Name_Relative(
parts: array(
0: TraitC
)
name: TraitC
)
method: Identifier(
name: exit
@ -485,9 +457,7 @@ array(
)
7: Stmt_TraitUseAdaptation_Precedence(
trait: Name(
parts: array(
0: TraitA
)
name: TraitA
)
method: Identifier(
name: catch
@ -499,9 +469,7 @@ array(
)
insteadof: array(
0: Name(
parts: array(
0: TraitB
)
name: TraitB
)
)
)

View File

@ -38,27 +38,21 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A1
)
name: A1
)
args: array(
)
)
1: Attribute(
name: Name(
parts: array(
0: A2
)
name: A2
)
args: array(
)
)
2: Attribute(
name: Name(
parts: array(
0: A3
)
name: A3
)
args: array(
0: Arg(
@ -73,9 +67,7 @@ array(
)
3: Attribute(
name: Name(
parts: array(
0: A4
)
name: A4
)
args: array(
0: Arg(
@ -109,9 +101,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A5
)
name: A5
)
args: array(
)
@ -133,9 +123,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A6
)
name: A6
)
args: array(
)
@ -155,9 +143,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A7
)
name: A7
)
args: array(
)
@ -185,9 +171,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A14
)
name: A14
)
args: array(
)
@ -214,9 +198,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A8
)
name: A8
)
args: array(
)
@ -238,9 +220,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A9
)
name: A9
)
args: array(
)
@ -265,9 +245,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A10
)
name: A10
)
args: array(
)
@ -298,9 +276,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A11
)
name: A11
)
args: array(
)
@ -330,9 +306,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A12
)
name: A12
)
args: array(
)
@ -363,9 +337,7 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: A13
)
name: A13
)
args: array(
)

View File

@ -61,20 +61,14 @@ array(
flags: 0
name: null
extends: Name(
parts: array(
0: A
)
name: A
)
implements: array(
0: Name(
parts: array(
0: B
)
name: B
)
1: Name(
parts: array(
0: C
)
name: C
)
)
stmts: array(
@ -123,9 +117,7 @@ array(
flags: 0
name: null
extends: Name(
parts: array(
0: A
)
name: A
)
implements: array(
)
@ -133,9 +125,7 @@ array(
0: Stmt_TraitUse(
traits: array(
0: Name(
parts: array(
0: T
)
name: T
)
)
adaptations: array(
@ -194,9 +184,7 @@ array(
flags: 0
name: null
extends: Name(
parts: array(
0: A
)
name: A
)
implements: array(
)

View File

@ -10,9 +10,7 @@ array(
0: Stmt_If(
cond: Expr_ConstFetch(
name: Name(
parts: array(
0: true
)
name: true
)
)
stmts: array(

View File

@ -41,14 +41,10 @@ array(
scalarType: null
implements: array(
0: Name(
parts: array(
0: Bar
)
name: Bar
)
1: Name(
parts: array(
0: Baz
)
name: Baz
)
)
stmts: array(
@ -65,9 +61,7 @@ array(
)
implements: array(
0: Name(
parts: array(
0: Bar
)
name: Bar
)
)
stmts: array(

View File

@ -15,14 +15,10 @@ array(
)
extends: array(
0: Name(
parts: array(
0: C
)
name: C
)
1: Name(
parts: array(
0: D
)
name: D
)
)
stmts: array(

View File

@ -56,9 +56,7 @@ array(
name: A
)
extends: Name(
parts: array(
0: self
)
name: self
)
implements: array(
)
@ -79,9 +77,7 @@ array(
name: A
)
extends: Name(
parts: array(
0: PARENT
)
name: PARENT
)
implements: array(
)
@ -102,9 +98,7 @@ array(
name: A
)
extends: Name(
parts: array(
0: static
)
name: static
)
implements: array(
)
@ -127,9 +121,7 @@ array(
extends: null
implements: array(
0: Name(
parts: array(
0: self
)
name: self
)
)
stmts: array(
@ -151,9 +143,7 @@ array(
extends: null
implements: array(
0: Name(
parts: array(
0: PARENT
)
name: PARENT
)
)
stmts: array(
@ -175,9 +165,7 @@ array(
extends: null
implements: array(
0: Name(
parts: array(
0: static
)
name: static
)
)
stmts: array(
@ -237,9 +225,7 @@ array(
)
extends: array(
0: Name(
parts: array(
0: self
)
name: self
)
)
stmts: array(
@ -259,9 +245,7 @@ array(
)
extends: array(
0: Name(
parts: array(
0: PARENT
)
name: PARENT
)
)
stmts: array(
@ -281,9 +265,7 @@ array(
)
extends: array(
0: Name(
parts: array(
0: static
)
name: static
)
)
stmts: array(

View File

@ -42,9 +42,7 @@ array(
)
flags: PROTECTED | STATIC (10)
type: Name(
parts: array(
0: D
)
name: D
)
props: array(
0: PropertyItem(

View File

@ -23,9 +23,7 @@ array(
0: Stmt_TraitUse(
traits: array(
0: Name(
parts: array(
0: T
)
name: T
)
)
adaptations: array(

View File

@ -25,20 +25,14 @@ array(
name: A
)
extends: Name(
parts: array(
0: B
)
name: B
)
implements: array(
0: Name(
parts: array(
0: C
)
name: C
)
1: Name(
parts: array(
0: D
)
name: D
)
)
stmts: array(
@ -169,9 +163,7 @@ array(
params: array(
)
returnType: Name(
parts: array(
0: B
)
name: B
)
stmts: array(
)

View File

@ -28,9 +28,7 @@ array(
params: array(
)
returnType: Name(
parts: array(
0: static
)
name: static
)
stmts: array(
)

View File

@ -59,9 +59,7 @@ array(
0: Stmt_TraitUse(
traits: array(
0: Name(
parts: array(
0: C
)
name: C
)
)
adaptations: array(
@ -70,9 +68,7 @@ array(
1: Stmt_TraitUse(
traits: array(
0: Name(
parts: array(
0: D
)
name: D
)
)
adaptations: array(
@ -109,49 +105,35 @@ array(
2: Stmt_TraitUse(
traits: array(
0: Name(
parts: array(
0: E
)
name: E
)
1: Name(
parts: array(
0: F
)
name: F
)
2: Name(
parts: array(
0: G
)
name: G
)
)
adaptations: array(
0: Stmt_TraitUseAdaptation_Precedence(
trait: Name(
parts: array(
0: E
)
name: E
)
method: Identifier(
name: a
)
insteadof: array(
0: Name(
parts: array(
0: F
)
name: F
)
1: Name(
parts: array(
0: G
)
name: G
)
)
)
1: Stmt_TraitUseAdaptation_Alias(
trait: Name(
parts: array(
0: E
)
name: E
)
method: Identifier(
name: b
@ -163,9 +145,7 @@ array(
)
2: Stmt_TraitUseAdaptation_Alias(
trait: Name(
parts: array(
0: E
)
name: E
)
method: Identifier(
name: d
@ -177,9 +157,7 @@ array(
)
3: Stmt_TraitUseAdaptation_Alias(
trait: Name(
parts: array(
0: E
)
name: E
)
method: Identifier(
name: f

View File

@ -90,14 +90,10 @@ array(
type: UnionType(
types: array(
0: Name(
parts: array(
0: Foo
)
name: Foo
)
1: Name(
parts: array(
0: Bar
)
name: Bar
)
2: Identifier(
name: null
@ -111,9 +107,7 @@ array(
)
value: Expr_ConstFetch(
name: Name(
parts: array(
0: null
)
name: null
)
)
)

View File

@ -37,9 +37,7 @@ array(
)
value: Expr_ConstFetch(
name: Name(
parts: array(
0: E
)
name: E
)
)
)

View File

@ -10,9 +10,7 @@ array(
0: Stmt_If(
cond: Expr_ConstFetch(
name: Name(
parts: array(
0: true
)
name: true
)
)
stmts: array(

View File

@ -35,9 +35,7 @@ array(
)
default: Expr_ConstFetch(
name: Name(
parts: array(
0: null
)
name: null
)
)
)
@ -67,9 +65,7 @@ array(
)
default: Expr_ClassConstFetch(
class: Name(
parts: array(
0: A
)
name: A
)
name: Identifier(
name: B

View File

@ -30,28 +30,20 @@ array(
0: IntersectionType(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
1: Name(
parts: array(
0: B
)
name: B
)
)
)
1: IntersectionType(
types: array(
0: Name(
parts: array(
0: X
)
name: X
)
1: Name(
parts: array(
0: Y
)
name: Y
)
)
)
@ -75,21 +67,15 @@ array(
0: IntersectionType(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
1: Name(
parts: array(
0: B
)
name: B
)
)
)
1: Name(
parts: array(
0: C
)
name: C
)
)
)
@ -121,28 +107,20 @@ array(
0: IntersectionType(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
1: Name(
parts: array(
0: B
)
name: B
)
)
)
1: IntersectionType(
types: array(
0: Name(
parts: array(
0: X
)
name: X
)
1: Name(
parts: array(
0: Y
)
name: Y
)
)
)
@ -161,28 +139,20 @@ array(
0: IntersectionType(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
1: Name(
parts: array(
0: B
)
name: B
)
)
)
1: IntersectionType(
types: array(
0: Name(
parts: array(
0: X
)
name: X
)
1: Name(
parts: array(
0: Y
)
name: Y
)
)
)

View File

@ -27,14 +27,10 @@ array(
type: IntersectionType(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
1: Name(
parts: array(
0: B
)
name: B
)
)
)
@ -64,14 +60,10 @@ array(
type: IntersectionType(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
1: Name(
parts: array(
0: B
)
name: B
)
)
)
@ -86,14 +78,10 @@ array(
returnType: IntersectionType(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
1: Name(
parts: array(
0: B
)
name: B
)
)
)

View File

@ -48,9 +48,7 @@ array(
params: array(
)
returnType: Name(
parts: array(
0: true
)
name: true
)
stmts: array(
)

View File

@ -20,9 +20,7 @@ array(
flags: 0
type: NullableType(
type: Name(
parts: array(
0: Foo
)
name: Foo
)
)
byRef: false
@ -51,9 +49,7 @@ array(
)
returnType: NullableType(
type: Name(
parts: array(
0: Baz
)
name: Baz
)
)
stmts: array(

View File

@ -21,9 +21,7 @@ array(
1: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: readonly
)
name: readonly
)
args: array(
)

View File

@ -61,10 +61,7 @@ array(
params: array(
)
returnType: Name(
parts: array(
0: Foo
1: Bar
)
name: Foo\Bar
)
stmts: array(
)

View File

@ -58,9 +58,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: E
)
name: E
)
byRef: false
variadic: false

View File

@ -26,9 +26,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: bool
)
name: bool
)
byRef: false
variadic: false
@ -42,9 +40,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: int
)
name: int
)
byRef: false
variadic: false
@ -58,9 +54,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: float
)
name: float
)
byRef: false
variadic: false
@ -74,9 +68,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: string
)
name: string
)
byRef: false
variadic: false
@ -90,9 +82,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: iterable
)
name: iterable
comments: array(
0: // PHP 7.0
)
@ -112,9 +102,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: object
)
name: object
comments: array(
0: // PHP 7.1
)
@ -134,9 +122,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: mixed
)
name: mixed
comments: array(
0: // PHP 7.2
)
@ -156,9 +142,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: null
)
name: null
comments: array(
0: // PHP 8.0
)
@ -178,9 +162,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: false
)
name: false
comments: array(
0: // PHP 8.0
)
@ -197,9 +179,7 @@ array(
)
)
returnType: Name(
parts: array(
0: void
)
name: void
)
stmts: array(
)
@ -214,9 +194,7 @@ array(
params: array(
)
returnType: Name(
parts: array(
0: never
)
name: never
)
stmts: array(
)
@ -313,9 +291,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: iterable
)
name: iterable
comments: array(
0: // PHP 7.0
)
@ -335,9 +311,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: object
)
name: object
comments: array(
0: // PHP 7.1
)
@ -357,9 +331,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: mixed
)
name: mixed
comments: array(
0: // PHP 7.2
)
@ -379,9 +351,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: null
)
name: null
comments: array(
0: // PHP 8.0
)
@ -401,9 +371,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: false
)
name: false
comments: array(
0: // PHP 8.0
)
@ -420,9 +388,7 @@ array(
)
)
returnType: Name(
parts: array(
0: void
)
name: void
)
stmts: array(
)
@ -437,9 +403,7 @@ array(
params: array(
)
returnType: Name(
parts: array(
0: never
)
name: never
)
stmts: array(
)
@ -556,9 +520,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: object
)
name: object
comments: array(
0: // PHP 7.1
)
@ -578,9 +540,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: mixed
)
name: mixed
comments: array(
0: // PHP 7.2
)
@ -600,9 +560,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: null
)
name: null
comments: array(
0: // PHP 8.0
)
@ -622,9 +580,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: false
)
name: false
comments: array(
0: // PHP 8.0
)
@ -656,9 +612,7 @@ array(
params: array(
)
returnType: Name(
parts: array(
0: never
)
name: never
)
stmts: array(
)
@ -795,9 +749,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: mixed
)
name: mixed
comments: array(
0: // PHP 7.2
)
@ -817,9 +769,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: null
)
name: null
comments: array(
0: // PHP 8.0
)
@ -839,9 +789,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: false
)
name: false
comments: array(
0: // PHP 8.0
)
@ -873,9 +821,7 @@ array(
params: array(
)
returnType: Name(
parts: array(
0: never
)
name: never
)
stmts: array(
)
@ -1084,9 +1030,7 @@ array(
params: array(
)
returnType: Name(
parts: array(
0: never
)
name: never
)
stmts: array(
)

View File

@ -27,9 +27,7 @@ array(
type: UnionType(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
1: Identifier(
name: iterable
@ -65,14 +63,10 @@ array(
type: UnionType(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
1: Name(
parts: array(
0: B
)
name: B
)
)
)

View File

@ -106,9 +106,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: Type
)
name: Type
)
byRef: false
variadic: true
@ -147,9 +145,7 @@ array(
)
flags: 0
type: Name(
parts: array(
0: Type
)
name: Type
)
byRef: true
variadic: true

View File

@ -213,9 +213,7 @@ array(
12: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: func
)
name: func
comments: array(
0: // yield in function calls
)
@ -267,9 +265,7 @@ array(
14: Stmt_Expression(
expr: Expr_New(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
args: array(
0: Arg(

View File

@ -85,9 +85,7 @@ array(
4: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: var_dump
)
name: var_dump
)
args: array(
0: Arg(
@ -169,9 +167,7 @@ array(
7: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: var_dump
)
name: var_dump
)
args: array(
0: Arg(
@ -212,9 +208,7 @@ array(
8: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: var_dump
)
name: var_dump
)
args: array(
0: Arg(

View File

@ -43,9 +43,7 @@ __halt_compiler();
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: A
)
name: A
)
stmts: array(
0: Stmt_Expression(

View File

@ -10,18 +10,14 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: var_dump
)
name: var_dump
)
args: array(
0: Arg(
name: null
value: Expr_ConstFetch(
name: Name(
parts: array(
0: __HALT_COMPILER_OFFSET__
)
name: __HALT_COMPILER_OFFSET__
)
)
byRef: false

View File

@ -22,14 +22,10 @@ array(
0: Stmt_Catch(
types: array(
0: Name(
parts: array(
0: X
)
name: X
)
1: Name(
parts: array(
0: Y
)
name: Y
)
)
var: Expr_Variable(
@ -46,15 +42,10 @@ array(
1: Stmt_Catch(
types: array(
0: Name_FullyQualified(
parts: array(
0: A
)
name: A
)
1: Name(
parts: array(
0: B
1: C
)
name: B\C
)
)
var: Expr_Variable(

View File

@ -23,10 +23,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: A
1: B
)
name: A\B
)
alias: null
)
@ -38,10 +35,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: C
1: D
)
name: C\D
)
alias: Identifier(
name: E
@ -55,10 +49,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: F
1: G
)
name: F\G
)
alias: Identifier(
name: H
@ -67,9 +58,7 @@ array(
1: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: J
)
name: J
)
alias: null
)
@ -81,9 +70,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: A
)
name: A
)
alias: null
)
@ -98,9 +85,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: A
)
name: A
)
alias: Identifier(
name: B
@ -114,10 +99,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: foo
1: bar
)
name: foo\bar
)
alias: null
)
@ -132,10 +114,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: foo
1: bar
)
name: foo\bar
)
alias: Identifier(
name: baz
@ -149,10 +128,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: foo
1: BAR
)
name: foo\BAR
)
alias: null
)
@ -164,10 +140,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: foo
1: BAR
)
name: foo\BAR
)
alias: Identifier(
name: BAZ

View File

@ -12,18 +12,13 @@ namespace {
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: Foo
1: Bar
)
name: Foo\Bar
)
stmts: array(
0: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: foo
)
name: foo
)
)
)
@ -35,9 +30,7 @@ array(
0: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: bar
)
name: bar
)
)
)

View File

@ -7,9 +7,7 @@ namespace Foo {}
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: Foo
)
name: Foo
)
stmts: array(
)

View File

@ -12,17 +12,13 @@ array(
0: Stmt_GroupUse(
type: TYPE_UNKNOWN (0)
prefix: Name(
parts: array(
0: A
)
name: A
)
uses: array(
0: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: B
)
name: B
)
alias: null
)
@ -31,27 +27,20 @@ array(
1: Stmt_GroupUse(
type: TYPE_UNKNOWN (0)
prefix: Name(
parts: array(
0: A
)
name: A
)
uses: array(
0: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: B
1: C
)
name: B\C
)
alias: null
)
1: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: D
)
name: D
)
alias: null
)
@ -60,28 +49,20 @@ array(
2: Stmt_GroupUse(
type: TYPE_UNKNOWN (0)
prefix: Name(
parts: array(
0: A
1: B
)
name: A\B
)
uses: array(
0: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: C
1: D
)
name: C\D
)
alias: null
)
1: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: E
)
name: E
)
alias: null
)
@ -90,27 +71,20 @@ array(
3: Stmt_GroupUse(
type: TYPE_FUNCTION (2)
prefix: Name(
parts: array(
0: A
)
name: A
)
uses: array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: b
1: c
)
name: b\c
)
alias: null
)
1: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: d
)
name: d
)
alias: null
)
@ -119,27 +93,20 @@ array(
4: Stmt_GroupUse(
type: TYPE_CONSTANT (3)
prefix: Name(
parts: array(
0: A
)
name: A
)
uses: array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: B
1: C
)
name: B\C
)
alias: null
)
1: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: D
)
name: D
)
alias: null
)
@ -148,38 +115,27 @@ array(
5: Stmt_GroupUse(
type: TYPE_UNKNOWN (0)
prefix: Name(
parts: array(
0: A
1: B
)
name: A\B
)
uses: array(
0: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: C
1: D
)
name: C\D
)
alias: null
)
1: UseItem(
type: TYPE_FUNCTION (2)
name: Name(
parts: array(
0: b
1: c
)
name: b\c
)
alias: null
)
2: UseItem(
type: TYPE_CONSTANT (3)
name: Name(
parts: array(
0: D
)
name: D
)
alias: null
)

View File

@ -10,17 +10,13 @@ array(
0: Stmt_GroupUse(
type: TYPE_UNKNOWN (0)
prefix: Name(
parts: array(
0: Foo
)
name: Foo
)
uses: array(
0: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: Bar
)
name: Bar
)
alias: null
)
@ -32,17 +28,13 @@ array(
1: Stmt_GroupUse(
type: TYPE_UNKNOWN (0)
prefix: Name(
parts: array(
0: Bar
)
name: Bar
)
uses: array(
0: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: Foo
)
name: Foo
)
alias: null
)
@ -62,9 +54,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: Foo
)
name: Foo
)
alias: null
)
@ -76,18 +66,14 @@ array(
1: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: Bar
)
name: Bar
)
)
)
2: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: Baz
)
name: Baz
)
)
)
@ -102,9 +88,7 @@ array(
0: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name_FullyQualified(
parts: array(
0: Bar
)
name: Bar
)
)
)

View File

@ -8,18 +8,13 @@ array(
0: Stmt_GroupUse[2:1 - 2:17](
type: TYPE_UNKNOWN (0)
prefix: Name[2:5 - 2:11](
parts: array(
0: Foo
1: Bar
)
name: Foo\Bar
)
uses: array(
0: UseItem[2:14 - 2:16](
type: TYPE_NORMAL (1)
name: Name[2:14 - 2:16](
parts: array(
0: Baz
)
name: Baz
)
alias: null
)

View File

@ -8,17 +8,13 @@ array(
0: Stmt_GroupUse(
type: TYPE_UNKNOWN (0)
prefix: Name(
parts: array(
0: A
)
name: A
)
uses: array(
0: UseItem(
type: TYPE_NORMAL (1)
name: Name(
parts: array(
0: B
)
name: B
)
alias: null
)
@ -27,17 +23,13 @@ array(
1: Stmt_GroupUse(
type: TYPE_FUNCTION (2)
prefix: Name(
parts: array(
0: A
)
name: A
)
uses: array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: b
)
name: b
)
alias: null
)

View File

@ -10,9 +10,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: A
)
name: A
)
alias: Identifier(
name: self
@ -32,9 +30,7 @@ array(
0: UseItem(
type: TYPE_UNKNOWN (0)
name: Name(
parts: array(
0: B
)
name: B
)
alias: Identifier(
name: PARENT

View File

@ -12,9 +12,7 @@ Cannot mix bracketed namespace declarations with unbracketed namespace declarati
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: A
)
name: A
)
stmts: array(
0: Stmt_Echo(
@ -28,9 +26,7 @@ array(
)
1: Stmt_Namespace(
name: Name(
parts: array(
0: B
)
name: B
)
stmts: array(
0: Stmt_Echo(
@ -63,9 +59,7 @@ Cannot mix bracketed namespace declarations with unbracketed namespace declarati
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: A
)
name: A
)
stmts: array(
0: Stmt_Echo(
@ -86,9 +80,7 @@ array(
)
2: Stmt_Namespace(
name: Name(
parts: array(
0: B
)
name: B
)
stmts: array(
0: Stmt_Echo(

View File

@ -11,39 +11,28 @@ array(
0: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: A
)
name: A
)
)
)
1: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: A
1: B
)
name: A\B
)
)
)
2: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name_FullyQualified(
parts: array(
0: A
1: B
)
name: A\B
)
)
)
3: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name_Relative(
parts: array(
0: A
1: B
)
name: A\B
)
)
)

View File

@ -11,16 +11,12 @@ Namespace declarations cannot be nested from 3:5 to 5:5
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: A
)
name: A
)
stmts: array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: B
)
name: B
)
stmts: array(
)

View File

@ -11,18 +11,13 @@ bar;
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: Foo
1: Bar
)
name: Foo\Bar
)
stmts: array(
0: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: foo
)
name: foo
)
)
)
@ -30,17 +25,13 @@ array(
)
1: Stmt_Namespace(
name: Name(
parts: array(
0: Bar
)
name: Bar
)
stmts: array(
0: Stmt_Expression(
expr: Expr_ConstFetch(
name: Name(
parts: array(
0: bar
)
name: bar
)
)
)

View File

@ -12,9 +12,7 @@ array(
)
1: Stmt_Namespace(
name: Name(
parts: array(
0: A
)
name: A
)
stmts: array(
)

View File

@ -25,9 +25,7 @@ array(
)
1: Stmt_Namespace(
name: Name(
parts: array(
0: B
)
name: B
)
stmts: array(
)
@ -50,9 +48,7 @@ array(
)
1: Stmt_Namespace(
name: Name(
parts: array(
0: Foo
)
name: Foo
)
stmts: array(
)

View File

@ -23,9 +23,7 @@ array(
)
2: Stmt_Namespace(
name: Name(
parts: array(
0: A
)
name: A
)
stmts: array(
)
@ -40,9 +38,7 @@ No code may exist outside of namespace {} from 3:1 to 3:7
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: A
)
name: A
)
stmts: array(
)
@ -66,9 +62,7 @@ No code may exist outside of namespace {} from 3:1 to 3:17
array(
0: Stmt_Namespace(
name: Name(
parts: array(
0: A
)
name: A
)
stmts: array(
)
@ -89,9 +83,7 @@ array(
2: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
name: foo
)
args: array(
)
@ -99,9 +91,7 @@ array(
)
3: Stmt_Namespace(
name: Name(
parts: array(
0: B
)
name: B
)
stmts: array(
)

View File

@ -23,9 +23,7 @@ array(
)
value: Expr_New(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
args: array(
)
@ -53,9 +51,7 @@ array(
)
default: Expr_New(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
args: array(
)
@ -72,9 +68,7 @@ array(
)
default: Expr_New(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
args: array(
)
@ -90,18 +84,14 @@ array(
attrs: array(
0: Attribute(
name: Name(
parts: array(
0: Attr
)
name: Attr
)
args: array(
0: Arg(
name: null
value: Expr_New(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
args: array(
)
@ -134,9 +124,7 @@ array(
)
value: Expr_New(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
args: array(
)
@ -156,9 +144,7 @@ array(
)
default: Expr_New(
class: Name(
parts: array(
0: Foo
)
name: Foo
)
args: array(
)

View File

@ -27,9 +27,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: doTry
)
name: doTry
)
args: array(
)
@ -40,9 +38,7 @@ array(
0: Stmt_Catch(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
)
var: Expr_Variable(
@ -52,9 +48,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: doCatchA
)
name: doCatchA
)
args: array(
)
@ -65,9 +59,7 @@ array(
1: Stmt_Catch(
types: array(
0: Name(
parts: array(
0: B
)
name: B
)
)
var: Expr_Variable(
@ -77,9 +69,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: doCatchB
)
name: doCatchB
)
args: array(
)
@ -93,9 +83,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: doFinally
)
name: doFinally
)
args: array(
)
@ -111,9 +99,7 @@ array(
0: Stmt_Catch(
types: array(
0: Name(
parts: array(
0: A
)
name: A
)
)
var: Expr_Variable(

View File

@ -16,9 +16,7 @@ array(
0: Stmt_Catch(
types: array(
0: Name(
parts: array(
0: Exception
)
name: Exception
)
)
var: null

View File

@ -13,9 +13,7 @@ array(
0: Stmt_Expression(
expr: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
name: foo
)
args: array(
)