[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*.y]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\nindent_style = space\nindent_size = 4\n"
  },
  {
    "path": ".gitattributes",
    "content": "/.github         export-ignore\n/doc             export-ignore\n/grammar         export-ignore\n/test            export-ignore\n/test_old        export-ignore\n/tools           export-ignore\n.editorconfig    export-ignore\n.gitattributes   export-ignore\n.gitignore       export-ignore\n.php-cs-fixer.dist.php  export-ignore\nMakefile         export-ignore\nCHANGELOG.md     export-ignore\nCONTRIBUTING.md  export-ignore\nphpstan-baseline.neon   export-ignore\nphpstan.neon.dist   export-ignore\nphpunit.xml.dist export-ignore\nUPGRADE-*.md     export-ignore\n"
  },
  {
    "path": ".github/workflows/main.yml",
    "content": "# https://help.github.com/en/categories/automating-your-workflow-with-github-actions\nname: Main\non:\n  push:\n  pull_request:\n\njobs:\n  tests_coverage:\n    runs-on: \"ubuntu-latest\"\n    name: \"PHP 7.4 Unit Tests (with coverage)\"\n    steps:\n      - name: \"Checkout\"\n        uses: \"actions/checkout@v4\"\n      - name: \"Install PHP\"\n        uses: \"shivammathur/setup-php@v2\"\n        with:\n          coverage: \"xdebug\"\n          php-version: \"7.4\"\n          tools: composer:v2\n      - name: \"Install dependencies\"\n        run: |\n          composer require php-coveralls/php-coveralls:^2.2 --dev --no-update\n          COMPOSER_ROOT_VERSION=dev-master composer update --no-progress --prefer-dist\n      - name: \"Tests\"\n        run: \"php vendor/bin/phpunit --coverage-clover build/logs/clover.xml\"\n      - name: Coveralls\n        env:\n          COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        run: \"php vendor/bin/php-coveralls\"\n        if: ${{ success() }}\n  tests:\n    runs-on: \"ubuntu-latest\"\n    name: \"PHP ${{ matrix.php-version }} Unit Tests\"\n    strategy:\n      matrix:\n        php-version:\n          - \"8.0\"\n          - \"8.1\"\n          - \"8.2\"\n          - \"8.3\"\n          - \"8.4\"\n          - \"8.5\"\n      fail-fast: false\n    steps:\n      - name: \"Checkout\"\n        uses: \"actions/checkout@v4\"\n      - name: \"Install PHP\"\n        uses: \"shivammathur/setup-php@v2\"\n        with:\n          coverage: \"none\"\n          php-version: \"${{ matrix.php-version }}\"\n          ini-file: \"development\"\n          tools: composer:v2\n      - name: \"Install dependencies\"\n        run: \"COMPOSER_ROOT_VERSION=dev-master composer update --no-progress --prefer-dist ${{ matrix.flags }}\"\n      - name: \"PHPUnit\"\n        run: \"php vendor/bin/phpunit\"\n  test_old_73_80:\n    runs-on: \"ubuntu-latest\"\n    name: \"PHP 7.4 Code on PHP 8.4 Integration Tests\"\n    steps:\n      - name: \"Checkout\"\n        uses: \"actions/checkout@v4\"\n      - name: \"Install PHP\"\n        uses: \"shivammathur/setup-php@v2\"\n        with:\n          coverage: \"none\"\n          php-version: \"8.4\"\n          ini-file: \"development\"\n          tools: composer:v2\n      - name: \"Install PHP 8 dependencies\"\n        run: \"COMPOSER_ROOT_VERSION=dev-master composer update --no-progress --prefer-dist\"\n      - name: \"Tests\"\n        run: \"test_old/run-php-src.sh 7.4.33\"\n  test_old_80_70:\n    runs-on: \"ubuntu-latest\"\n    name: \"PHP 8.4 Code on PHP 7.4 Integration Tests\"\n    steps:\n      - name: \"Checkout\"\n        uses: \"actions/checkout@v4\"\n      - name: \"Install PHP\"\n        uses: \"shivammathur/setup-php@v2\"\n        with:\n          coverage: \"none\"\n          php-version: \"7.4\"\n          ini-file: \"development\"\n          tools: composer:v2\n      - name: \"Install PHP 8 dependencies\"\n        run: \"COMPOSER_ROOT_VERSION=dev-master composer update --no-progress --prefer-dist\"\n      - name: \"Tests\"\n        run: \"test_old/run-php-src.sh 8.4.0beta5\"\n  phpstan:\n    runs-on: \"ubuntu-latest\"\n    name: \"PHPStan\"\n    steps:\n      - name: \"Checkout\"\n        uses: \"actions/checkout@v4\"\n      - name: \"Install PHP\"\n        uses: \"shivammathur/setup-php@v2\"\n        with:\n          coverage: \"none\"\n          php-version: \"8.3\"\n          tools: composer:v2\n      - name: \"Install dependencies\"\n        run: |\n          cd tools && composer install\n      - name: \"PHPStan\"\n        run: \"php tools/vendor/bin/phpstan\"\n  php-cs-fixer:\n    runs-on: \"ubuntu-latest\"\n    name: \"PHP-CS-Fixer\"\n    steps:\n      - name: \"Checkout\"\n        uses: \"actions/checkout@v4\"\n      - name: \"Install PHP\"\n        uses: \"shivammathur/setup-php@v2\"\n        with:\n          coverage: \"none\"\n          php-version: \"8.3\"\n          tools: composer:v2\n      - name: \"Install dependencies\"\n        run: |\n          cd tools && composer install\n      - name: \"php-cs-fixer\"\n        run: \"php tools/vendor/bin/php-cs-fixer fix --dry-run\"\n"
  },
  {
    "path": ".gitignore",
    "content": ".idea/\nvendor/\ncomposer.lock\ngrammar/kmyacc.exe\ngrammar/y.output\n.phpunit.result.cache\n.php-cs-fixer.cache\n"
  },
  {
    "path": ".php-cs-fixer.dist.php",
    "content": "<?php\n\n$finder = PhpCsFixer\\Finder::create()\n    ->exclude('PhpParser/Parser')\n    ->in(__DIR__ . '/lib')\n    ->in(__DIR__ . '/test')\n    ->in(__DIR__ . '/grammar')\n;\n\n$config = new PhpCsFixer\\Config();\nreturn $config->setRiskyAllowed(true)\n    ->setRules([\n        '@PSR12' => true,\n        // We use PSR12 with consistent brace placement.\n        'curly_braces_position' => [\n            'functions_opening_brace' => 'same_line',\n            'classes_opening_brace' => 'same_line',\n        ],\n        // declare(strict_types=1) on the same line as <?php.\n        'blank_line_after_opening_tag' => false,\n        'declare_strict_types' => true,\n        // Keep argument formatting for now.\n        'method_argument_space' => ['on_multiline' => 'ignore'],\n        'phpdoc_align' => ['align' => 'left'],\n        'phpdoc_trim' => true,\n        'no_empty_phpdoc' => true,\n        'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],\n        'no_extra_blank_lines' => true,\n    ])\n    ->setFinder($finder)\n;\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "Version 5.7.0 (2025-12-06)\n--------------------------\n\n### Fixed\n\n* Fixed changing modifier on anonymous class with formatting preserving pretty printer.\n* Emit an error for unparenthesized arrow functions in pipe operator, and print necessary\n  parentheses in the pretty printer.\n* Fix PHP 8.5 deprecation warning in php-parse binary.\n\n### Changed\n\n* When targeting PHP 8.4 or newer, omit parentheses around immediately dereferenced new expressions.\n\n### Added\n\n* Added `shouldPrintRawValue` attribute to `Scalar\\Int_`, which makes the pretty printer use the\n  `rawValue` of the node. This can be used to print integers with separators.\n\nVersion 5.6.2 (2025-10-21)\n--------------------------\n\n### Fixed\n\n* Fixed formatting-preserving pretty-printing when changing the visibility modifier on a node that\n  has attributes.\n* Fixed `chr()` deprecation warning on PHP 8.5.\n\n### Added\n\n* Added `Param::isFinal()` method.\n\nVersion 5.6.1 (2025-08-13)\n--------------------------\n\n### Fixed\n\n* Fixed `Param::isPublic()` for parameters with asymmetric visibility keyword.\n* Fixed PHP 8.5 deprecation warnings for `SplObjectStorage` methods.\n\n### Added\n\n* Added cast `kind` attributes to `Cast\\Int_`, `Cast\\Bool_` and `Cast\\String_`.\n  These allow distinguishing the deprecated versions of these casts.\n\nVersion 5.6.0 (2025-07-27)\n--------------------------\n\n### Added\n\n* [8.5] Added support for `clone` with arbitrary function arguments. This will be parsed as an\n  `Expr\\FuncCall` node, instead of the usual `Expr\\Clone_` node.\n* [8.5] Permit declaration of `function clone` for use in stubs.\n* [8.5] Added support for the pipe operator, represented by `Expr\\BinaryOp\\Pipe`.\n* [8.5] Added support for the `(void)` cast, represented by `Expr\\Cast\\Void_`.\n* [8.5] Added support for the `final` modifier on promoted properties.\n* Added `CallLike::getArg()` to fetch an argument by position and name.\n\nVersion 5.5.0 (2025-05-31)\n--------------------------\n\n### Added\n\n* [8.5] Added support for attributes on constants. `Stmt\\Const_` now has an `attrGroups` subnode.\n* Added `weakReferences` option to `NodeConnectingVisitor` and `ParentConnectingVisitor`. This\n  will create the parent/next/prev references as WeakReferences, to avoid making the AST cyclic\n  and thus increasing GC pressure.\n\n### Changed\n\n* Attributes on parameters are now printed on separate lines if the pretty printer target version\n  is PHP 7.4 or older (which is the default). This allows them to be interpreted as comments,\n  instead of causing a parse error. Specify a target version of PHP 8.0 or newer to restore the\n  previous behavior.\n\nVersion 5.4.0 (2024-12-30)\n--------------------------\n\n### Added\n\n* Added `Property::isAbstract()` and `Property::isFinal()` methods.\n* Added `PropertyHook::isFinal()` method.\n* Emit an error if property hook is used on declaration with multiple properties.\n\n### Fixed\n\n* Make legacy class aliases compatible with classmap-authoritative autoloader.\n* `Param::isPromoted()` and `Param::isPublic()` now returns true for parameters that have property\n  hooks but no explicit visibility modifier.\n* `PropertyHook::getStmts()` now correctly desugars short `set` hooks. `set => $value` will be\n  expanded to `set { $this->propertyName = $value; }`. This requires the `propertyName` attribute\n  on the hook to be set, which is now also set by the parser. If the attribute is not set,\n  `getStmts()` will throw an error for short set hooks, as it is not possible to produce a correct\n  desugaring.\n\nVersion 5.3.1 (2024-10-08)\n--------------------------\n\n### Added\n\n* Added support for declaring functions with name `exit` or `die`, to allow their use in stubs.\n\nVersion 5.3.0 (2024-09-29)\n--------------------------\n\n### Added\n\n* Added `indent` option to pretty printer, which can be used to specify the indentation to use\n  (defaulting to four spaces). This also allows using tab indentation.\n\n### Fixed\n\n* Resolve names in `PropertyHook`s in the `NameResolver`.\n* Include the trailing semicolon inside `Stmt\\GroupUse` nodes, making them consistent with\n  `Stmt\\Use_` nodes.\n* Fixed indentation sometimes becoming negative in formatting-preserving pretty printer, resulting\n  in `ValueError`s.\n\nVersion 5.2.0 (2024-09-15)\n--------------------------\n\n### Added\n\n* [8.4] Added support for `__PROPERTY__` magic constant, represented using a\n  `Node\\Scalar\\MagicConst\\Property` node.\n* [8.4] Added support for property hooks, which are represented using a new `hooks` subnode on\n  `Node\\Stmt\\Property` and `Node\\Param`, which contains an array of `Node\\PropertyHook`.\n* [8.4] Added support for asymmetric visibility modifiers. Property `flags` can now hold the\n  additional bits `Modifiers::PUBLIC_SET`, `Modifiers::PROTECTED_SET` and `Modifiers::PRIVATE_SET`.\n* [8.4] Added support for generalized exit function. For backwards compatibility, exit without\n  argument or a single plain argument continues to use a `Node\\Expr\\Exit_` node. Otherwise (e.g.\n  if a named argument is used) it will be represented as a plain `Node\\Expr\\FuncCall`.\n* Added support for passing enum values to various builder methods, like `BuilderFactory::val()`.\n\n### Removed\n\n* Removed support for alternative array syntax `$array{0}` from the PHP 8 parser. It is still\n  supported by the PHP 7 parser. This is necessary in order to support property hooks.\n\nVersion 5.1.0 (2024-07-01)\n--------------------------\n\n### Added\n\n* [8.4] Added support for dereferencing `new` expressions without parentheses.\n\n### Fixed\n\n* Fixed redundant parentheses being added when pretty printing ternary expressions.\n\n### Changed\n\n* Made some phpdoc types more precise.\n\nVersion 5.0.2 (2024-03-05)\n--------------------------\n\n### Fixed\n\n* Fix handling of indentation on next line after opening PHP tag in formatting-preserving pretty\nprinter.\n\n### Changed\n\n* Avoid cyclic references in `Parser` objects. This means that no longer used parser objects are\n  immediately destroyed now, instead of requiring cycle GC.\n* Update `PhpVersion::getNewestSupported()` to report PHP 8.3 instead of PHP 8.2.\n\nVersion 5.0.1 (2024-02-21)\n--------------------------\n\n### Changed\n\n* Added check to detect use of PHP-Parser with libraries that define `T_*` compatibility tokens\n  with incorrect type (such as string instead of int). This would lead to `TypeError`s down the\n  line. Now an `Error` will be thrown early to indicate the problem.\n\nVersion 5.0.0 (2024-01-07)\n--------------------------\n\nSee UPGRADE-5.0 for detailed migration instructions.\n\n### Fixed\n\n* Fixed parent class of `PropertyItem` and `UseItem`.\n\nVersion 5.0.0-rc1 (2023-12-20)\n------------------------------\n\nSee UPGRADE-5.0 for detailed migration instructions.\n\n### Fixed\n\n* Fixed parsing of empty files.\n\n### Added\n\n* Added support for printing additional attributes (like `kind`) in `NodeDumper`.\n* Added `rawValue` attribute to `InterpolatedStringPart` and heredoc/nowdoc `String_`s, which\n  provides the original, unparsed value. It was previously only available for non-interpolated\n  single/double quoted strings.\n* Added `Stmt\\Block` to represent `{}` code blocks. Previously, such code blocks were flattened\n  into the parent statements array. `Stmt\\Block` will not be created for structures that are\n  typically used with code blocks, for example `if ($x) { $y; }` will be represented as previously,\n  while `if ($x) { { $x; } }` will have an extra `Stmt\\Block` wrapper.\n\n### Changed\n\n* Use visitor to assign comments. This fixes the long-standing issue where comments were assigned\n  to all nodes sharing a starting position. Now only the outer-most node will hold the comments.\n* Don't parse unicode escape sequences when targeting PHP < 7.0.\n* Improve NodeDumper performance for large dumps.\n\n### Removed\n\n* Removed `Stmt\\Throw_` node, use `Expr\\Throw_` inside `Stmt\\Expression` instead.\n* Removed `ParserFactory::create()`.\n\nVersion 5.0.0-beta1 (2023-09-17)\n--------------------------------\n\nSee UPGRADE-5.0 for detailed migration instructions.\n\n### Added\n\n* Visitors can now be passed directly to the `NodeTraverser` constructor. A separate call to\n  `addVisitor()` is no longer required.\n\n### Changed\n\n* The minimum host PHP version is now PHP 7.4. It is still possible to parse code from older\n  versions. Property types have been added where possible.\n* The `Lexer` no longer accepts options. `Lexer\\Emulative` only accepts a `PhpVersion`. The\n  `startLexing()`, `getTokens()` and `handleHaltCompiler()` methods have been removed. Instead,\n  there is a single method `tokenize()` returning the tokens.\n* The `Parser::getLexer()` method has been replaced by `Parser::getTokens()`.\n* Attribute handling has been moved from the lexer to the parser, and is no longer configurable.\n  The comments, startLine, endLine, startTokenPos, endTokenPos, startFilePos, and endFilePos\n  attributes will always be added.\n* The pretty printer now defaults to PHP 7.4 as the target version.\n* The pretty printer now indents heredoc/nowdoc strings if the target version is >= 7.3\n  (flexible heredoc/nowdoc).\n\n### Removed\n\n* The deprecated `Comment::getLine()`, `Comment::getTokenPos()` and `Comment::getFilePos()` methods\n  have been removed. Use `Comment::getStartLine()`, `Comment::getStartTokenPos()` and\n  `Comment::getStartFilePos()` instead.\n\n### Deprecated\n\n* The `Node::getLine()` method has been deprecated. Use `Node::getStartLine()` instead.\n\nVersion 5.0.0-alpha3 (2023-06-24)\n---------------------------------\n\nSee UPGRADE-5.0 for detailed migration instructions.\n\n### Added\n\n* [PHP 8.3] Added support for typed constants.\n* [PHP 8.3] Added support for readonly anonymous classes.\n* Added support for `NodeVisitor::REPLACE_WITH_NULL`.\n* Added support for CRLF newlines in the pretty printer, using the new `newline` option.\n\n### Changed\n\n* Use PHP 7.1 as the default target version for the pretty printer.\n* Print `else if { }` instead of `else { if { } }`.\n* The `leaveNode()` method on visitors is now invoked in reverse order of `enterNode()`.\n* Moved `NodeTraverser::REMOVE_NODE` etc. to `NodeVisitor::REMOVE_NODE`. The old constants are still\n  available for compatibility.\n* The `Name` subnode `parts` has been replaced by `name`, which stores the name as a string rather\n  than an array of parts separated by namespace separators. The `getParts()` method returns the old\n  representation.\n* No longer accept strings for types in Node constructors. Instead, either an `Identifier`, `Name`\n  or `ComplexType` must be passed.\n* `Comment::getReformattedText()` now normalizes CRLF newlines to LF newlines.\n\n### Fixed\n\n* Don't trim leading whitespace in formatting preserving printer.\n* Treat DEL as a label character in the formatting preserving printer depending on the targeted\n  PHP version.\n* Fix error reporting in emulative lexer without explicitly specified error handler.\n* Gracefully handle non-contiguous array indices in the `Differ`.\n\nVersion 5.0.0-alpha2 (2023-03-05)\n---------------------------------\n\nSee UPGRADE-5.0 for detailed migration instructions.\n\n### Added\n\n* [PHP 8.3] Added support for dynamic class constant fetch.\n* Added many additional type annotations. PhpStan is now used.\n* Added a fuzzing target for PHP-Fuzzer, which was how a lot of pretty printer bugs were found.\n* Added `isPromoted()`, `isPublic()`, `isProtected()`, `isPrivate()` and `isReadonly()` methods\n  on `Param`.\n* Added support for class constants in trait builder.\n* Added `PrettyPrinter` interface.\n* Added support for formatting preservation when toggling static modifiers.\n* The `php-parse` binary now accepts `-` as the file name, in which case it will read from stdin.\n\n### Fixed\n\n* The pretty printer now uses a more accurate treatment of unary operator precedence, and will only\n  wrap them in parentheses if required. This allowed fixing a number of other precedence related\n  bugs.\n* The pretty printer now respects the precedence of `clone`, `throw` and arrow functions.\n* The pretty printer no longer unconditionally wraps `yield` in parentheses, unless the target\n  version is set to older than PHP 7.0.\n* Fixed formatting preservation for alternative elseif/else syntax.\n* Fixed checks for when it is safe to print strings as heredoc/nowdoc to accommodate flexible\n  doc string semantics.\n* The pretty printer now prints parentheses around new/instanceof operands in all required\n  situations.\n* Similar, differences in allowed expressions on the LHS of `->` and `::` are now taken into account.\n* Fixed various cases where `\\r` at the end of a doc string could be incorrectly merged into a CRLF\n  sequence with a following `\\n`.\n* `__halt_compiler` is no longer recognized as a semi-reserved keyword, in line with PHP behavior.\n* `<?=` is no longer recognized as a semi-reserved keyword.\n* Fix handling of very large overflowing `\\u` escape sequences.\n\n### Removed\n\n* Removed deprecated `Error` constructor taking a line number instead of an attributes array.\n\nVersion 5.0.0-alpha1 (2022-09-04)\n---------------------------------\n\nSee UPGRADE-5.0 for detailed migration instructions.\n\n### Changed\n\n* PHP 7.1 is now required to run PHP-Parser.\n* Formatting of the standard pretty printer has been adjusted to match PSR-12 more closely.\n* The internal token representation now uses a `PhpParser\\Token` class, which is compatible with\n  PHP 8 token representation (`PhpToken`).\n* Destructuring is now always represented using `Expr\\List_` nodes, even if it uses `[]` syntax.\n* Renamed a number of node classes, and moved things that were not real expressions/statements\n  outside the `Expr`/`Stmt` hierarchy. Compatibility shims for the old names have been retained.\n\n### Added\n\n* Added `PhpVersion` class, which is accepted in a number of places (e.g. ParserFactory, Parser,\n  Lexer, PrettyPrinter) and gives more precise control over the PHP version being targeted.\n* Added PHP 8 parser though it only differs from the PHP 7 parser in concatenation precedence.\n* Added `Parser::getLexer()` method.\n* Added a `Modifiers` class, as a replacement for `Stmt\\Class_::MODIFIER_*`.\n* Added support for returning an array or `REMOVE_NODE` from `NodeVisitor::enterNode()`.\n\n### Removed\n\n* The PHP 5 parser has been removed. The PHP 7 parser has been adjusted to deal with PHP 5 code\n  more gracefully.\n\nVersion 4.15.1 (2022-09-04)\n---------------------------\n\n### Fixed\n\n* Fixed formatting preservation when adding *multiple* attributes to a class/method/etc that\n  previously had none. This fixes a regression in the 4.15.0 release.\n\nVersion 4.15.0 (2022-09-03)\n---------------------------\n\n### Added\n\n* PHP 8.2: Added support for `true` type.\n* PHP 8.2: Added support for DNF types.\n\n### Fixed\n\n* Support `readonly` as a function name.\n* Added `__serialize` and `__unserialize` to magic method list.\n* Fixed bounds check in `Name::slice()`.\n* Fixed formatting preservation when adding attributes to a class/method/etc that previously had none.\n\nVersion 4.14.0 (2022-05-31)\n---------------------------\n\n### Added\n\n* Added support for readonly classes.\n* Added `rawValue` attribute to `LNumber`, `DNumber` and `String_` nodes, which stores the unparsed\n  value of the literal (e.g. `\"1_000\"` rather than `1000`).\n\nVersion 4.13.2 (2021-11-30)\n---------------------------\n\n### Added\n\n* Added builders for enums and enum cases.\n\n### Fixed\n\n* NullsafeMethodCall now extends from CallLike.\n* The `namespacedName` property populated by the `NameResolver` is now declared on relevant nodes,\n  to avoid a dynamic property deprecation warning with PHP 8.2.\n\nVersion 4.13.1 (2021-11-03)\n---------------------------\n\n### Fixed\n\n* Support reserved keywords as enum cases.\n* Support array unpacking in constant expression evaluator.\n\nVersion 4.13.0 (2021-09-20)\n---------------------------\n\n### Added\n\n* [PHP 8.1] Added support for intersection types using a new `IntersectionType` node. Additionally\n  a `ComplexType` parent class for `NullableType`, `UnionType` and `IntersectionType` has been\n  added.\n* [PHP 8.1] Added support for explicit octal literals.\n* [PHP 8.1] Added support for first-class callables. These are represented using a call whose first\n  argument is a `VariadicPlaceholder`. The representation is intended to be forward-compatible with\n  partial function application, just like the PHP feature itself. Call nodes now extend from\n  `Expr\\CallLike`, which provides an `isFirstClassCallable()` method to determine whether a\n  placeholder id present. `getArgs()` can be used to assert that the call is not a first-class\n  callable and returns `Arg[]` rather than `array<Arg|VariadicPlaceholder>`.\n\n### Fixed\n\n* Multiple modifiers for promoted properties are now accepted. In particular this allows something\n  like `public readonly` for promoted properties.\n* Formatting-preserving pretty printing for comments in array literals has been fixed.\n\nVersion 4.12.0 (2021-07-21)\n---------------------------\n\n### Added\n\n* [PHP 8.1] Added support for readonly properties (through a new `MODIFIER_READONLY`).\n* [PHP 8.1] Added support for final class constants.\n\n### Fixed\n\n* Fixed compatibility with PHP 8.1. `&` tokens are now canonicalized to the\n  `T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG` and `T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG` tokens\n  used in PHP 8.1. This happens unconditionally, regardless of whether the emulative lexer is used.\n\nVersion 4.11.0 (2021-07-03)\n---------------------------\n\n### Added\n\n* `BuilderFactory::args()` now accepts named arguments.\n* `BuilderFactory::attribute()` has been added.\n* An `addAttribute()` method accepting an `Attribute` or `AttributeGroup` has been adde to all\n  builders that accept attributes, such as `Builder\\Class_`.\n\n### Fixed\n\n* `NameResolver` now handles enums.\n* `PrettyPrinter` now prints backing enum type.\n* Builder methods for types now property handle `never` type.\n\nVersion 4.10.5 (2021-05-03)\n---------------------------\n\n### Added\n\n* [PHP 8.1] Added support for enums. These are represented using the `Stmt\\Enum_` and\n  `Stmt\\EnumCase` nodes.\n* [PHP 8.1] Added support for never type. This type will now be returned as an `Identifier` rather\n  than `Name`.\n* Added `ClassConst` builder.\n\n### Changed\n\n* Non-UTF-8 code units in strings will now be hex-encoded.\n\n### Fixed\n\n* Fixed precedence of arrow functions.\n\nVersion 4.10.4 (2020-12-20)\n---------------------------\n\n### Fixed\n\n* Fixed position information for variable-variables (#741).\n* Fixed position information for traits/interfaces preceded by if statement (#738).\n\nVersion 4.10.3 (2020-12-03)\n---------------------------\n\n### Fixed\n\n* Fixed formatting-preserving pretty printing for `\"{$x}\"`.\n* Ternary expressions are now treated as non-associative in the pretty printer, in order to\n  generate code that is compatible with the parentheses requirement introduced in PHP 8.\n* Removed no longer necessary `error_clear_last()` call in lexer, which may interfere with fatal\n  error handlers if invoked during shutdown.\n\n\nVersion 4.10.2 (2020-09-26)\n------------------\n\n### Fixed\n\n* Fixed check for token emulation conflicts with other libraries.\n\nVersion 4.10.1 (2020-09-23)\n---------------------------\n\n### Added\n\n* Added support for recovering from a missing semicolon after a property or class constant\n  declaration.\n\n### Fixed\n\n* Fix spurious whitespace in formatting-preserving pretty printer when both removing and adding\n  elements at the start of a list.\n* Fix incorrect case-sensitivity in keyword token emulation.\n\nVersion 4.10.0 (2020-09-19)\n---------------------------\n\n### Added\n\n* [PHP 8.0] Added support for attributes. These are represented using a new `AttributeGroup` node\n  containing `Attribute` nodes. A new `attrGroups` subnode is available on all node types that\n  support attributes, i.e. `Stmt\\Class_`, `Stmt\\Trait_`, `Stmt\\Interface_`, `Stmt\\Function_`,\n  `Stmt\\ClassMethod`, `Stmt\\ClassConst`, `Stmt\\Property`, `Expr\\Closure`, `Expr\\ArrowFunction` and\n  `Param`.\n* [PHP 8.0] Added support for nullsafe properties inside interpolated strings, in line with an\n  upstream change.\n\n### Fixed\n\n* Improved compatibility with other libraries that use forward compatibility defines for PHP tokens.\n\nVersion 4.9.1 (2020-08-30)\n--------------------------\n\n### Added\n\n* Added support for removing the first element of a list to the formatting-preserving pretty\n  printer.\n\n### Fixed\n\n* Allow member modifiers as part of namespaced names. These were missed when support for other\n  keywords was added.\n\nVersion 4.9.0 (2020-08-18)\n--------------------------\n\n### Added\n\n* [PHP 8.0] Added support for named arguments, represented using a new `name` subnode on `Arg`.\n* [PHP 8.0] Added support for static return type, represented like a normal class return type.\n* [PHP 8.0] Added support for throw expression, represented using a new `Expr\\Throw_` node. For\n  backwards compatibility reasons, throw expressions in statement context continue to be\n  represented using `Stmt\\Throw_`.\n* [PHP 8.0] Added support for keywords as parts of namespaced names.\n\n### Fixed\n\n* Emit parentheses for class constant fetch with complex left-hand-side.\n* Emit parentheses for new/instanceof on complex class expression.\n\nVersion 4.8.0 (2020-08-09)\n--------------------------\n\n### Added\n\n* [PHP 8.0] Added support for nullsafe operator, represented using the new\n  `Expr\\NullsafePropertyFetch` and `Expr\\NullsafeMethodCall` nodes.\n* Added `phpVersion` option to the emulative lexer, which allows controlling the target version to\n  emulate (defaults to the latest available, currently PHP 8.0). This is useful to parse code that\n  uses reserved keywords from newer PHP versions as identifiers.\n\nVersion 4.7.0 (2020-07-25)\n--------------------------\n\n### Added\n\n* Add `ParentConnectingVisitor` and `NodeConnectingVisitor` classes.\n* [PHP 8.0] Added support for match expressions. These are represented using a new `Expr\\Match_`\n  containing `MatchArm`s.\n* [PHP 8.0] Added support for trailing comma in closure use lists.\n\n### Fixed\n\n* Fixed missing error for unterminated comment with trailing newline (#688).\n* Compatibility with PHP 8.0 has been restored: Namespaced names are now always represented by\n  `T_NAME_*` tokens, using emulationg on older PHP versions. Full support for reserved keywords\n  in namespaced names is not yet present.\n\nVersion 4.6.0 (2020-07-02)\n--------------------------\n\n### Added\n\n* [PHP 8.0] Added support for trailing commas in parameter lists.\n* [PHP 8.0] Added support for constructor promotion. The parameter visibility is stored in\n  `Node\\Param::$flags`.\n\n### Fixed\n\n* Comment tokens now always follow the PHP 8 interpretation, and do not include trailing\n  whitespace.\n* As a result of the previous change, some whitespace issues when inserting a statement into a\n  method containing only a comment, and using the formatting-preserving pretty printer, have been\n  resolved.\n\nVersion 4.5.0 (2020-06-03)\n--------------------------\n\n### Added\n\n* [PHP 8.0] Added support for the mixed type. This means `mixed` types are now parsed as an\n  `Identifier` rather than a `Name`.\n* [PHP 8.0] Added support for catching without capturing the exception. This means that\n  `Catch_::$var` may now be null.\n\nVersion 4.4.0 (2020-04-10)\n--------------------------\n\n### Added\n\n* Added support for passing union types in builders.\n* Added end line, token position and file position information for comments.\n* Added `getProperty()` method to `ClassLike` nodes.\n\n### Fixed\n\n* Fixed generation of invalid code when using the formatting preserving pretty printer, and\n  inserting code next to certain nop statements. The formatting is still ugly though.\n* `getDocComment()` no longer requires that the very last comment before a node be a doc comment.\n  There may not be non-doc comments between the doc comment and the declaration.\n* Allowed arbitrary expressions in `isset()` and `list()`, rather than just variables.\n  In particular, this allows `isset(($x))`, which is legal PHP code.\n* [PHP 8.0] Add support for [variable syntax tweaks RFC](https://wiki.php.net/rfc/variable_syntax_tweaks).\n\nVersion 4.3.0 (2019-11-08)\n--------------------------\n\n### Added\n\n* [PHP 8.0] Added support for union types using a new `UnionType` node.\n\nVersion 4.2.5 (2019-10-25)\n--------------------------\n\n### Changed\n\n* Tests and documentation are no longer included in source archives. They can still be accessed\n  by cloning the repository.\n* php-yacc is now used to generate the parser. This has no impact on users of the library.\n\nVersion 4.2.4 (2019-09-01)\n--------------------------\n\n### Added\n\n* Added getProperties(), getConstants() and getTraitUses() to ClassLike. (#629, #630)\n\n### Fixed\n\n* Fixed flexible heredoc emulation to check for digits after the end label. This synchronizes\n  behavior with the upcoming PHP 7.3.10 release.\n\nVersion 4.2.3 (2019-08-12)\n--------------------------\n\n### Added\n\n* [PHP 7.4] Add support for numeric literal separators. (#615)\n\n### Fixed\n\n* Fixed resolution of return types for arrow functions. (#613)\n* Fixed compatibility with PHP 7.4.\n\nVersion 4.2.2 (2019-05-25)\n--------------------------\n\n### Added\n\n* [PHP 7.4] Add support for arrow functions using a new `Expr\\ArrowFunction` node. (#602)\n* [PHP 7.4] Add support for array spreads, using a new `unpack` subnode on `ArrayItem`. (#609)\n* Added support for inserting into empty list nodes in the formatting preserving pretty printer.\n\n### Changed\n\n* `php-parse` will now print messages to stderr, so that stdout only contains the actual result of\n  the operation (such as a JSON dump). (#605)\n\n### Fixed\n\n* Fixed attribute assignment for zero-length nop statements, and a related assertion failure in\n  the formatting-preserving pretty printer. (#589)\n\nVersion 4.2.1 (2019-02-16)\n--------------------------\n\n### Added\n\n* [PHP 7.4] Add support for `??=` operator through a new `AssignOp\\Coalesce` node. (#575)\n\nVersion 4.2.0 (2019-01-12)\n--------------------------\n\n### Added\n\n* [PHP 7.4] Add support for typed properties through a new `type` subnode of `Stmt\\Property`.\n  Additionally `Builder\\Property` now has a `setType()` method. (#567)\n* Add `kind` attribute to `Cast\\Double_`, which allows to distinguish between `(float)`,\n  `(double)` and `(real)`. The form of the cast will be preserved by the pretty printer. (#565)\n\n### Fixed\n\n* Remove assertion when pretty printing anonymous class with a name (#554).\n\nVersion 4.1.1 (2018-12-26)\n--------------------------\n\n### Fixed\n\n* Fix \"undefined offset\" notice when parsing specific malformed code (#551).\n\n### Added\n\n* Support error recovery for missing return type (`function foo() : {}`) (#544).\n\nVersion 4.1.0 (2018-10-10)\n--------------------------\n\n### Added\n\n* Added support for PHP 7.3 flexible heredoc/nowdoc strings, completing support for PHP 7.3. There\n  are two caveats for this feature:\n   * In some rare, pathological cases flexible heredoc/nowdoc strings change the interpretation of\n     existing doc strings. PHP-Parser will now use the new interpretation.\n   * Flexible heredoc/nowdoc strings require special support from the lexer. Because this is not\n     available on PHP versions before 7.3, support has to be emulated. This emulation is not perfect\n     and some cases which we do not expect to occur in practice (such as flexible doc strings being\n     nested within each other through abuse of variable-variable interpolation syntax) may not be\n     recognized correctly.\n* Added `DONT_TRAVERSE_CURRENT_AND_CHILDREN` to `NodeTraverser` to skip both traversal of child\n  nodes, and prevent subsequent visitors from visiting the current node.\n\nVersion 4.0.4 (2018-09-18)\n--------------------------\n\n### Added\n\n* The following methods have been added to `BuilderFactory`:\n  * `useTrait()` (fluent builder)\n  * `traitUseAdaptation()` (fluent builder)\n  * `useFunction()` (fluent builder)\n  * `useConst()` (fluent builder)\n  * `var()`\n  * `propertyFetch()`\n  \n### Deprecated\n\n* `Builder\\Param::setTypeHint()` has been deprecated in favor of the newly introduced\n  `Builder\\Param::setType()`.\n\nVersion 4.0.3 (2018-07-15)\n--------------------------\n\n### Fixed\n\n* Fixed possible undefined offset notice in formatting-preserving printer. (#513)\n\n### Added\n\n* Improved error recovery inside arrays.\n* Preserve trailing comment inside classes. **Note:** This change is possibly BC breaking if your\n  code validates that classes can only contain certain statement types. After this change, classes\n  can also contain Nop statements, while this was not previously possible. (#509)\n\nVersion 4.0.2 (2018-06-03)\n--------------------------\n\n### Added\n\n* Improved error recovery inside classes.\n* Support error recovery for `foreach` without `as`.\n* Support error recovery for parameters without variable (`function (Type ) {}`).\n* Support error recovery for functions without body (`function ($foo)`).\n\nVersion 4.0.1 (2018-03-25)\n--------------------------\n\n### Added\n\n* [PHP 7.3] Added support for trailing commas in function calls.\n* [PHP 7.3] Added support for by-reference array destructuring. \n* Added checks to node traverser to prevent replacing a statement with an expression or vice versa.\n  This should prevent common mistakes in the implementation of node visitors.\n* Added the following methods to `BuilderFactory`, to simplify creation of expressions:\n  * `funcCall()`\n  * `methodCall()`\n  * `staticCall()`\n  * `new()`\n  * `constFetch()`\n  * `classConstFetch()`\n\nVersion 4.0.0 (2018-02-28)\n--------------------------\n\n* No significant code changes since the beta 1 release.\n\nVersion 4.0.0-beta1 (2018-01-27)\n--------------------------------\n\n### Fixed\n\n* In formatting-preserving pretty printer: Fixed indentation when inserting into lists. (#466)\n\n### Added\n\n* In formatting-preserving pretty printer: Improved formatting of elements inserted into multi-line\n  arrays.\n\n### Removed\n\n* The `Autoloader` class has been removed. It is now required to use the Composer autoloader.\n\nVersion 4.0.0-alpha3 (2017-12-26)\n---------------------------------\n\n### Fixed\n\n* In the formatting-preserving pretty printer:\n  * Fixed comment indentation.\n  * Fixed handling of inline HTML in the fallback case.\n  * Fixed insertion into list nodes that require creation of a code block.\n\n### Added\n\n* Added support for inserting at the start of list nodes in formatting-preserving pretty printer.\n\nVersion 4.0.0-alpha2 (2017-11-10)\n---------------------------------\n\n### Added\n\n* In the formatting-preserving pretty printer:\n  * Added support for changing modifiers.\n  * Added support for anonymous classes.\n  * Added support for removing from list nodes.\n  * Improved support for changing comments.\n* Added start token offsets to comments.\n\nVersion 4.0.0-alpha1 (2017-10-18)\n---------------------------------\n\n### Added\n\n* Added experimental support for format-preserving pretty-printing. In this mode formatting will be\n  preserved for parts of the code which have not been modified.\n* Added `replaceNodes` option to `NameResolver`, defaulting to true. If this option is disabled,\n  resolved names will be added as `resolvedName` attributes, instead of replacing the original\n  names.\n* Added `NodeFinder` class, which can be used to find nodes based on a callback or class name. This\n  is a utility to avoid custom node visitor implementations for simple search operations.\n* Added `ClassMethod::isMagic()` method.\n* Added `BuilderFactory` methods: `val()` method for creating an AST for a simple value, `concat()`\n  for creating concatenation trees, `args()` for preparing function arguments.\n* Added `NameContext` class, which encapsulates the `NameResolver` logic independently of the actual\n  AST traversal. This facilitates use in other context, such as class names in doc comments.\n  Additionally it provides an API for getting the shortest representation of a name.\n* Added `Node::setAttributes()` method.\n* Added `JsonDecoder`. This allows conversion JSON back into an AST.\n* Added `Name` methods `toLowerString()` and `isSpecialClassName()`.\n* Added `Identifier` and `VarLikeIdentifier` nodes, which are used in place of simple strings in\n  many places.\n* Added `getComments()`, `getStartLine()`, `getEndLine()`, `getStartTokenPos()`, `getEndTokenPos()`,\n  `getStartFilePos()` and `getEndFilePos()` methods to `Node`. These provide a more obvious access\n  point for the already existing attributes of the same name.\n* Added `ConstExprEvaluator` to evaluate constant expressions to PHP values.\n* Added `Expr\\BinaryOp::getOperatorSigil()`, returning `+` for `Expr\\BinaryOp\\Plus`, etc.\n\n### Changed\n\n* Many subnodes that previously held simple strings now use `Identifier` (or `VarLikeIdentifier`)\n  nodes. Please see the UPGRADE-4.0 file for an exhaustive list of affected nodes and some notes on\n  possible impact.\n* Expression statements (`expr;`) are now represented using a `Stmt\\Expression` node. Previously\n  these statements were directly represented as their constituent expression.\n* The `name` subnode of `Param` has been renamed to `var` and now contains a `Variable` rather than\n  a plain string.\n* The `name` subnode of `StaticVar` has been renamed to `var` and now contains a `Variable` rather\n  than a plain string.\n* The `var` subnode of `ClosureUse` now contains a `Variable` rather than a plain string.\n* The `var` subnode of `Catch` now contains a `Variable` rather than a plain string.\n* The `alias` subnode of `UseUse` is now `null` if no explicit alias is given. As such,\n  `use Foo\\Bar` and `use Foo\\Bar as Bar` are now represented differently. The `getAlias()` method\n  can be used to get the effective alias, even if it is not explicitly given.\n\n### Removed\n\n* Support for running on PHP 5 and HHVM has been removed. You can however still parse code of old\n  PHP versions (such as PHP 5.2), while running on PHP 7.\n* Removed `type` subnode on `Class`, `ClassMethod` and `Property` nodes. Use `flags` instead.\n* The `ClassConst::isStatic()` method has been removed. Constants cannot have a static modifier.\n* The `NodeTraverser` no longer accepts `false` as a return value from a `leaveNode()` method.\n  `NodeTraverser::REMOVE_NODE` should be returned instead.\n* The `Node::setLine()` method has been removed. If you really need to, you can use `setAttribute()`\n  instead.\n* The misspelled `Class_::VISIBILITY_MODIFER_MASK` constant has been dropped in favor of\n  `Class_::VISIBILITY_MODIFIER_MASK`.\n* The XML serializer has been removed. As such, the classes `Serializer\\XML`, and\n  `Unserializer\\XML`, as well as the interfaces `Serializer` and `Unserializer` no longer exist.\n* The `BuilderAbstract` class has been removed. It's functionality is moved into `BuilderHelpers`.\n  However, this is an internal class and should not be used directly.\n\nVersion 3.1.5 (2018-02-28)\n--------------------------\n\n### Fixed\n\n* Fixed duplicate comment assignment in switch statements. (#469)\n* Improve compatibility with PHP-Scoper. (#477)\n\nVersion 3.1.4 (2018-01-25)\n--------------------------\n\n### Fixed\n\n* Fixed pretty printing of `-(-$x)` and `+(+$x)`. (#459)\n\nVersion 3.1.3 (2017-12-26)\n--------------------------\n\n### Fixed\n\n* Improve compatibility with php-scoper, by supporting prefixed namespaces in\n  `NodeAbstract::getType()`.\n\nVersion 3.1.2 (2017-11-04)\n--------------------------\n\n### Fixed\n\n* Comments on empty blocks are now preserved on a `Stmt\\Nop` node. (#382)\n\n### Added\n\n* Added `kind` attribute for `Stmt\\Namespace_` node, which is one of `KIND_SEMICOLON` or\n  `KIND_BRACED`. (#417)\n* Added `setDocComment()` method to namespace builder. (#437)\n\nVersion 3.1.1 (2017-09-02)\n--------------------------\n\n### Fixed\n\n* Fixed syntax error on comment after brace-style namespace declaration. (#412)\n* Added support for TraitUse statements in trait builder. (#413)\n\nVersion 3.1.0 (2017-07-28)\n--------------------------\n\n### Added\n\n* [PHP 7.2] Added support for trailing comma in group use statements.\n* [PHP 7.2] Added support for `object` type. This means `object` types will now be represented as a\n  builtin type (a simple `\"object\"` string), rather than a class `Name`.\n\n### Fixed\n\n* Floating-point numbers are now printed correctly if the LC_NUMERIC locale uses a comma as decimal\n  separator.\n\n### Changed\n\n* `Name::$parts` is no longer deprecated.\n\nVersion 3.0.6 (2017-06-28)\n--------------------------\n\n### Fixed\n\n* Fixed the spelling of `Class_::VISIBILITY_MODIFIER_MASK`. The previous spelling of\n  `Class_::VISIBILITY_MODIFER_MASK` is preserved for backwards compatibility.\n* The pretty printing will now preserve comments inside array literals and function calls by\n  printing the array items / function arguments on separate lines. Array literals and functions that\n  do not contain comments are not affected.\n\n### Added\n\n* Added `Builder\\Param::makeVariadic()`.\n\n### Deprecated\n\n* The `Node::setLine()` method has been deprecated.\n\nVersion 3.0.5 (2017-03-05)\n--------------------------\n\n### Fixed\n\n* Name resolution of `NullableType`s is now performed earlier, so that a fully resolved signature is\n  available when a function is entered. (#360)\n* `Error` nodes are now considered empty, while previously they extended until the token where the\n  error occurred. This made some nodes larger than expected. (#359)\n* Fixed notices being thrown during error recovery in some situations. (#362)\n\nVersion 3.0.4 (2017-02-10)\n--------------------------\n\n### Fixed\n\n* Fixed some extensibility issues in pretty printer (`pUseType()` is now public and `pPrec()` calls\n  into `p()`, instead of directly dispatching to the type-specific printing method).\n* Fixed notice in `bin/php-parse` script.\n\n### Added\n\n* Error recovery from missing semicolons is now supported in more cases.\n* Error recovery from trailing commas in positions where PHP does not support them is now supported.\n\nVersion 3.0.3 (2017-02-03)\n--------------------------\n\n### Fixed\n\n* In `\"$foo[0]\"` the `0` is now parsed as an `LNumber` rather than `String`. (#325)\n* Ensure integers and floats are always pretty printed preserving semantics, even if the particular\n  value can only be manually constructed.\n* Throw a `LogicException` when trying to pretty-print an `Error` node. Previously this resulted in\n  an undefined method exception or fatal error.\n\n### Added\n\n* [PHP 7.1] Added support for negative interpolated offsets: `\"$foo[-1]\"`\n* Added `preserveOriginalNames` option to `NameResolver`. If this option is enabled, an\n  `originalName` attribute, containing the unresolved name, will be added to each resolved name.\n* Added `php-parse --with-positions` option, which dumps nodes with position information.\n\n### Deprecated\n\n* The XML serializer has been deprecated. In particular, the classes `Serializer\\XML`,\n  `Unserializer\\XML`, as well as the interfaces `Serializer` and `Unserializer` are deprecated.\n\nVersion 3.0.2 (2016-12-06)\n--------------------------\n\n### Fixed\n\n* Fixed name resolution of nullable types. (#324)\n* Fixed pretty-printing of nullable types.\n\nVersion 3.0.1 (2016-12-01)\n--------------------------\n\n### Fixed\n\n* Fixed handling of nested `list()`s: If the nested list was unkeyed, it was directly included in\n  the list items. If it was keyed, it was wrapped in `ArrayItem`. Now nested `List_` nodes are\n  always wrapped in `ArrayItem`s. (#321)\n\nVersion 3.0.0 (2016-11-30)\n--------------------------\n\n### Added\n\n* Added support for dumping node positions in the NodeDumper through the `dumpPositions` option.\n* Added error recovery support for `$`, `new`, `Foo::`.\n\nVersion 3.0.0-beta2 (2016-10-29)\n--------------------------------\n\nThis release primarily improves our support for error recovery.\n\n### Added\n\n* Added `Node::setDocComment()` method.\n* Added `Error::getMessageWithColumnInfo()` method.\n* Added support for recovery from lexer errors.\n* Added support for recovering from \"special\" errors (i.e. non-syntax parse errors).\n* Added precise location information for lexer errors.\n* Added `ErrorHandler` interface, and `ErrorHandler\\Throwing` and `ErrorHandler\\Collecting` as\n  specific implementations. These provide a general mechanism for handling error recovery.\n* Added optional `ErrorHandler` argument to `Parser::parse()`, `Lexer::startLexing()` and\n  `NameResolver::__construct()`.\n* The `NameResolver` now adds a `namespacedName` attribute on name nodes that cannot be statically\n  resolved (unqualified unaliased function or constant names in namespaces).\n\n### Fixed\n\n* Fixed attribute assignment for `GroupUse` prefix and variables in interpolated strings.\n\n### Changed\n\n* The constants on `NameTraverserInterface` have been moved into the `NameTraverser` class.\n* Due to the error handling changes, the `Parser` interface and `Lexer` API have changed.\n* The emulative lexer now directly postprocesses tokens, instead of using `~__EMU__~` sequences.\n  This changes the protected API of the lexer.\n* The `Name::slice()` method now returns `null` for empty slices, previously `new Name([])` was\n  used. `Name::concat()` now also supports concatenation with `null`.\n\n### Removed\n\n* Removed `Name::append()` and `Name::prepend()`. These mutable methods have been superseded by\n  the immutable `Name::concat()`.\n* Removed `Error::getRawLine()` and `Error::setRawLine()`. These methods have been superseded by\n  `Error::getStartLine()` and `Error::setStartLine()`.\n* Removed support for node cloning in the `NodeTraverser`.\n* Removed `$separator` argument from `Name::toString()`.\n* Removed `throw_on_error` parser option and `Parser::getErrors()` method. Use the `ErrorHandler`\n  mechanism instead.\n\nVersion 3.0.0-beta1 (2016-09-16)\n--------------------------------\n\n### Added\n\n* [7.1] Function/method and parameter builders now support PHP 7.1 type hints (void, iterable and\n  nullable types).\n* Nodes and Comments now implement `JsonSerializable`. The node kind is stored in a `nodeType`\n  property.\n* The `InlineHTML` node now has an `hasLeadingNewline` attribute, that specifies whether the\n  preceding closing tag contained a newline. The pretty printer honors this attribute.\n* Partial parsing of `$obj->` (with missing property name) is now supported in error recovery mode.\n* The error recovery mode is now exposed in the `php-parse` script through the `--with-recovery`\n  or `-r` flags.\n\nThe following changes are also part of PHP-Parser 2.1.1:\n\n* The PHP 7 parser will now generate a parse error for `$var =& new Obj` assignments.\n* Comments on free-standing code blocks will now be retained as comments on the first statement in\n  the code block.\n\nVersion 3.0.0-alpha1 (2016-07-25)\n---------------------------------\n\n### Added\n\n* [7.1] Added support for `void` and `iterable` types. These will now be represented as strings\n  (instead of `Name` instances) similar to other builtin types.\n* [7.1] Added support for class constant visibility. The `ClassConst` node now has a `flags` subnode\n  holding the visibility modifier, as well as `isPublic()`, `isProtected()` and `isPrivate()`\n  methods. The constructor changed to accept the additional subnode.\n* [7.1] Added support for nullable types. These are represented using a new `NullableType` node\n  with a single `type` subnode.\n* [7.1] Added support for short array destructuring syntax. This means that `Array` nodes may now\n  appear as the left-hand-side of assignments and foreach value targets. Additionally the array\n  items may now contain `null` values if elements are skipped.\n* [7.1] Added support for keys in list() destructuring. The `List` subnode `vars` has been renamed\n  to `items` and now contains `ArrayItem`s instead of plain variables.\n* [7.1] Added support for multi-catch. The `Catch` subnode `type` has been renamed to `types` and\n  is now an array of `Name`s.\n* `Name::slice()` now supports lengths and negative offsets. This brings it in line with\n  `array_slice()` functionality.\n\n### Changed\n\nDue to PHP 7.1 support additions described above, the node structure changed as follows:\n\n* `void` and `iterable` types are now stored as strings if the PHP 7 parser is used.\n* The `ClassConst` constructor changed to accept an additional `flags` subnode.\n* The `Array` subnode `items` may now contain `null` elements (destructuring).\n* The `List` subnode `vars` has been renamed to `items` and now contains `ArrayItem`s instead of\n  plain variables.\n* The `Catch` subnode `type` has been renamed to `types` and is now an array of `Name`s.\n\nAdditionally the following changes were made:\n\n* The `type` subnode on `Class`, `ClassMethod` and `Property` has been renamed to `flags`. The\n  `type` subnode has retained for backwards compatibility and is populated to the same value as\n  `flags`. However, writes to `type` will not update `flags`.\n* The `TryCatch` subnode `finallyStmts` has been replaced with a `finally` subnode that holds an\n  explicit `Finally` node. This allows for more accurate attribute assignment.\n* The `Trait` constructor now has the same form as the `Class` and `Interface` constructors: It\n  takes an array of subnodes. Unlike classes/interfaces, traits can only have a `stmts` subnode.\n* The `NodeDumper` now prints class/method/property/constant modifiers, as well as the include and\n  use type in a textual representation, instead of only showing the number.\n* All methods on `PrettyPrinter\\Standard` are now protected. Previously most of them were public.\n\n### Removed\n\n* Removed support for running on PHP 5.4. It is however still possible to parse PHP 5.2-5.4 code\n  while running on a newer version.\n* The deprecated `Comment::setLine()` and `Comment::setText()` methods have been removed.\n* The deprecated `Name::set()`, `Name::setFirst()` and `Name::setLast()` methods have been removed.\n\nVersion 2.1.1 (2016-09-16)\n--------------------------\n\n### Changed\n\n* The pretty printer will now escape all control characters in the range `\\x00-\\x1F` inside double\n  quoted strings. If no special escape sequence is available, an octal escape will be used.\n* The quality of the error recovery has been improved. In particular unterminated expressions should\n  be handled more gracefully.\n* The PHP 7 parser will now generate a parse error for `$var =& new Obj` assignments.\n* Comments on free-standing code blocks will no be retained as comments on the first statement in\n  the code block.\n\nVersion 2.1.0 (2016-04-19)\n--------------------------\n\n### Fixed\n\n* Properly support `B\"\"` strings (with uppercase `B`) in a number of places.\n* Fixed reformatting of indented parts in a certain non-standard comment style.\n\n### Added\n\n* Added `dumpComments` option to node dumper, to enable dumping of comments associated with nodes.\n* Added `Stmt\\Nop` node, that is used to collect comments located at the end of a block or at the\n  end of a file (without a following node with which they could otherwise be associated).\n* Added `kind` attribute to `Expr\\Exit` to distinguish between `exit` and `die`.\n* Added `kind` attribute to `Scalar\\LNumber` to distinguish between decimal, binary, octal and\n  hexadecimal numbers.\n* Added `kind` attribute to `Expr\\Array` to distinguish between `array()` and `[]`.\n* Added `kind` attribute to `Scalar\\String` and `Scalar\\Encapsed` to distinguish between\n  single-quoted, double-quoted, heredoc and nowdoc string.\n* Added `docLabel` attribute to `Scalar\\String` and `Scalar\\Encapsed`, if it is a heredoc or\n  nowdoc string.\n* Added start file offset information to `Comment` nodes.\n* Added `setReturnType()` method to function and method builders.\n* Added `-h` and `--help` options to `php-parse` script.\n\n### Changed\n\n* Invalid octal literals now throw a parse error in PHP 7 mode.\n* The pretty printer takes all the new attributes mentioned in the previous section into account.\n* The protected `AbstractPrettyPrinter::pComments()` method no longer returns a trailing newline.\n* The bundled autoloader supports library files being stored in a different directory than\n  `PhpParser` for easier downstream distribution.\n\n### Deprecated\n\n* The `Comment::setLine()` and `Comment::setText()` methods have been deprecated. Construct new\n  objects instead.\n\n### Removed\n\n* The internal (but public) method `Scalar\\LNumber::parse()` has been removed. A non-internal\n  `LNumber::fromString()` method has been added instead.\n\nVersion 2.0.1 (2016-02-28)\n--------------------------\n\n### Fixed\n\n* `declare() {}` and `declare();` are not semantically equivalent and will now result in different\n  ASTs. The format case will have an empty `stmts` array, while the latter will set `stmts` to\n  `null`.\n* Magic constants are now supported as semi-reserved keywords.\n* A shebang line like `#!/usr/bin/env php` is now allowed at the start of a namespaced file.\n  Previously this generated an exception.\n* The `prettyPrintFile()` method will not strip a trailing `?>` from the raw data that follows a\n  `__halt_compiler()` statement.\n* The `prettyPrintFile()` method will not strip an opening `<?php` if the file starts with a\n  comment followed by InlineHTML.\n\nVersion 2.0.0 (2015-12-04)\n--------------------------\n\n### Changed\n\n* String parts of encapsed strings are now represented using `Scalar\\EncapsStringPart` nodes.\n  Previously raw strings were used. This affects the `parts` child of `Scalar\\Encaps` and\n  `Expr\\ShellExec`. The change has been done to allow assignment of attributes to encapsed string\n  parts.\n\nVersion 2.0.0-beta1 (2015-10-21)\n--------------------------------\n\n### Fixed\n\n* Fixed issue with too many newlines being stripped at the end of heredoc/nowdoc strings in some\n  cases. (#227)\n\n### Changed\n\n* Update group use support to be in line with recent PHP 7.0 builds.\n* Renamed `php-parse.php` to `php-parse` and registered it as a composer bin.\n* Use composer PSR-4 autoloader instead of custom autoloader.\n* Specify phpunit as a dev dependency.\n\n### Added\n\n* Added `shortArraySyntax` option to pretty printer, to print all arrays using short syntax.\n\nVersion 2.0.0-alpha1 (2015-07-14)\n---------------------------------\n\nA more detailed description of backwards incompatible changes can be found in the\n[upgrading guide](UPGRADE-2.0.md).\n\n### Removed\n\n* Removed support for running on PHP 5.3. It is however still possible to parse PHP 5.2 and PHP 5.3\n  code while running on a newer version.\n* Removed legacy class name aliases. This includes the old non-namespaced class names and the old\n  names for classes that were renamed for PHP 7 compatibility.\n* Removed support for legacy node format. All nodes must have a `getSubNodeNames()` method now.\n\n### Added\n\n* Added support for remaining PHP 7 features that were not present in 1.x:\n  * Group use declarations. These are represented using `Stmt\\GroupUse` nodes. Furthermore a `type`\n    attribute was added to `Stmt\\UseUse` to handle mixed group use declarations.\n  * Uniform variable syntax.\n  * Generalized yield operator.\n  * Scalar type declarations. These are presented using `'bool'`, `'int'`, `'float'` and `'string'`\n    as the type. The PHP 5 parser also accepts these, however they'll be `Name` instances there.\n  * Unicode escape sequences.\n* Added `PhpParser\\ParserFactory` class, which should be used to create parser instances.\n* Added `Name::concat()` which concatenates two names.\n* Added `Name->slice()` which takes a subslice of a name.\n\n### Changed\n\n* `PhpParser\\Parser` is now an interface, implemented by `Parser\\Php5`, `Parser\\Php7` and\n  `Parser\\Multiple`. The `Multiple` parser will try multiple parsers, until one succeeds.\n* Token constants are now defined on `PhpParser\\Parser\\Tokens` rather than `PhpParser\\Parser`.\n* The `Name->set()`, `Name->append()`, `Name->prepend()` and `Name->setFirst()` methods are\n  deprecated in favor of `Name::concat()` and `Name->slice()`.\n* The `NodeTraverser` no longer clones nodes by default. The old behavior can be restored by\n  passing `true` to the constructor.\n* The constructor for `Scalar` nodes no longer has a default value. E.g. `new LNumber()` should now\n  be written as `new LNumber(0)`.\n\n---\n\n**This changelog only includes changes from the 2.0 series. For older changes see the\n[1.x series changelog](https://github.com/nikic/PHP-Parser/blob/1.x/CHANGELOG.md) and the\n[0.9 series changelog](https://github.com/nikic/PHP-Parser/blob/0.9/CHANGELOG.md).**\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "## Coding Style\n\nThis project uses PSR-12 with consistent brace placement. This means that the opening brace is\nalways on the same line, even for class and method declarations.\n\n## Tools\n\nThis project uses PHP-CS-Fixer and PHPStan. You can invoke them using `make`:\n\n```shell\nmake php-cs-fixer\nmake phpstan\n```\n\n## Adding support for new PHP syntax\n\n1. If necessary, add emulation support for new tokens.\n   * Add a new subclass of `Lexer\\TokenEmulator`. Take inspiration from existing classes.\n   * Add the new class to the array in `Lexer\\Emulative`.\n   * Add tests for the emulation in `Lexer\\EmulativeTest`. You'll want to modify\n     `provideTestReplaceKeywords()` for new reserved keywords and `provideTestLexNewFeatures()` for\n     other emulations.\n2. Add any new node classes that are needed.\n3. Add support for the new syntax in `grammar/php.y`. Regenerate the parser by running\n   `php grammar/rebuildParsers.php`. Use `--debug` if there are conflicts.\n4. Add pretty-printing support by implementing a `pFooBar()` method in `PrettyPrinter\\Standard`.\n5. Add tests both in `test/code/parser` and `test/code/prettyPrinter`.\n6. Add support for formatting-preserving pretty-printing. This is done by modifying the data tables\n   at the end of `PrettyPrinterAbstract`. Add a test in `test/code/formatPreservation`.\n7. Does the new syntax feature namespaced names? If so, add support for name resolution in\n   `NodeVisitor\\NameResolver`. Test it in `NodeVisitor\\NameResolverTest`.\n8. Does the new syntax require any changes to builders? Is so, make them :)\n"
  },
  {
    "path": "LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2011, Nikita Popov\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n   contributors may be used to endorse or promote products derived from\n   this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "Makefile",
    "content": ".PHONY: phpstan php-cs-fixer\n\ntools/vendor:\n\tcomposer install -d tools\n\nphpstan: tools/vendor\n\tphp tools/vendor/bin/phpstan\n\nphp-cs-fixer: tools/vendor\n\tphp tools/vendor/bin/php-cs-fixer fix\n\ntests:\n\tphp vendor/bin/phpunit"
  },
  {
    "path": "README.md",
    "content": "PHP Parser\n==========\n\n[![Coverage Status](https://coveralls.io/repos/github/nikic/PHP-Parser/badge.svg?branch=master)](https://coveralls.io/github/nikic/PHP-Parser?branch=master)\n\nThis is a PHP parser written in PHP. Its purpose is to simplify static code analysis and\nmanipulation.\n\n[**Documentation for version 5.x**][doc_master] (current; for running on PHP >= 7.4; for parsing PHP 7.0 to PHP 8.4, with limited support for parsing PHP 5.x).\n\n[Documentation for version 4.x][doc_4_x] (supported; for running on PHP >= 7.0; for parsing PHP 5.2 to PHP 8.3).\n\nFeatures\n--------\n\nThe main features provided by this library are:\n\n * Parsing PHP 7, and PHP 8 code into an abstract syntax tree (AST).\n   * Invalid code can be parsed into a partial AST.\n   * The AST contains accurate location information.\n * Dumping the AST in human-readable form.\n * Converting an AST back to PHP code.\n   * Formatting can be preserved for partially changed ASTs.\n * Infrastructure to traverse and modify ASTs.\n * Resolution of namespaced names.\n * Evaluation of constant expressions.\n * Builders to simplify AST construction for code generation.\n * Converting an AST into JSON and back.\n\nQuick Start\n-----------\n\nInstall the library using [composer](https://getcomposer.org):\n\n    php composer.phar require nikic/php-parser\n\nParse some PHP code into an AST and dump the result in human-readable form:\n\n```php\n<?php\nuse PhpParser\\Error;\nuse PhpParser\\NodeDumper;\nuse PhpParser\\ParserFactory;\n\n$code = <<<'CODE'\n<?php\n\nfunction test($foo)\n{\n    var_dump($foo);\n}\nCODE;\n\n$parser = (new ParserFactory())->createForNewestSupportedVersion();\ntry {\n    $ast = $parser->parse($code);\n} catch (Error $error) {\n    echo \"Parse error: {$error->getMessage()}\\n\";\n    return;\n}\n\n$dumper = new NodeDumper;\necho $dumper->dump($ast) . \"\\n\";\n```\n\nThis dumps an AST looking something like this:\n\n```\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: foo\n                )\n                default: null\n            )\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name(\n                        name: var_dump\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Expr_Variable(\n                                name: foo\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n```\n\nLet's traverse the AST and perform some kind of modification. For example, drop all function bodies:\n\n```php\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt\\Function_;\nuse PhpParser\\NodeTraverser;\nuse PhpParser\\NodeVisitorAbstract;\n\n$traverser = new NodeTraverser();\n$traverser->addVisitor(new class extends NodeVisitorAbstract {\n    public function enterNode(Node $node) {\n        if ($node instanceof Function_) {\n            // Clean out the function body\n            $node->stmts = [];\n        }\n    }\n});\n\n$ast = $traverser->traverse($ast);\necho $dumper->dump($ast) . \"\\n\";\n```\n\nThis gives us an AST where the `Function_::$stmts` are empty:\n\n```\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: foo\n                )\n                default: null\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n```\n\nFinally, we can convert the new AST back to PHP code:\n\n```php\nuse PhpParser\\PrettyPrinter;\n\n$prettyPrinter = new PrettyPrinter\\Standard;\necho $prettyPrinter->prettyPrintFile($ast);\n```\n\nThis gives us our original code, minus the `var_dump()` call inside the function:\n\n```php\n<?php\n\nfunction test($foo)\n{\n}\n```\n\nFor a more comprehensive introduction, see the documentation.\n\nDocumentation\n-------------\n\n 1. [Introduction](doc/0_Introduction.markdown)\n 2. [Usage of basic components](doc/2_Usage_of_basic_components.markdown)\n\nComponent documentation:\n\n * [Walking the AST](doc/component/Walking_the_AST.markdown)\n   * Node visitors\n   * Modifying the AST from a visitor\n   * Short-circuiting traversals\n   * Interleaved visitors\n   * Simple node finding API\n   * Parent and sibling references\n * [Name resolution](doc/component/Name_resolution.markdown)\n   * Name resolver options\n   * Name resolution context\n * [Pretty printing](doc/component/Pretty_printing.markdown)\n   * Converting AST back to PHP code\n   * Customizing formatting\n   * Formatting-preserving code transformations\n * [AST builders](doc/component/AST_builders.markdown)\n   * Fluent builders for AST nodes\n * [Lexer](doc/component/Lexer.markdown)\n   * Emulation\n   * Tokens, positions and attributes\n * [Error handling](doc/component/Error_handling.markdown)\n   * Column information for errors\n   * Error recovery (parsing of syntactically incorrect code)\n * [Constant expression evaluation](doc/component/Constant_expression_evaluation.markdown)\n   * Evaluating constant/property/etc initializers\n   * Handling errors and unsupported expressions\n * [JSON representation](doc/component/JSON_representation.markdown)\n   * JSON encoding and decoding of ASTs\n * [Performance](doc/component/Performance.markdown)\n   * Disabling Xdebug\n   * Reusing objects\n   * Garbage collection impact\n * [Frequently asked questions](doc/component/FAQ.markdown)\n   * Parent and sibling references\n\n [doc_3_x]: https://github.com/nikic/PHP-Parser/tree/3.x/doc\n [doc_4_x]: https://github.com/nikic/PHP-Parser/tree/4.x/doc\n [doc_master]: https://github.com/nikic/PHP-Parser/tree/master/doc\n"
  },
  {
    "path": "UPGRADE-1.0.md",
    "content": "Upgrading from PHP-Parser 0.9 to 1.0\n====================================\n\n### PHP version requirements\n\nPHP-Parser now requires PHP 5.3 or newer to run. It is however still possible to *parse* PHP 5.2 source code, while\nrunning on a newer version.\n\n### Move to namespaced names\n\nThe library has been moved to use namespaces with the `PhpParser` vendor prefix. However, the old names using\nunderscores are still available as aliases, as such most code should continue running on the new version without\nfurther changes.\n\nOld (still works, but discouraged):\n\n```php\n$parser = new \\PHPParser_Parser(new \\PHPParser_Lexer_Emulative);\n$prettyPrinter = new \\PHPParser_PrettyPrinter_Default;\n```\n\nNew:\n\n```php\n$parser = new \\PhpParser\\Parser(new PhpParser\\Lexer\\Emulative);\n$prettyPrinter = new \\PhpParser\\PrettyPrinter\\Standard;\n```\n\nNote that the `PHPParser` prefix was changed to `PhpParser`. While PHP class names are technically case-insensitive,\nthe autoloader will not be able to load `PHPParser\\Parser` or other case variants.\n\nDue to conflicts with reserved keywords, some class names now end with an underscore, e.g. `PHPParser_Node_Stmt_Class`\nis now `PhpParser\\Node\\Stmt\\Class_`. (But as usual, the old name is still available.)\n\n### Changes to `Node::getType()`\n\nThe `Node::getType()` method continues to return names using underscores instead of namespace separators and also does\nnot contain the trailing underscore that may be present in the class name. As such its output will not change in many\ncases.\n\nHowever, some node classes have been moved to a different namespace or renamed, which will result in a different\n`Node::getType()` output:\n\n```\nExpr_AssignBitwiseAnd => Expr_AssignOp_BitwiseAnd\nExpr_AssignBitwiseOr  => Expr_AssignOp_BitwiseOr\nExpr_AssignBitwiseXor => Expr_AssignOp_BitwiseXor\nExpr_AssignConcat     => Expr_AssignOp_Concat\nExpr_AssignDiv        => Expr_AssignOp_Div\nExpr_AssignMinus      => Expr_AssignOp_Minus\nExpr_AssignMod        => Expr_AssignOp_Mod\nExpr_AssignMul        => Expr_AssignOp_Mul\nExpr_AssignPlus       => Expr_AssignOp_Plus\nExpr_AssignShiftLeft  => Expr_AssignOp_ShiftLeft\nExpr_AssignShiftRight => Expr_AssignOp_ShiftRight\n\nExpr_BitwiseAnd       => Expr_BinaryOp_BitwiseAnd\nExpr_BitwiseOr        => Expr_BinaryOp_BitwiseOr\nExpr_BitwiseXor       => Expr_BinaryOp_BitwiseXor\nExpr_BooleanAnd       => Expr_BinaryOp_BooleanAnd\nExpr_BooleanOr        => Expr_BinaryOp_BooleanOr\nExpr_Concat           => Expr_BinaryOp_Concat\nExpr_Div              => Expr_BinaryOp_Div\nExpr_Equal            => Expr_BinaryOp_Equal\nExpr_Greater          => Expr_BinaryOp_Greater\nExpr_GreaterOrEqual   => Expr_BinaryOp_GreaterOrEqual\nExpr_Identical        => Expr_BinaryOp_Identical\nExpr_LogicalAnd       => Expr_BinaryOp_LogicalAnd\nExpr_LogicalOr        => Expr_BinaryOp_LogicalOr\nExpr_LogicalXor       => Expr_BinaryOp_LogicalXor\nExpr_Minus            => Expr_BinaryOp_Minus\nExpr_Mod              => Expr_BinaryOp_Mod\nExpr_Mul              => Expr_BinaryOp_Mul\nExpr_NotEqual         => Expr_BinaryOp_NotEqual\nExpr_NotIdentical     => Expr_BinaryOp_NotIdentical\nExpr_Plus             => Expr_BinaryOp_Plus\nExpr_ShiftLeft        => Expr_BinaryOp_ShiftLeft\nExpr_ShiftRight       => Expr_BinaryOp_ShiftRight\nExpr_Smaller          => Expr_BinaryOp_Smaller\nExpr_SmallerOrEqual   => Expr_BinaryOp_SmallerOrEqual\n\nScalar_ClassConst     => Scalar_MagicConst_Class\nScalar_DirConst       => Scalar_MagicConst_Dir\nScalar_FileConst      => Scalar_MagicConst_File\nScalar_FuncConst      => Scalar_MagicConst_Function\nScalar_LineConst      => Scalar_MagicConst_Line\nScalar_MethodConst    => Scalar_MagicConst_Method\nScalar_NSConst        => Scalar_MagicConst_Namespace\nScalar_TraitConst     => Scalar_MagicConst_Trait\n```\n\nThese changes may affect custom pretty printers and code comparing the return value of `Node::getType()` to specific\nstrings.\n\n### Miscellaneous\n\n  * The classes `Template` and `TemplateLoader` have been removed. You should use some other [code generation][code_gen]\n    project built on top of PHP-Parser instead.\n\n  * The `PrettyPrinterAbstract::pStmts()` method now emits a leading newline if the statement list is not empty.\n    Custom pretty printers should remove the explicit newline before `pStmts()` calls.\n\n    Old:\n\n    ```php\n    public function pStmt_Trait(PHPParser_Node_Stmt_Trait $node) {\n        return 'trait ' . $node->name\n             . \"\\n\" . '{' . \"\\n\" . $this->pStmts($node->stmts) . \"\\n\" . '}';\n    }\n    ```\n\n    New:\n\n    ```php\n    public function pStmt_Trait(Stmt\\Trait_ $node) {\n        return 'trait ' . $node->name\n             . \"\\n\" . '{' . $this->pStmts($node->stmts) . \"\\n\" . '}';\n    }\n    ```\n\n  [code_gen]: https://github.com/nikic/PHP-Parser/wiki/Projects-using-the-PHP-Parser#code-generation"
  },
  {
    "path": "UPGRADE-2.0.md",
    "content": "Upgrading from PHP-Parser 1.x to 2.0\n====================================\n\n### PHP version requirements\n\nPHP-Parser now requires PHP 5.4 or newer to run. It is however still possible to *parse* PHP 5.2 and\nPHP 5.3 source code, while running on a newer version.\n\n### Creating a parser instance\n\nParser instances should now be created through the `ParserFactory`. Old direct instantiation code\nwill not work, because the parser class was renamed.\n\nOld:\n\n```php\nuse PhpParser\\Parser, PhpParser\\Lexer;\n$parser = new Parser(new Lexer\\Emulative);\n```\n\nNew:\n\n```php\nuse PhpParser\\ParserFactory;\n$parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7);\n```\n\nThe first argument to `ParserFactory` determines how different PHP versions are handled. The\npossible values are:\n\n * `ParserFactory::PREFER_PHP7`: Try to parse code as PHP 7. If this fails, try to parse it as PHP 5.\n * `ParserFactory::PREFER_PHP5`: Try to parse code as PHP 5. If this fails, try to parse it as PHP 7.\n * `ParserFactory::ONLY_PHP7`: Parse code as PHP 7.\n * `ParserFactory::ONLY_PHP5`: Parse code as PHP 5.\n\nFor most practical purposes the difference between `PREFER_PHP7` and `PREFER_PHP5` is mainly whether\na scalar type hint like `string` will be stored as `'string'` (PHP 7) or as `new Name('string')`\n(PHP 5).\n\nTo use a custom lexer, pass it as the second argument to the `create()` method:\n\n```php\nuse PhpParser\\ParserFactory;\n$lexer = new MyLexer;\n$parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7, $lexer);\n```\n\n### Rename of the `PhpParser\\Parser` class\n\n`PhpParser\\Parser` is now an interface, which is implemented by `Parser\\Php5`, `Parser\\Php7` and\n`Parser\\Multiple`. Parser tokens are now defined in `Parser\\Tokens`. If you use the `ParserFactory`\ndescribed above to create your parser instance, these changes should have no further impact on you.\n\n### Removal of legacy aliases\n\nAll legacy aliases for classes have been removed. This includes the old non-namespaced `PHPParser_`\nclasses, as well as the classes that had to be renamed for PHP 7 support.\n\n### Deprecations\n\nThe `set()`, `setFirst()`, `append()` and `prepend()` methods of the `Node\\Name` class have been\ndeprecated. Instead `Name::concat()` and `Name->slice()` should be used.\n\n### Miscellaneous\n\n* The `NodeTraverser` no longer clones nodes by default. If you want to restore the old behavior,\n  pass `true` to the constructor.\n* The legacy node format has been removed. If you use custom nodes, they are now expected to\n  implement a `getSubNodeNames()` method.\n* The default value for `Scalar` node constructors was removed. This means that something like\n  `new LNumber()` should be replaced by `new LNumber(0)`.\n* String parts of encapsed strings are now represented using `Scalar\\EncapsStringPart` nodes, while\n  previously raw strings were used. This affects the `parts` child of `Scalar\\Encaps` and\n  `Expr\\ShellExec`."
  },
  {
    "path": "UPGRADE-3.0.md",
    "content": "Upgrading from PHP-Parser 2.x to 3.0\n====================================\n\nThe backwards-incompatible changes in this release may be summarized as follows:\n\n * The specific details of the node representation have changed in some cases, primarily to\n   accommodate new PHP 7.1 features.\n * There have been significant changes to the error recovery implementation. This may affect you,\n   if you used the error recovery mode or have a custom lexer implementation.\n * A number of deprecated methods were removed.\n\n### PHP version requirements\n\nPHP-Parser now requires PHP 5.5 or newer to run. It is however still possible to *parse* PHP 5.2,\n5.3 and 5.4 source code, while running on a newer version.\n\n### Changes to the node structure\n\nThe following changes are likely to require code changes if the respective nodes are used:\n\n * The `List` subnode `vars` has been renamed to `items` and now contains `ArrayItem`s instead of\n   plain variables.\n * The `Catch` subnode `type` has been renamed to `types` and is now an array of `Name`s.\n * The `TryCatch` subnode `finallyStmts` has been replaced with a `finally` subnode that holds an\n   explicit `Finally` node.\n * The `type` subnode on `Class`, `ClassMethod` and `Property` has been renamed to `flags`. The\n   `type` subnode has retained for backwards compatibility and is populated to the same value as\n   `flags`. However, writes to `type` will not update `flags` and use of `type` is discouraged.\n\nThe following changes are unlikely to require code changes:\n\n * The `ClassConst` constructor changed to accept an additional `flags` subnode.\n * The `Trait` constructor now has the same form as the `Class` and `Interface` constructors: It\n   takes an array of subnodes. Unlike classes/interfaces, traits can only have a `stmts` subnode.\n * The `Array` subnode `items` may now contain `null` elements (due to destructuring).\n * `void` and `iterable` types are now stored as strings if the PHP 7 parser is used. Previously\n   these would have been represented as `Name` instances.\n\n### Changes to error recovery mode\n\nPreviously, error recovery mode was enabled by setting the `throwOnError` option to `false` when\ncreating the parser, while collected errors were retrieved using the `getErrors()` method:\n\n```php\n$lexer = ...;\n$parser = (new ParserFactory)->create(ParserFactor::ONLY_PHP7, $lexer, [\n    'throwOnError' => true,\n]);\n\n$stmts = $parser->parse($code);\n$errors = $parser->getErrors();\nif ($errors) {\n    handleErrors($errors);\n}\nprocessAst($stmts);\n```\n\nBoth the `throwOnError` option and the `getErrors()` method have been removed in PHP-Parser 3.0.\nInstead an instance of `ErrorHandler\\Collecting` should be passed to the `parse()` method:\n\n```php\n$lexer = ...;\n$parser = (new ParserFactory)->create(ParserFactor::ONLY_PHP7, $lexer);\n\n$errorHandler = new ErrorHandler\\Collecting;\n$stmts = $parser->parse($code, $errorHandler);\nif ($errorHandler->hasErrors()) {\n    handleErrors($errorHandler->getErrors());\n}\nprocessAst($stmts);\n```\n\n#### Multiple parser fallback in error recovery mode\n\nAs a result of this change, if a `Multiple` parser is used (e.g. through the `ParserFactory` using\n`PREFER_PHP7` or `PREFER_PHP5`), it will now return the result of the first *non-throwing* parse. As\nparsing never throws in error recovery mode, the result from the first parser will always be\nreturned.\n\nThe PHP 7 parser is a superset of the PHP 5 parser, with the exceptions that `=& new` and\n`global $$foo->bar` are not supported (other differences are in representation only). The PHP 7\nparser will be able to recover from the error in both cases. For this reason, this change will\nlikely pass unnoticed if you do not specifically test for this syntax.\n\nIt is possible to restore the precise previous behavior with the following code:\n\n```php\n$lexer = ...;\n$parser7 = new Parser\\Php7($lexer);\n$parser5 = new Parser\\Php5($lexer);\n\n$errors7 = new ErrorHandler\\Collecting();\n$stmts7 = $parser7->parse($code, $errors7);\nif ($errors7->hasErrors()) {\n    $errors5 = new ErrorHandler\\Collecting();\n    $stmts5 = $parser5->parse($code, $errors5);\n    if (!$errors5->hasErrors()) {\n        // If PHP 7 parse has errors but PHP 5 parse has no errors, use PHP 5 result\n        return [$stmts5, $errors5];\n    }\n}\n// If PHP 7 succeeds or both fail use PHP 7 result\nreturn [$stmts7, $errors7];\n```\n\n#### Error handling in the lexer\n\nIn order to support recovery from lexer errors, the signature of the `startLexing()` method changed\nto optionally accept an `ErrorHandler`:\n\n```php\n// OLD\npublic function startLexing($code);\n// NEW\npublic function startLexing($code, ErrorHandler $errorHandler = null);\n```\n\nIf you use a custom lexer with overridden `startLexing()` method, it needs to be changed to accept\nthe extra parameter. The value should be passed on to the parent method.\n\n#### Error checks in node constructors\n\nThe constructors of certain nodes used to contain additional checks for semantic errors, such as\ncreating a try block without either catch or finally. These checks have been moved from the node\nconstructors into the parser. This allows recovery from such errors, as well as representing the\nresulting (invalid) AST.\n\nThis means that certain error conditions are no longer checked for manually constructed nodes.\n\n### Removed methods, arguments, options\n\nThe following methods, arguments or options have been removed:\n\n * `Comment::setLine()`, `Comment::setText()`: Create new `Comment` instances instead.\n * `Name::set()`, `Name::setFirst()`, `Name::setLast()`, `Name::append()`, `Name::prepend()`:\n    Use `Name::concat()` in combination with `Name::slice()` instead.\n * `Error::getRawLine()`, `Error::setRawLine()`. Use `Error::getStartLine()` and\n   `Error::setStartLine()` instead.\n * `Parser::getErrors()`. Use `ErrorHandler\\Collecting` instead.\n * `$separator` argument of `Name::toString()`. Use `strtr()` instead, if you really need it.\n * `$cloneNodes` argument of `NodeTraverser::__construct()`. Explicitly clone nodes in the visitor\n   instead.\n * `throwOnError` parser option. Use `ErrorHandler\\Collecting` instead.\n\n### Miscellaneous\n\n * The `NameResolver` will now resolve unqualified function and constant names in the global\n   namespace into fully qualified names. For example `foo()` in the global namespace resolves to\n   `\\foo()`. For names where no static resolution is possible, a `namespacedName` attribute is\n   added now, containing the namespaced variant of the name.\n * All methods on `PrettyPrinter\\Standard` are now protected. Previously most of them were public.\n   The pretty printer should only be invoked using the `prettyPrint()`, `prettyPrintFile()` and\n   `prettyPrintExpr()` methods.\n * The node dumper now prints numeric values that act as enums/flags in a string representation.\n   If node dumper results are used in tests, updates may be needed to account for this.\n * The constants on `NameTraverserInterface` have been moved into the `NameTraverser` class.\n * The emulative lexer now directly postprocesses tokens, instead of using `~__EMU__~` sequences.\n   This changes the protected API of the emulative lexer.\n * The `Name::slice()` method now returns `null` for empty slices, previously `new Name([])` was\n   used. `Name::concat()` now also supports concatenation with `null`.\n"
  },
  {
    "path": "UPGRADE-4.0.md",
    "content": "Upgrading from PHP-Parser 3.x to 4.0\n====================================\n\n### PHP version requirements\n\nPHP-Parser now requires PHP 7.0 or newer to run. It is however still possible to *parse* PHP 5.2-5.6\nsource code, while running on a newer version.\n\nHHVM is no longer actively supported.\n\n### Changes to the node structure\n\n* Many subnodes that previously held simple strings now store `Identifier` nodes instead (or\n  `VarLikeIdentifier` nodes if they have form `$ident`). The constructors of the affected nodes will\n  automatically convert strings to `Identifier`s and `Identifier`s implement `__toString()`. As such\n  some code continues to work without changes, but anything using `is_string()`, type-strict\n  comparisons or strict-mode may require adjustment. The following is an exhaustive list of all\n  affected subnodes:\n\n   * `Const_::$name`\n   * `NullableType::$type` (for simple types)\n   * `Param::$type` (for simple types)\n   * `Expr\\ClassConstFetch::$name`\n   * `Expr\\Closure::$returnType` (for simple types)\n   * `Expr\\MethodCall::$name`\n   * `Expr\\PropertyFetch::$name`\n   * `Expr\\StaticCall::$name`\n   * `Expr\\StaticPropertyFetch::$name` (uses `VarLikeIdentifier`)\n   * `Stmt\\Class_::$name`\n   * `Stmt\\ClassMethod::$name`\n   * `Stmt\\ClassMethod::$returnType` (for simple types)\n   * `Stmt\\Function_::$name`\n   * `Stmt\\Function_::$returnType` (for simple types)\n   * `Stmt\\Goto_::$name`\n   * `Stmt\\Interface_::$name`\n   * `Stmt\\Label::$name`\n   * `Stmt\\PropertyProperty::$name` (uses `VarLikeIdentifier`)\n   * `Stmt\\TraitUseAdaptation\\Alias::$method`\n   * `Stmt\\TraitUseAdaptation\\Alias::$newName`\n   * `Stmt\\TraitUseAdaptation\\Precedence::$method`\n   * `Stmt\\Trait_::$name`\n   * `Stmt\\UseUse::$alias`\n\n* Expression statements (`expr;`) are now represented using a `Stmt\\Expression` node. Previously\n  these statements were directly represented as their constituent expression.\n* The `name` subnode of `Param` has been renamed to `var` and now contains a `Variable` rather than\n  a plain string.\n* The `name` subnode of `StaticVar` has been renamed to `var` and now contains a `Variable` rather\n  than a plain string.\n* The `var` subnode of `ClosureUse` now contains a `Variable` rather than a plain string.\n* The `var` subnode of `Catch_` now contains a `Variable` rather than a plain string.\n* The `alias` subnode of `UseUse` is now `null` if no explicit alias is given. As such,\n  `use Foo\\Bar` and `use Foo\\Bar as Bar` are now represented differently. The `getAlias()` method\n  can be used to get the effective alias, even if it is not explicitly given.\n\n### Miscellaneous\n\n* The indentation handling in the pretty printer has been changed (this is only relevant if you\n  extend the pretty printer). Previously indentation was automatic, and parts were excluded using\n  `pNoindent()`. Now no-indent is the default and newlines that require indentation should use\n  `$this->nl`.\n\n### Removed functionality\n\n* Removed `type` subnode on `Class_`, `ClassMethod` and `Property` nodes. Use `flags` instead.\n* The `ClassConst::isStatic()` method has been removed. Constants cannot have a static modifier.\n* The `NodeTraverser` no longer accepts `false` as a return value from a `leaveNode()` method.\n  `NodeTraverser::REMOVE_NODE` should be returned instead.\n* The `Node::setLine()` method has been removed. If you really need to, you can use `setAttribute()`\n  instead.\n* The misspelled `Class_::VISIBILITY_MODIFER_MASK` constant has been dropped in favor of\n  `Class_::VISIBILITY_MODIFIER_MASK`.\n* The XML serializer has been removed. As such, the classes `Serializer\\XML`, and\n  `Unserializer\\XML`, as well as the interfaces `Serializer` and `Unserializer` no longer exist.\n* The `BuilderAbstract` class has been removed. It's functionality is moved into `BuilderHelpers`.\n  However, this is an internal class and should not be used directly.\n* The `Autoloader` class has been removed in favor of relying on the Composer autoloader.\n"
  },
  {
    "path": "UPGRADE-5.0.md",
    "content": "Upgrading from PHP-Parser 4.x to 5.0\n====================================\n\n### PHP version requirements\n\nPHP-Parser now requires PHP 7.4 or newer to run. It is however still possible to *parse* code for older versions, while running on a newer version.\n\n### PHP 5 parsing support\n\nThe dedicated parser for PHP 5 has been removed. The PHP 7 parser now accepts a `PhpVersion` argument, which can be used to improve compatibility with older PHP versions.\n\nIn particular, if an older `PhpVersion` is specified, then:\n\n * For versions before PHP 7.0, `$foo =& new Bar()` assignments are allowed without error.\n * For versions before PHP 7.0, invalid octal literals `089` are allowed without error.\n * For versions before PHP 7.0, unicode escape sequences `\\u{123}` in strings are not parsed.\n * Type hints are interpreted as a class `Name` or as a built-in `Identifier` depending on PHP\n   version, for example `int` is treated as a class name on PHP 5.6 and as a built-in on PHP 7.0.\n\nHowever, some aspects of PHP 5 parsing are no longer supported:\n\n * Some variables like `$$foo[0]` are valid in both PHP 5 and PHP 7, but have different interpretation. In that case, the PHP 7 AST will always be constructed (`($$foo)[0]` rather than `${$foo[0]}`).\n * Declarations of the form `global $$var[0]` are not supported in PHP 7 and will cause a parse error. In error recovery mode, it is possible to continue parsing after such declarations.\n * The PHP 7 parser will accept many constructs that are not valid in PHP 5. However, this was also true of the dedicated PHP 5 parser.\n\nThe following symbols are affected by this removal:\n\n * The `PhpParser\\Parser\\Php5` class has been removed.\n * The `PhpParser\\Parser\\Multiple` class has been removed. While not strictly related to PHP 5 support, this functionality is no longer useful without it.\n * The `PhpParser\\ParserFactory::ONLY_PHP5` and `PREFER_PHP5` options have been removed.\n\n### Changes to the parser factory\n\nThe `ParserFactory::create()` method has been removed in favor of three new methods that provide more fine-grained control over the PHP version being targeted:\n\n * `createForNewestSupportedVersion()`: Use this if you don't know the PHP version of the code you're parsing. It's better to assume a too new version than a too old one.\n * `createForHostVersion()`: Use this if you're parsing code for the PHP version you're running on.\n * `createForVersion()`: Use this if you know the PHP version of the code you want to parse.\n\nThe `createForNewestSupportedVersion()` and `createForHostVersion()` are available since PHP-Parser 4.18.0, to allow libraries to support PHP-Parser 4 and 5 at the same time more easily.\n\nIn all cases, the PHP version is a fairly weak hint that is only used on a best-effort basis. The parser will usually accept code for newer versions if it does not have any backwards-compatibility implications.\n\nFor example, if you specify version `\"8.0\"`, then `class ReadOnly {}` is treated as a valid class declaration, while using `public readonly int $prop` will lead to a parse error. However, `final public const X = Y;` will be accepted in both cases.\n\n```php\nuse PhpParser\\ParserFactory;\nuse PhpParser\\PhpVersion;\n\n$factory = new ParserFactory();\n\n# Before\n$parser = $factory->create(ParserFactory::PREFER_PHP7);\n\n# After (this is roughly equivalent to PREFER_PHP7 behavior)\n$parser = $factory->createForNewestSupportedVersion();\n# Or\n$parser = $factory->createForHostVersion();\n\n# Before\n$parser = $factory->create(ParserFactory::ONLY_PHP5);\n# After (supported on a best-effort basis)\n$parser = $factory->createForVersion(PhpVersion::fromString(\"5.6\"));\n```\n\n### Changes to the throw representation\n\nPreviously, `throw` statements like `throw $e;` were represented using the `Stmt\\Throw_` class,\nwhile uses inside other expressions (such as `$x ?? throw $e`) used the `Expr\\Throw_` class.\n\nNow, `throw $e;` is represented as a `Stmt\\Expression` that contains an `Expr\\Throw_`. The\n`Stmt\\Throw_` class has been removed.\n\n```php\n# Code\nthrow $e;\n\n# Before\nStmt_Throw(\n    expr: Expr_Variable(\n        name: e\n    )\n)\n\n# After\nStmt_Expression(\n    expr: Expr_Throw(\n        expr: Expr_Variable(\n            name: e\n        )\n    )\n)\n```\n\n### Changes to the array destructuring representation\n\nPreviously, the `list($x) = $y` destructuring syntax was represented using a `Node\\Expr\\List_`\nnode, while `[$x] = $y` used a `Node\\Expr\\Array_` node, the same used for the creation (rather than\ndestructuring) of arrays.\n\nNow, destructuring is always represented using `Node\\Expr\\List_`. The `kind` attribute with value\n`Node\\Expr\\List_::KIND_LIST` or `Node\\Expr\\List_::KIND_ARRAY` specifies which syntax was actually\nused.\n\n```php\n# Code\n[$x] = $y;\n\n# Before\nExpr_Assign(\n   var: Expr_Array(\n       items: array(\n           0: Expr_ArrayItem(\n               key: null\n               value: Expr_Variable(\n                   name: x\n               )\n               byRef: false\n               unpack: false\n           )\n       )\n   )\n   expr: Expr_Variable(\n       name: y\n   )\n)\n\n# After\nExpr_Assign(\n   var: Expr_List(\n       items: array(\n           0: ArrayItem(\n               key: null\n               value: Expr_Variable(\n                   name: x\n               )\n               byRef: false\n               unpack: false\n           )\n       )\n   )\n   expr: Expr_Variable(\n       name: y\n   )\n)\n```\n\n### Changes to the name representation\n\nPreviously, `Name` nodes had a `parts` subnode, which stores an array of name parts, split by\nnamespace separators. Now, `Name` nodes instead have a `name` subnode, which stores a plain string.\n\nFor example, the name `Foo\\Bar` was previously represented by `Name(parts: ['Foo', 'Bar'])` and is\nnow represented by `Name(name: 'Foo\\Bar')` instead.\n\nIt is possible to convert the name to the previous representation using `$name->getParts()`. The\n`Name` constructor continues to accept both the string and the array representation.\n\nThe `Name::getParts()` method is available since PHP-Parser 4.16.0, to allow libraries to support\nPHP-Parser 4 and 5 at the same time more easily.\n\n### Changes to the block representation\n\nPreviously, code blocks `{ ... }` were always flattened into their parent statement list. For\nexample `while ($x) { $a; { $b; } $c; }` would produce the same node structure as\n`if ($x) { $a; $b; $c; }`, namely a `Stmt\\While_` node whose `stmts` subnode is an array of three\nstatements.\n\nNow, the nested `{ $b; }` block is represented using an explicit `Stmt\\Block` node. However, the\nouter `{ $a; { $b; } $c; }` block is still represented using a simple array in the `stmts` subnode.\n\n```php\n# Code\nwhile ($x) { $a; { $b; } $c; }\n\n# Before\nStmt_While(\n    cond: Expr_Variable(\n        name: x\n    )\n    stmts: array(\n        0: Stmt_Expression(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n        1: Stmt_Expression(\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n        2: Stmt_Expression(\n            expr: Expr_Variable(\n                name: c\n            )\n        )\n    )\n)\n\n# After\nStmt_While(\n    cond: Expr_Variable(\n        name: x\n    )\n    stmts: array(\n        0: Stmt_Expression(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n        1: Stmt_Block(\n            stmts: array(\n                0: Stmt_Expression(\n                    expr: Expr_Variable(\n                        name: b\n                    )\n                )\n            )\n        )\n        2: Stmt_Expression(\n            expr: Expr_Variable(\n                name: c\n            )\n        )\n    )\n)\n```\n\n### Changes to comment assignment\n\nPreviously, comments were assigned to all nodes starting at the same position. Now they will be\nassigned to the outermost node only.\n\n```php\n# Code\n// Comment\n$a + $b;\n\n# Before\nStmt_Expression(\n    expr: Expr_BinaryOp_Plus(\n        left: Expr_Variable(\n            name: a\n            comments: array(\n                0: // Comment\n            )\n        )\n        right: Expr_Variable(\n            name: b\n        )\n        comments: array(\n            0: // Comment\n        )\n    )\n    comments: array(\n        0: // Comment\n    )\n)\n\n# After\nStmt_Expression(\n    expr: Expr_BinaryOp_Plus(\n        left: Expr_Variable(\n            name: a\n        )\n        right: Expr_Variable(\n            name: b\n        )\n    )\n    comments: array(\n        0: // Comment\n    )\n)\n```\n\n### Renamed nodes\n\nA number of AST nodes have been renamed or moved in the AST hierarchy:\n\n * `Node\\Scalar\\LNumber` is now `Node\\Scalar\\Int_`.\n * `Node\\Scalar\\DNumber` is now `Node\\Scalar\\Float_`.\n * `Node\\Scalar\\Encapsed` is now `Node\\Scalar\\InterpolatedString`.\n * `Node\\Scalar\\EncapsedStringPart` is now `Node\\InterpolatedStringPart` and no longer extends\n   `Node\\Scalar` or `Node\\Expr`.\n * `Node\\Expr\\ArrayItem` is now `Node\\ArrayItem` and no longer extends `Node\\Expr`.\n * `Node\\Expr\\ClosureUse` is now `Node\\ClosureUse` and no longer extends `Node\\Expr`.\n * `Node\\Stmt\\DeclareDeclare` is now `Node\\DeclareItem` and no longer extends `Node\\Stmt`.\n * `Node\\Stmt\\PropertyProperty` is now `Node\\PropertyItem` and no longer extends `Node\\Stmt`.\n * `Node\\Stmt\\StaticVar` is now `Node\\StaticVar` and no longer extends `Node\\Stmt`.\n * `Node\\Stmt\\UseUse` is now `Node\\UseItem` and no longer extends `Node\\Stmt`.\n\nThe old class names have been retained as aliases for backwards compatibility. However, the `Node::getType()` method will now always return the new name (e.g. `ClosureUse` instead of `Expr_ClosureUse`).\n\n### Modifiers\n\nModifier flags (as used by the `$flags` subnode of `Class_`, `ClassMethod`, `Property`, etc.) are now available as class constants on a separate `PhpParser\\Modifiers` class, instead of being part of `PhpParser\\Node\\Stmt\\Class_`, to make it clearer that these are used by many different nodes. The old constants are deprecated, but are still available.\n\n```php\nPhpParser\\Node\\Stmt\\Class_::MODIFIER_PUBLIC    -> PhpParser\\Modifiers::PUBLIC\nPhpParser\\Node\\Stmt\\Class_::MODIFIER_PROTECTED -> PhpParser\\Modifiers::PROTECTED\nPhpParser\\Node\\Stmt\\Class_::MODIFIER_PRIVATE   -> PhpParser\\Modifiers::PRIVATE\nPhpParser\\Node\\Stmt\\Class_::MODIFIER_STATIC    -> PhpParser\\Modifiers::STATIC\nPhpParser\\Node\\Stmt\\Class_::MODIFIER_ABSTRACT  -> PhpParser\\Modifiers::ABSTRACT\nPhpParser\\Node\\Stmt\\Class_::MODIFIER_FINAL     -> PhpParser\\Modifiers::FINAL\nPhpParser\\Node\\Stmt\\Class_::MODIFIER_READONLY  -> PhpParser\\Modifiers::READONLY\nPhpParser\\Node\\Stmt\\Class_::VISIBILITY_MODIFIER_MASK -> PhpParser\\Modifiers::VISIBILITY_MASK\n```\n\n### Changes to node constructors\n\nNode constructor arguments accepting types no longer accept plain strings. Either an `Identifier` or `Name` (or `ComplexType`) should be passed instead. This affects the following constructor arguments:\n\n* The `'returnType'` key of `$subNodes` argument of `Node\\Expr\\ArrowFunction`.\n* The `'returnType'` key of `$subNodes` argument of `Node\\Expr\\Closure`.\n* The `'returnType'` key of `$subNodes` argument of `Node\\Stmt\\ClassMethod`.\n* The `'returnType'` key of `$subNodes` argument of `Node\\Stmt\\Function_`.\n* The `$type` argument of `Node\\NullableType`.\n* The `$type` argument of `Node\\Param`.\n* The `$type` argument of `Node\\Stmt\\Property`.\n* The `$type` argument of `Node\\ClassConst`.\n\nTo follow the previous behavior, an `Identifier` should be passed, which indicates a built-in type.\n\n### Changes to the pretty printer\n\nA number of changes to the standard pretty printer have been made, to make it match contemporary coding style conventions (and in particular PSR-12). Options to restore the previous behavior are not provided, but it is possible to override the formatting methods (such as `pStmt_ClassMethod`) with your preferred formatting.\n\nReturn types are now formatted without a space before the `:`:\n\n```php\n# Before\nfunction test() : Type\n{\n}\n\n# After\nfunction test(): Type\n{\n}\n```\n\n`abstract` and `final` are now printed before visibility modifiers:\n\n```php\n# Before\npublic abstract function test();\n\n# After\nabstract public function test();\n```\n\nA space is now printed between `use` and the following `(` for closures:\n\n```php\n# Before\nfunction () use($var) {\n};\n\n# After\nfunction () use ($var) {\n};\n```\n\nBackslashes in single-quoted strings are now only printed if they are necessary:\n\n```php\n# Before\n'Foo\\\\Bar';\n'\\\\\\\\';\n\n# After\n'Foo\\Bar';\n'\\\\\\\\';\n```\n\n`else if` structures will now omit redundant parentheses:\n\n```php\n# Before\nelse {\n    if ($x) {\n        // ...\n    }\n}\n\n# After\nelse if ($x) {\n     // ...\n}\n```\n\nThe pretty printer now accepts a `phpVersion` option, which accepts a `PhpVersion` object and defaults to PHP 7.4. The pretty printer will make formatting choices to make the code valid for that version. It currently controls the following behavior:\n\n* For PHP >= 7.0 (default), short array syntax `[]` will be used by default. This does not affect nodes that specify an explicit array syntax using the `kind` attribute.\n* For PHP >= 7.0 (default), parentheses around `yield` expressions will only be printed when necessary. Previously, parentheses were always printed, even if `yield` was used as a statement.\n* For PHP >= 7.1 (default), the short array syntax `[]` will be used for destructuring by default (instead of `list()`). This does not affect nodes that specify an explicit syntax using the `kind` attribute.\n* For PHP >= 7.3 (default), a newline is no longer forced after heredoc/nowdoc strings, as the requirement for this has been removed with the introduction of flexible heredoc/nowdoc strings.\n* For PHP >= 7.3 (default), heredoc/nowdoc strings are now indented just like regular code. This was allowed with the introduction of flexible heredoc/nowdoc strings.\n\n### Changes to precedence handling in the pretty printer\n\nThe pretty printer now more accurately models operator precedence. Especially for unary operators, less unnecessary parentheses will be printed. Conversely, many bugs where semantically meaningful parentheses were omitted have been fixed.\n\nTo support these changes, precedence is now handled differently in the pretty printer. The internal `p()` method, which is used to recursively print nodes, now has the following signature:\n```php\nprotected function p(\n    Node $node, int $precedence = self::MAX_PRECEDENCE, int $lhsPrecedence = self::MAX_PRECEDENCE,\n    bool $parentFormatPreserved = false\n): string;\n```\n\nThe `$precedence` is the precedence of the direct parent operator (if any), while `$lhsPrecedence` is that precedence of the nearest binary operator on whose left-hand-side the node occurs. For unary operators, only the `$lhsPrecedence` is relevant.\n\nRecursive calls in pretty-printer methods should generally continue calling `p()` without additional parameters. However, pretty-printer methods for operators that participate in precedence resolution need to be adjusted. For example, typical implementations for operators look as follows now:\n\n```php\nprotected function pExpr_BinaryOp_Plus(\n    BinaryOp\\Plus $node, int $precedence, int $lhsPrecedence\n): string {\n    return $this->pInfixOp(\n        BinaryOp\\Plus::class, $node->left, ' + ', $node->right, $precedence, $lhsPrecedence);\n}\n\nprotected function pExpr_UnaryPlus(\n    Expr\\UnaryPlus $node, int $precedence, int $lhsPrecedence\n): string {\n    return $this->pPrefixOp(Expr\\UnaryPlus::class, '+', $node->expr, $precedence, $lhsPrecedence);\n}\n```\n\nThe new `$precedence` and `$lhsPrecedence` arguments need to be passed down to the `pInfixOp()`, `pPrefixOp()` and `pPostfixOp()` methods.\n\n### Changes to the node traverser\n\nIf there are multiple visitors, the node traverser will now call `leaveNode()` and `afterTraverse()` methods in the reverse order of the corresponding `enterNode()` and `beforeTraverse()` calls:\n\n```php\n# Before\n$visitor1->enterNode($node);\n$visitor2->enterNode($node);\n$visitor1->leaveNode($node);\n$visitor2->leaveNode($node);\n\n# After\n$visitor1->enterNode($node);\n$visitor2->enterNode($node);\n$visitor2->leaveNode($node);\n$visitor1->leaveNode($node);\n```\n\nAdditionally, the special `NodeVisitor` return values have been moved from `NodeTraverser` to `NodeVisitor`. The old names are deprecated, but still available.\n\n```php\nPhpParser\\NodeTraverser::REMOVE_NODE -> PhpParser\\NodeVisitor::REMOVE_NODE\nPhpParser\\NodeTraverser::DONT_TRAVERSE_CHILDREN -> PhpParser\\NodeVisitor::DONT_TRAVERSE_CHILDREN\nPhpParser\\NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN -> PhpParser\\NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN\nPhpParser\\NodeTraverser::STOP_TRAVERSAL -> PhpParser\\NodeVisitor::STOP_TRAVERSAL\n```\n\nVisitors can now also be passed directly to the `NodeTraverser` constructor:\n\n```php\n# Before (and still supported)\n$traverser = new NodeTraverser();\n$traverser->addVisitor(new NameResolver());\n\n# After\n$traverser = new NodeTraverser(new NameResolver());\n```\n\n### Changes to token representation\n\nTokens are now internally represented using the `PhpParser\\Token` class, which exposes the same base interface as\nthe `PhpToken` class introduced in PHP 8.0. On PHP 8.0 or newer, `PhpParser\\Token` extends from `PhpToken`, otherwise\nit extends from a polyfill implementation. The most important parts of the interface may be summarized as follows:\n\n```php\nclass Token {\n    public int $id;\n    public string $text;\n    public int $line;\n    public int $pos;\n\n    public function is(int|string|array $kind): bool;\n}\n```\n\nThe token array is now an array of `Token`s, rather than an array of arrays and strings.\nAdditionally, the token array is now terminated by a sentinel token with ID 0.\n\n### Changes to the lexer\n\nThe lexer API is reduced to a single `Lexer::tokenize()` method, which returns an array of tokens. The `startLexing()` and `getNextToken()` methods have been removed.\n\nResponsibility for determining start and end attributes for nodes has been moved from the lexer to the parser. The lexer no longer accepts an options array. The `usedAttributes` option has been removed without replacement, and the parser will now unconditionally add the `comments`, `startLine`, `endLine`, `startFilePos`, `endFilePos`, `startTokenPos` and `endTokenPos` attributes.\n\nThere should no longer be a need to directly interact with the `Lexer` for end users, as the `ParserFactory` will create an appropriate instance, and no additional configuration of the lexer is necessary. To use formatting-preserving pretty printing, the setup boilerplate changes as follows:\n\n```php\n# Before\n\n$lexer = new Lexer\\Emulative([\n    'usedAttributes' => [\n        'comments',\n        'startLine', 'endLine',\n        'startTokenPos', 'endTokenPos',\n    ],\n]);\n\n$parser = new Parser\\Php7($lexer);\n$oldStmts = $parser->parse($code);\n$oldTokens = $lexer->getTokens();\n\n$traverser = new NodeTraverser();\n$traverser->addVisitor(new NodeVisitor\\CloningVisitor());\n$newStmts = $traverser->traverse($oldStmts);\n\n# After\n\n$parser = (new ParserFactory())->createForNewestSupportedVersion();\n$oldStmts = $parser->parse($code);\n$oldTokens = $parser->getTokens();\n\n$traverser = new NodeTraverser(new NodeVisitor\\CloningVisitor());\n$newStmts = $traverser->traverse($oldStmts);\n```\n\n### Miscellaneous changes\n\n * The deprecated `Builder\\Param::setTypeHint()` method has been removed in favor of `Builder\\Param::setType()`.\n * The deprecated `Error` constructor taking a start line has been removed. Pass `['startLine' => $startLine]` attributes instead.\n * The deprecated `Comment::getLine()`, `Comment::getTokenPos()` and `Comment::getFilePos()` methods have been removed. Use `Comment::getStartLine()`, `Comment::getStartTokenPos()` and `Comment::getStartFilePos()` instead.\n * `Comment::getReformattedText()` now normalizes CRLF newlines to LF newlines.\n * The `Node::getLine()` method has been deprecated. Use `Node::getStartLine()` instead.\n"
  },
  {
    "path": "bin/php-parse",
    "content": "#!/usr/bin/env php\n<?php\n\nforeach ([__DIR__ . '/../../../autoload.php', __DIR__ . '/../vendor/autoload.php'] as $file) {\n    if (file_exists($file)) {\n        require $file;\n        break;\n    }\n}\n\nini_set('xdebug.max_nesting_level', 3000);\n\n// Disable Xdebug var_dump() output truncation\nini_set('xdebug.var_display_max_children', -1);\nini_set('xdebug.var_display_max_data', -1);\nini_set('xdebug.var_display_max_depth', -1);\n\nlist($operations, $files, $attributes) = parseArgs($argv);\n\n/* Dump nodes by default */\nif (empty($operations)) {\n    $operations[] = 'dump';\n}\n\nif (empty($files)) {\n    showHelp(\"Must specify at least one file.\");\n}\n\n$parser = (new PhpParser\\ParserFactory())->createForVersion($attributes['version']);\n$dumper = new PhpParser\\NodeDumper([\n    'dumpComments' => true,\n    'dumpPositions' => $attributes['with-positions'],\n]);\n$prettyPrinter = new PhpParser\\PrettyPrinter\\Standard;\n\n$traverser = new PhpParser\\NodeTraverser();\n$traverser->addVisitor(new PhpParser\\NodeVisitor\\NameResolver);\n\nforeach ($files as $file) {\n    if ($file === '-') {\n        $code = file_get_contents('php://stdin');\n        fwrite(STDERR, \"====> Stdin:\\n\");\n    } else if (strpos($file, '<?php') === 0) {\n        $code = $file;\n        fwrite(STDERR, \"====> Code $code\\n\");\n    } else {\n        if (!file_exists($file)) {\n            fwrite(STDERR, \"File $file does not exist.\\n\");\n            exit(1);\n        }\n\n        $code = file_get_contents($file);\n        fwrite(STDERR, \"====> File $file:\\n\");\n    }\n\n    if ($attributes['with-recovery']) {\n        $errorHandler = new PhpParser\\ErrorHandler\\Collecting;\n        $stmts = $parser->parse($code, $errorHandler);\n        foreach ($errorHandler->getErrors() as $error) {\n            $message = formatErrorMessage($error, $code, $attributes['with-column-info']);\n            fwrite(STDERR, $message . \"\\n\");\n        }\n        if (null === $stmts) {\n            continue;\n        }\n    } else {\n        try {\n            $stmts = $parser->parse($code);\n        } catch (PhpParser\\Error $error) {\n            $message = formatErrorMessage($error, $code, $attributes['with-column-info']);\n            fwrite(STDERR, $message . \"\\n\");\n            exit(1);\n        }\n    }\n\n    foreach ($operations as $operation) {\n        if ('dump' === $operation) {\n            fwrite(STDERR, \"==> Node dump:\\n\");\n            echo $dumper->dump($stmts, $code), \"\\n\";\n        } elseif ('pretty-print' === $operation) {\n            fwrite(STDERR, \"==> Pretty print:\\n\");\n            echo $prettyPrinter->prettyPrintFile($stmts), \"\\n\";\n        } elseif ('json-dump' === $operation) {\n            fwrite(STDERR, \"==> JSON dump:\\n\");\n            echo json_encode($stmts, JSON_PRETTY_PRINT), \"\\n\";\n        } elseif ('var-dump' === $operation) {\n            fwrite(STDERR, \"==> var_dump():\\n\");\n            var_dump($stmts);\n        } elseif ('resolve-names' === $operation) {\n            fwrite(STDERR, \"==> Resolved names.\\n\");\n            $stmts = $traverser->traverse($stmts);\n        }\n    }\n}\n\nfunction formatErrorMessage(PhpParser\\Error $e, $code, $withColumnInfo) {\n    if ($withColumnInfo && $e->hasColumnInfo()) {\n        return $e->getMessageWithColumnInfo($code);\n    } else {\n        return $e->getMessage();\n    }\n}\n\nfunction showHelp($error = '') {\n    if ($error) {\n        fwrite(STDERR, $error . \"\\n\\n\");\n    }\n    fwrite($error ? STDERR : STDOUT, <<<'OUTPUT'\nUsage: php-parse [operations] file1.php [file2.php ...]\n   or: php-parse [operations] \"<?php code\"\nTurn PHP source code into an abstract syntax tree.\n\nOperations is a list of the following options (--dump by default):\n\n    -d, --dump              Dump nodes using NodeDumper\n    -p, --pretty-print      Pretty print file using PrettyPrinter\\Standard\n    -j, --json-dump         Print json_encode() result\n        --var-dump          var_dump() nodes (for exact structure)\n    -N, --resolve-names     Resolve names using NodeVisitor\\NameResolver\n    -c, --with-column-info  Show column-numbers for errors (if available)\n    -P, --with-positions    Show positions in node dumps\n    -r, --with-recovery     Use parsing with error recovery\n        --version=VERSION   Target specific PHP version (default: newest)\n    -h, --help              Display this page\n\nExample:\n    php-parse -d -p -N -d file.php\n\n    Dumps nodes, pretty prints them, then resolves names and dumps them again.\n\n\nOUTPUT\n    );\n    exit($error ? 1 : 0);\n}\n\nfunction parseArgs($args) {\n    $operations = [];\n    $files = [];\n    $attributes = [\n        'with-column-info' => false,\n        'with-positions' => false,\n        'with-recovery' => false,\n        'version' => PhpParser\\PhpVersion::getNewestSupported(),\n    ];\n\n    array_shift($args);\n    $parseOptions = true;\n    foreach ($args as $arg) {\n        if (!$parseOptions) {\n            $files[] = $arg;\n            continue;\n        }\n\n        switch ($arg) {\n            case '--dump':\n            case '-d':\n                $operations[] = 'dump';\n                break;\n            case '--pretty-print':\n            case '-p':\n                $operations[] = 'pretty-print';\n                break;\n            case '--json-dump':\n            case '-j':\n                $operations[] = 'json-dump';\n                break;\n            case '--var-dump':\n                $operations[] = 'var-dump';\n                break;\n            case '--resolve-names':\n            case '-N':\n                $operations[] = 'resolve-names';\n                break;\n            case '--with-column-info':\n            case '-c':\n                $attributes['with-column-info'] = true;\n                break;\n            case '--with-positions':\n            case '-P':\n                $attributes['with-positions'] = true;\n                break;\n            case '--with-recovery':\n            case '-r':\n                $attributes['with-recovery'] = true;\n                break;\n            case '--help':\n            case '-h':\n                showHelp();\n                break;\n            case '--':\n                $parseOptions = false;\n                break;\n            default:\n                if (preg_match('/^--version=(.*)$/', $arg, $matches)) {\n                    $attributes['version'] = PhpParser\\PhpVersion::fromString($matches[1]);\n                } elseif ($arg[0] === '-' && \\strlen($arg[0]) > 1) {\n                    showHelp(\"Invalid operation $arg.\");\n                } else {\n                    $files[] = $arg;\n                }\n        }\n    }\n\n    return [$operations, $files, $attributes];\n}\n"
  },
  {
    "path": "composer.json",
    "content": "{\n    \"name\": \"nikic/php-parser\",\n    \"type\": \"library\",\n    \"description\": \"A PHP parser written in PHP\",\n    \"keywords\": [\n        \"php\",\n        \"parser\"\n    ],\n    \"license\": \"BSD-3-Clause\",\n    \"authors\": [\n        {\n            \"name\": \"Nikita Popov\"\n        }\n    ],\n    \"require\": {\n        \"php\": \">=7.4\",\n        \"ext-tokenizer\": \"*\",\n        \"ext-json\": \"*\",\n        \"ext-ctype\": \"*\"\n    },\n    \"require-dev\": {\n        \"phpunit/phpunit\": \"^9.0\",\n        \"ircmaxell/php-yacc\": \"^0.0.7\"\n    },\n    \"extra\": {\n        \"branch-alias\": {\n            \"dev-master\": \"5.x-dev\"\n        }\n    },\n    \"autoload\": {\n        \"psr-4\": {\n            \"PhpParser\\\\\": \"lib/PhpParser\"\n        }\n    },\n    \"autoload-dev\": {\n        \"psr-4\": {\n            \"PhpParser\\\\\": \"test/PhpParser/\"\n        }\n    },\n    \"bin\": [\n        \"bin/php-parse\"\n    ]\n}\n"
  },
  {
    "path": "doc/0_Introduction.markdown",
    "content": "Introduction\n============\n\nThis project is a PHP parser **written in PHP itself**.\n\nWhat is this for?\n-----------------\n\nA parser is useful for [static analysis][0], manipulation of code and basically any other\napplication dealing with code programmatically. A parser constructs an [Abstract Syntax Tree][1]\n(AST) of the code and thus allows dealing with it in an abstract and robust way.\n\nThere are other ways of processing source code. One that PHP supports natively is using the\ntoken stream generated by [`token_get_all`][2]. The token stream is much more low level than\nthe AST and thus has different applications: It allows to also analyze the exact formatting of\na file. On the other hand, the token stream is much harder to deal with for more complex analysis.\nFor example, an AST abstracts away the fact that, in PHP, variables can be written as `$foo`, but also\nas `$$bar`, `${'foobar'}` or even `${!${''}=barfoo()}`. You don't have to worry about recognizing\nall the different syntaxes from a stream of tokens.\n\nAnother question is: Why would I want to have a PHP parser *written in PHP*? Well, PHP might not be\na language especially suited for fast parsing, but processing the AST is much easier in PHP than it\nwould be in other, faster languages like C. Furthermore the people most likely wanting to do\nprogrammatic PHP code analysis are incidentally PHP developers, not C developers.\n\nWhat can it parse?\n------------------\n\nThe parser supports parsing PHP 7 and PHP 8 code, with the following exceptions:\n\n * Namespaced names containing whitespace (e.g. `Foo \\ Bar` instead of `Foo\\Bar`) are not supported.\n   These are illegal in PHP 8, but are legal in earlier versions. However, PHP-Parser does not\n   support them for any version.\n\nPHP-Parser 4.x had full support for parsing PHP 5. PHP-Parser 5.x has only limited support, with the\nfollowing caveats:\n\n * Some variable expressions like `$$foo[0]` are valid in both PHP 5 and PHP 7, but have different \n   interpretation. In such cases, the PHP 7 AST will always be constructed (using `($$foo)[0]`\n   rather than `${$foo[0]}`).\n * Declarations of the form `global $$var[0]` are not supported in PHP 7 and will cause a parse \n   error. In error recovery mode, it is possible to continue parsing after such declarations.\n\nAs the parser is based on the tokens returned by `token_get_all` (which is only able to lex the PHP\nversion it runs on), additionally a wrapper for emulating tokens from newer versions is provided.\nThis allows to parse PHP 8.4 source code running on PHP 7.4, for example. This emulation is not\nperfect, but works well in practice.\n\nFinally, it should be noted that the parser aims to accept all valid code, not reject all invalid\ncode. It will generally accept code that is only valid in newer versions (even when targeting an\nolder one), and accept code that is syntactically correct, but would result in a compiler error.\n\nWhat output does it produce?\n----------------------------\n\nThe parser produces an [Abstract Syntax Tree][1] (AST) also known as a node tree. How this looks\ncan best be seen in an example. The program `<?php echo 'Hi', 'World';` will give you a node tree\nroughly looking like this:\n\n```\narray(\n    0: Stmt_Echo(\n        exprs: array(\n            0: Scalar_String(\n                value: Hi\n            )\n            1: Scalar_String(\n                value: World\n            )\n        )\n    )\n)\n```\n\nThis matches the structure of the code: An echo statement, which takes two strings as expressions,\nwith the values `Hi` and `World`.\n\nYou can also see that the AST does not contain any whitespace information (but most comments are saved).\nHowever, it does retain accurate position information, which can be used to inspect precise formatting.\n\nWhat else can it do?\n--------------------\n\nApart from the parser itself, this package also bundles support for some other, related features:\n\n * Support for pretty printing, which is the act of converting an AST into PHP code. Please note\n   that \"pretty printing\" does not imply that the output is especially pretty. It's just how it's\n   called ;)\n * Support for serializing and unserializing the node tree to JSON.\n * Support for dumping the node tree in a human-readable form (see the section above for an\n   example of how the output looks like).\n * Infrastructure for traversing and changing the AST (node traverser and node visitors).\n * A node visitor for resolving namespaced names.\n\n [0]: http://en.wikipedia.org/wiki/Static_program_analysis\n [1]: http://en.wikipedia.org/wiki/Abstract_syntax_tree\n [2]: http://php.net/token_get_all\n"
  },
  {
    "path": "doc/2_Usage_of_basic_components.markdown",
    "content": "Usage of basic components\n=========================\n\nThis document explains how to use the parser, the pretty printer and the node traverser.\n\nBootstrapping\n-------------\n\nTo bootstrap the library, include the autoloader generated by composer:\n\n```php\nrequire 'path/to/vendor/autoload.php';\n```\n\nAdditionally, you may want to set the `xdebug.max_nesting_level` ini option to a higher value:\n\n```php\nini_set('xdebug.max_nesting_level', 3000);\n```\n\nThis ensures that there will be no errors when traversing highly nested node trees. However, it is\npreferable to disable Xdebug completely, as it can easily make this library more than five times\nslower.\n\nParsing\n-------\n\nIn order to parse code, you first have to create a parser instance:\n\n```php\nuse PhpParser\\ParserFactory;\nuse PhpParser\\PhpVersion;\n\n// Parser for the version you are running on.\n$parser = (new ParserFactory())->createForHostVersion();\n\n// Parser for the newest PHP version supported by the PHP-Parser library.\n$parser = (new ParserFactory())->createForNewestSupportedVersion();\n\n// Parser for a specific PHP version.\n$parser = (new ParserFactory())->createForVersion(PhpVersion::fromString('8.1'));\n```\n\nWhich version you should target depends on your use case. In many cases you will want to use the\nhost version, as people typically analyze code for the version they are running on. However, when\nanalyzing arbitrary code you are usually best off using the newest supported version, which tends\nto accept the widest range of code (unless there are breaking changes in PHP).\n\nThe `createXYZ()` methods optionally accept an array of lexer options. Some use cases that require\ncustomized lexer options are discussed in the [lexer documentation](component/Lexer.markdown).\n\nSubsequently, you can pass PHP code (including the opening `<?php` tag) to the `parse()` method in\norder to create a syntax tree. If a syntax error is encountered, a `PhpParser\\Error` exception will\nbe thrown by default:\n\n```php\n<?php\nuse PhpParser\\Error;\nuse PhpParser\\ParserFactory;\n\n$code = <<<'CODE'\n<?php\nfunction printLine($msg) {\n    echo $msg, \"\\n\";\n}\nprintLine('Hello World!!!');\nCODE;\n\n$parser = (new ParserFactory())->createForHostVersion();\n\ntry {\n    $stmts = $parser->parse($code);\n    // $stmts is an array of statement nodes\n} catch (Error $e) {\n    echo 'Parse Error: ', $e->getMessage(), \"\\n\";\n}\n```\n\nA parser instance can be reused to parse multiple files.\n\nNode dumping\n------------\n\nTo dump the abstract syntax tree in human-readable form, a `NodeDumper` can be used:\n\n```php\n<?php\nuse PhpParser\\NodeDumper;\n\n$nodeDumper = new NodeDumper;\necho $nodeDumper->dump($stmts), \"\\n\";\n```\n\nFor the sample code from the previous section, this will produce the following output:\n\n```\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: printLine\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: msg\n                )\n                default: null\n            )\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Echo(\n                exprs: array(\n                    0: Expr_Variable(\n                        name: msg\n                    )\n                    1: Scalar_String(\n                        value:\n\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: printLine\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_String(\n                        value: Hello World!!!\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n)\n```\n\nYou can also use the `php-parse` script to obtain such a node dump by calling it either with a file\nname or code string:\n\n```sh\nvendor/bin/php-parse file.php\nvendor/bin/php-parse \"<?php foo();\"\n```\n\nThis can be very helpful if you want to quickly check how certain syntax is represented in the AST.\n\nNode tree structure\n-------------------\n\nLooking at the node dump above, you can see that `$stmts` for this example code is an array of two\nnodes, a `Stmt_Function` and a `Stmt_Expression`. The corresponding class names are:\n\n * `Stmt_Function -> PhpParser\\Node\\Stmt\\Function_`\n * `Stmt_Expression -> PhpParser\\Node\\Stmt\\Expression`\n\nThe additional `_` at the end of the first class name is necessary, because `Function` is a\nreserved keyword. Many node class names in this library have a trailing `_` to avoid clashing with\na keyword.\n\nAs PHP is a large language there are approximately 140 different nodes. In order to make working\nwith them easier they are grouped into three categories:\n\n * `PhpParser\\Node\\Stmt`s are statement nodes, i.e. language constructs that do not return\n   a value and can not occur in an expression. For example a class definition is a statement.\n   It doesn't return a value, and you can't write something like `func(class A {});`.\n * `PhpParser\\Node\\Expr`s are expression nodes, i.e. language constructs that return a value\n   and thus can occur in other expressions. Examples of expressions are `$var`\n   (`PhpParser\\Node\\Expr\\Variable`) and `func()` (`PhpParser\\Node\\Expr\\FuncCall`).\n * `PhpParser\\Node\\Scalar`s are nodes representing scalar values, like `'string'`\n   (`PhpParser\\Node\\Scalar\\String_`), `0` (`PhpParser\\Node\\Scalar\\LNumber`) or magic constants\n   like `__FILE__` (`PhpParser\\Node\\Scalar\\MagicConst\\File`). All `PhpParser\\Node\\Scalar`s extend\n   `PhpParser\\Node\\Expr`, as scalars are expressions, too.\n * There are some nodes not in either of these groups, for example names (`PhpParser\\Node\\Name`)\n   and call arguments (`PhpParser\\Node\\Arg`).\n\nThe `Node\\Stmt\\Expression` node is somewhat confusing in that it contains both the terms \"statement\"\nand \"expression\". This node distinguishes `expr`, which is a `Node\\Expr`, from `expr;`, which is\nan \"expression statement\" represented by `Node\\Stmt\\Expression` and containing `expr` as a sub-node.\n\nEvery node has a (possibly zero) number of subnodes. You can access subnodes by writing\n`$node->subNodeName`. The `Stmt\\Echo_` node has only one subnode `exprs`. So in order to access it\nin the above example you would write `$stmts[0]->exprs`. If you wanted to access the name of the function\ncall, you would write `$stmts[0]->exprs[1]->name`.\n\nAll nodes also define a `getType()` method that returns the node type. The type is the class name\nwithout the `PhpParser\\Node\\` prefix and `\\` replaced with `_`. It also does not contain a trailing\n`_` for reserved-keyword class names.\n\nIt is possible to associate custom metadata with a node using the `setAttribute()` method. This data\ncan then be retrieved using `hasAttribute()`, `getAttribute()` and `getAttributes()`.\n\nBy default, the parser adds the `startLine`, `endLine`, `startTokenPos`, `endTokenPos`,\n`startFilePos`, `endFilePos` and `comments` attributes. `comments` is an array of\n`PhpParser\\Comment[\\Doc]` instances.\n\nThe pre-defined attributes can also be accessed using `getStartLine()` instead of\n`getAttribute('startLine')`, and so on. The last doc comment from the `comments` attribute can be\nobtained using `getDocComment()`.\n\nPretty printer\n--------------\n\nThe pretty printer component compiles the AST back to PHP code according to a specified scheme.\nCurrently, there is only one scheme available, namely `PhpParser\\PrettyPrinter\\Standard`.\n\n```php\nuse PhpParser\\Error;\nuse PhpParser\\ParserFactory;\nuse PhpParser\\PrettyPrinter;\n\n$code = \"<?php echo 'Hi ', hi\\\\getTarget();\";\n\n$parser = (new ParserFactory())->createForHostVersion();\n$prettyPrinter = new PrettyPrinter\\Standard();\n\ntry {\n    // parse\n    $stmts = $parser->parse($code);\n\n    // change\n    $stmts[0]         // the echo statement\n          ->exprs     // sub expressions\n          [0]         // the first of them (the string node)\n          ->value     // it's value, i.e. 'Hi '\n          = 'Hello '; // change to 'Hello '\n\n    // pretty print\n    $code = $prettyPrinter->prettyPrint($stmts);\n\n    echo $code;\n} catch (Error $e) {\n    echo 'Parse Error: ', $e->getMessage(), \"\\n\";\n}\n```\n\nThe above code will output:\n\n    echo 'Hello ', hi\\getTarget();\n\nAs you can see, the source code was first parsed using `PhpParser\\Parser->parse()`, then changed and then\nagain converted to code using `PhpParser\\PrettyPrinter\\Standard->prettyPrint()`.\n\nThe `prettyPrint()` method pretty prints a statements array. It is also possible to pretty print only a\nsingle expression using `prettyPrintExpr()`.\n\nThe `prettyPrintFile()` method can be used to print an entire file. This will include the opening `<?php` tag\nand handle inline HTML as the first/last statement more gracefully.\n\nThere is also a pretty-printing mode which retains formatting for parts of the AST that have not\nbeen changed, which requires additional setup.\n\n> Read more: [Pretty printing documentation](component/Pretty_printing.markdown)\n\nNode traversal\n--------------\n\nThe above pretty printing example used the fact that the source code was known and thus it was easy to\nwrite code that accesses a certain part of a node tree and changes it. Normally this is not the case.\nUsually you want to change / analyze code in a generic way, where you don't know how the node tree is\ngoing to look like.\n\nFor this purpose the parser provides a component for traversing and visiting the node tree. The basic\nstructure of a program using this `PhpParser\\NodeTraverser` looks like this:\n\n```php\nuse PhpParser\\NodeTraverser;\nuse PhpParser\\ParserFactory;\nuse PhpParser\\PrettyPrinter;\n\n$parser        = (new ParserFactory())->createForHostVersion();\n$traverser     = new NodeTraverser;\n$prettyPrinter = new PrettyPrinter\\Standard;\n\n// add your visitor\n$traverser->addVisitor(new MyNodeVisitor);\n\ntry {\n    $code = file_get_contents($fileName);\n\n    // parse\n    $stmts = $parser->parse($code);\n\n    // traverse\n    $stmts = $traverser->traverse($stmts);\n\n    // pretty print\n    $code = $prettyPrinter->prettyPrintFile($stmts);\n\n    echo $code;\n} catch (PhpParser\\Error $e) {\n    echo 'Parse Error: ', $e->getMessage();\n}\n```\n\nThe corresponding node visitor might look like this:\n\n```php\nuse PhpParser\\Node;\nuse PhpParser\\NodeVisitorAbstract;\n\nclass MyNodeVisitor extends NodeVisitorAbstract {\n    public function leaveNode(Node $node) {\n        if ($node instanceof Node\\Scalar\\String_) {\n            $node->value = 'foo';\n        }\n    }\n}\n```\n\nThe above node visitor would change all string literals in the program to `'foo'`.\n\nAll visitors must implement the `PhpParser\\NodeVisitor` interface, which defines the following four\nmethods:\n\n```php\npublic function beforeTraverse(array $nodes);\npublic function enterNode(\\PhpParser\\Node $node);\npublic function leaveNode(\\PhpParser\\Node $node);\npublic function afterTraverse(array $nodes);\n```\n\nThe `beforeTraverse()` method is called once before the traversal begins and is passed the nodes the\ntraverser was called with. This method can be used for resetting values before traversal or\npreparing the tree for traversal.\n\nThe `afterTraverse()` method is similar to the `beforeTraverse()` method, with the only difference that\nit is called once after the traversal.\n\nThe `enterNode()` and `leaveNode()` methods are called on every node, the former when it is entered,\ni.e. before its subnodes are traversed, the latter when it is left.\n\nAll four methods can either return the changed node or not return at all (i.e. `null`) in which\ncase the current node is not changed.\n\nThe `enterNode()` method can additionally return the value `NodeVisitor::DONT_TRAVERSE_CHILDREN`,\nwhich instructs the traverser to skip all children of the current node. To furthermore prevent subsequent\nvisitors from visiting the current node, `NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN` can be used instead.\n\nBoth methods can additionally return the following values:\n\n * `NodeVisitor::STOP_TRAVERSAL`, in which case no further nodes will be visited.\n * `NodeVisitor::REMOVE_NODE`, in which case the current node will be removed from the parent array.\n * `NodeVisitor::REPLACE_WITH_NULL`, in which case the current node will be replaced with `null`.\n * An array of nodes, which will be merged into the parent array at the offset of the current node.\n   I.e. if in `array(A, B, C)` the node `B` should be replaced with `array(X, Y, Z)` the result will\n   be `array(A, X, Y, Z, C)`.\n\nInstead of manually implementing the `NodeVisitor` interface you can also extend the `NodeVisitorAbstract`\nclass, which will define empty default implementations for all the above methods.\n\n> Read more: [Walking the AST](component/Walking_the_AST.markdown)\n\nThe NameResolver node visitor\n-----------------------------\n\nOne visitor that is already bundled with the package is `PhpParser\\NodeVisitor\\NameResolver`. This visitor\nhelps you work with namespaced code by trying to resolve most names to fully qualified ones.\n\nFor example, consider the following code:\n\n    use A as B;\n    new B\\C();\n\nIn order to know that `B\\C` really is `A\\C` you would need to track aliases and namespaces yourself.\nThe `NameResolver` takes care of that and resolves names as far as possible.\n\nAfter running it, most names will be fully qualified. The only names that will stay unqualified are\nunqualified function and constant names. These are resolved at runtime and thus the visitor can't\nknow which function they are referring to. In most cases this is a non-issue as the global functions\nare meant.\n\nAdditionally, the `NameResolver` adds a `namespacedName` subnode to class, function and constant\ndeclarations that contains the namespaced name instead of only the shortname that is available via\n`name`.\n\n> Read more: [Name resolution documentation](component/Name_resolution.markdown)\n\nExample: Converting namespaced code to pseudo namespaces\n--------------------------------------------------------\n\nA small example to understand the concept: We want to convert namespaced code to pseudo namespaces,\nso it works on 5.2, i.e. names like `A\\\\B` should be converted to `A_B`. Note that such conversions\nare fairly complicated if you take PHP's dynamic features into account, so our conversion will\nassume that no dynamic features are used.\n\nWe start off with the following base code:\n\n```php\nuse PhpParser\\ParserFactory;\nuse PhpParser\\PrettyPrinter;\nuse PhpParser\\NodeTraverser;\nuse PhpParser\\NodeVisitor\\NameResolver;\n\n$inDir  = '/some/path';\n$outDir = '/some/other/path';\n\n$parser        = (new ParserFactory())->createForNewestSupportedVersion();\n$traverser     = new NodeTraverser;\n$prettyPrinter = new PrettyPrinter\\Standard;\n\n$traverser->addVisitor(new NameResolver); // we will need resolved names\n$traverser->addVisitor(new NamespaceConverter); // our own node visitor\n\n// iterate over all .php files in the directory\n$files = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($inDir));\n$files = new \\RegexIterator($files, '/\\.php$/');\n\nforeach ($files as $file) {\n    try {\n        // read the file that should be converted\n        $code = file_get_contents($file->getPathName());\n\n        // parse\n        $stmts = $parser->parse($code);\n\n        // traverse\n        $stmts = $traverser->traverse($stmts);\n\n        // pretty print\n        $code = $prettyPrinter->prettyPrintFile($stmts);\n\n        // write the converted file to the target directory\n        file_put_contents(\n            substr_replace($file->getPathname(), $outDir, 0, strlen($inDir)),\n            $code\n        );\n    } catch (PhpParser\\Error $e) {\n        echo 'Parse Error: ', $e->getMessage();\n    }\n}\n```\n\nNow lets start with the main code, the `NamespaceConverter`. One thing it needs to do\nis convert `A\\\\B` style names to `A_B` style ones.\n\n```php\nuse PhpParser\\Node;\n\nclass NamespaceConverter extends \\PhpParser\\NodeVisitorAbstract\n{\n    public function leaveNode(Node $node) {\n        if ($node instanceof Node\\Name) {\n            return new Node\\Name(str_replace('\\\\', '_', $node->toString()));\n        }\n    }\n}\n```\n\nThe above code profits from the fact that the `NameResolver` already resolved all names as far as\npossible, so we don't need to do that. We only need to create a string with the name parts separated\nby underscores instead of backslashes. This is what `str_replace('\\\\', '_', $node->toString())` does. (If you want to\ncreate a name with backslashes either write `$node->toString()` or `(string) $node`.) Then we create\na new name from the string and return it. Returning a new node replaces the old node.\n\nAnother thing we need to do is change the class/function/const declarations. Currently they contain\nonly the shortname (i.e. the last part of the name), but they need to contain the complete name including\nthe namespace prefix:\n\n```php\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt;\n\nclass NodeVisitor_NamespaceConverter extends \\PhpParser\\NodeVisitorAbstract\n{\n    public function leaveNode(Node $node) {\n        if ($node instanceof Node\\Name) {\n            return new Node\\Name(str_replace('\\\\', '_', $node->toString()));\n        } elseif ($node instanceof Stmt\\Class_\n                  || $node instanceof Stmt\\Interface_\n                  || $node instanceof Stmt\\Function_) {\n            $node->name = str_replace('\\\\', '_', $node->namespacedName->toString());\n        } elseif ($node instanceof Stmt\\Const_) {\n            foreach ($node->consts as $const) {\n                $const->name = str_replace('\\\\', '_', $const->namespacedName->toString());\n            }\n        }\n    }\n}\n```\n\nThere is not much more to it than converting the namespaced name to string with `_` as separator.\n\nThe last thing we need to do is remove the `namespace` and `use` statements:\n\n```php\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\NodeVisitor;\n\nclass NodeVisitor_NamespaceConverter extends \\PhpParser\\NodeVisitorAbstract\n{\n    public function leaveNode(Node $node) {\n        if ($node instanceof Node\\Name) {\n            return new Node\\Name(str_replace('\\\\', '_', $node->toString()));\n        } elseif ($node instanceof Stmt\\Class_\n                  || $node instanceof Stmt\\Interface_\n                  || $node instanceof Stmt\\Function_) {\n            $node->name = str_replace('\\\\', '_', $node->namespacedName->toString();\n        } elseif ($node instanceof Stmt\\Const_) {\n            foreach ($node->consts as $const) {\n                $const->name = str_replace('\\\\', '_', $const->namespacedName->toString());\n            }\n        } elseif ($node instanceof Stmt\\Namespace_) {\n            // returning an array merges is into the parent array\n            return $node->stmts;\n        } elseif ($node instanceof Stmt\\Use_) {\n            // remove use nodes altogether\n            return NodeVisitor::REMOVE_NODE;\n        }\n    }\n}\n```\n\nThat's all.\n"
  },
  {
    "path": "doc/README.md",
    "content": "Table of Contents\n=================\n\nGuide\n-----\n\n  1. [Introduction](0_Introduction.markdown)\n  2. [Usage of basic components](2_Usage_of_basic_components.markdown)\n\nComponent documentation\n-----------------------\n\n  * [Walking the AST](component/Walking_the_AST.markdown)\n    * Node visitors\n    * Modifying the AST from a visitor\n    * Short-circuiting traversals\n    * Interleaved visitors\n    * Simple node finding API\n    * Parent and sibling references\n  * [Name resolution](component/Name_resolution.markdown)\n    * Name resolver options\n    * Name resolution context\n  * [Pretty printing](component/Pretty_printing.markdown)\n    * Converting AST back to PHP code\n    * Customizing formatting\n    * Formatting-preserving code transformations\n  * [AST builders](component/AST_builders.markdown)\n    * Fluent builders for AST nodes\n  * [Lexer](component/Lexer.markdown)\n    * Emulation\n    * Tokens, positions and attributes\n  * [Error handling](component/Error_handling.markdown)\n    * Column information for errors\n    * Error recovery (parsing of syntactically incorrect code)\n  * [Constant expression evaluation](component/Constant_expression_evaluation.markdown)\n    * Evaluating constant/property/etc initializers\n    * Handling errors and unsupported expressions\n  * [JSON representation](component/JSON_representation.markdown)\n    * JSON encoding and decoding of ASTs\n  * [Performance](component/Performance.markdown)\n    * Disabling Xdebug\n    * Reusing objects\n    * Garbage collection impact\n  * [Frequently asked questions](component/FAQ.markdown)\n    * Parent and sibling references\n"
  },
  {
    "path": "doc/component/AST_builders.markdown",
    "content": "AST builders\n============\n\nWhen PHP-Parser is used to generate (or modify) code by first creating an Abstract Syntax Tree and\nthen using the [pretty printer](Pretty_printing.markdown) to convert it to PHP code, it can often\nbe tedious to manually construct AST nodes. The project provides a number of utilities to simplify\nthe construction of common AST nodes.\n\nFluent builders\n---------------\n\nThe library comes with a number of builders, which allow creating node trees using a fluent\ninterface. Builders are created using the `BuilderFactory` and the final constructed node is\naccessed through `getNode()`. Fluent builders are available for\nthe following syntactic elements:\n\n * namespaces and use statements\n * classes, interfaces, traits and enums\n * methods, functions and parameters\n * properties, class constants and enum cases\n * trait uses and trait use adaptations\n\nHere is an example:\n\n```php\nuse PhpParser\\BuilderFactory;\nuse PhpParser\\PrettyPrinter;\nuse PhpParser\\Node;\n\n$factory = new BuilderFactory;\n$node = $factory->namespace('Name\\Space')\n    ->addStmt($factory->use('Some\\Other\\Thingy')->as('SomeClass'))\n    ->addStmt($factory->useFunction('strlen'))\n    ->addStmt($factory->useConst('PHP_VERSION'))\n    ->addStmt($factory->class('SomeOtherClass')\n        ->extend('SomeClass')\n        ->implement('A\\Few', '\\Interfaces')\n        ->makeAbstract() // ->makeFinal()\n\n        ->addStmt($factory->useTrait('FirstTrait'))\n\n        ->addStmt($factory->useTrait('SecondTrait', 'ThirdTrait')\n            ->and('AnotherTrait')\n            ->with($factory->traitUseAdaptation('foo')->as('bar'))\n            ->with($factory->traitUseAdaptation('AnotherTrait', 'baz')->as('test'))\n            ->with($factory->traitUseAdaptation('AnotherTrait', 'func')->insteadof('SecondTrait')))\n\n        ->addStmt($factory->method('someMethod')\n            ->makePublic()\n            ->makeAbstract() // ->makeFinal()\n            ->setReturnType('bool') // ->makeReturnByRef()\n            ->addParam($factory->param('someParam')->setType('SomeClass'))\n            ->setDocComment('/**\n                              * This method does something.\n                              *\n                              * @param SomeClass And takes a parameter\n                              */')\n        )\n\n        ->addStmt($factory->method('anotherMethod')\n            ->makeProtected() // ->makePublic() [default], ->makePrivate()\n            ->addParam($factory->param('someParam')->setDefault('test'))\n            // it is possible to add manually created nodes\n            ->addStmt(new Node\\Expr\\Print_(new Node\\Expr\\Variable('someParam')))\n        )\n\n        // properties will be correctly reordered above the methods\n        ->addStmt($factory->property('someProperty')->makeProtected())\n        ->addStmt($factory->property('anotherProperty')->makePrivate()->setDefault(array(1, 2, 3)))\n    )\n\n    ->getNode()\n;\n\n$stmts = array($node);\n$prettyPrinter = new PrettyPrinter\\Standard();\necho $prettyPrinter->prettyPrintFile($stmts);\n```\n\nThis will produce the following output with the standard pretty printer:\n\n```php\n<?php\n\nnamespace Name\\Space;\n\nuse Some\\Other\\Thingy as SomeClass;\nuse function strlen;\nuse const PHP_VERSION;\nabstract class SomeOtherClass extends SomeClass implements A\\Few, \\Interfaces\n{\n    use FirstTrait;\n    use SecondTrait, ThirdTrait, AnotherTrait {\n        foo as bar;\n        AnotherTrait::baz as test;\n        AnotherTrait::func insteadof SecondTrait;\n    }\n    protected $someProperty;\n    private $anotherProperty = [1, 2, 3];\n    /**\n     * This method does something.\n     *\n     * @param SomeClass And takes a parameter\n     */\n    abstract public function someMethod(SomeClass $someParam): bool;\n    protected function anotherMethod($someParam = 'test')\n    {\n        print $someParam;\n    }\n}\n```\n\nAdditional helper methods\n-------------------------\n\nThe `BuilderFactory` also provides a number of additional helper methods, which directly return\nnodes. The following methods are currently available:\n\n * `val($value)`: Creates an AST node for a literal value like `42` or `[1, 2, 3]`.\n * `var($name)`: Creates variable node.\n * `args(array $args)`: Creates an array of function/method arguments, including the required `Arg`\n   wrappers. Also converts literals to AST nodes.\n * `funcCall($name, array $args = [])`: Create a function call node. Converts `$name` to a `Name`\n   node and normalizes arguments.\n * `methodCall(Expr $var, $name, array $args = [])`: Create a method call node. Converts `$name` to\n   an `Identifier` node and normalizes arguments.\n * `staticCall($class, $name, array $args = [])`: Create a static method call node. Converts\n   `$class` to a `Name` node, `$name` to an `Identifier` node and normalizes arguments.\n * `new($class, array $args = [])`: Create a \"new\" (object creation) node. Converts `$class` to a\n   `Name` node.\n * `constFetch($name)`: Create a constant fetch node. Converts `$name` to a `Name` node.\n * `classConstFetch($class, $name)`: Create a class constant fetch node. Converts `$class` to a\n   `Name` node and `$name` to an `Identifier` node.\n * `propertyFetch($var, $name)`: Creates a property fetch node. Converts `$name` to an `Identifier`\n   node.\n * `concat(...$exprs)`: Create a tree of `BinaryOp\\Concat` nodes for the given expressions.\n * `attribute($name, $args)`: Create a `Attribute` node. Converts `$name` to a `Name` node and\n   normalizes arguments.\n\nThese methods may be expanded on an as-needed basis. Please open an issue or PR if a common\noperation is missing.\n"
  },
  {
    "path": "doc/component/Constant_expression_evaluation.markdown",
    "content": "Constant expression evaluation\n==============================\n\nInitializers for constants, properties, parameters, etc. have limited support for expressions. For\nexample:\n\n```php\n<?php\nclass Test {\n    const SECONDS_IN_HOUR = 60 * 60;\n    const SECONDS_IN_DAY = 24 * self::SECONDS_IN_HOUR;\n}\n```\n\nPHP-Parser supports evaluation of such constant expressions through the `ConstExprEvaluator` class:\n\n```php\n<?php\n\nuse PhpParser\\{ConstExprEvaluator, ConstExprEvaluationException};\n\n$evaluator = new ConstExprEvaluator();\ntry {\n    $value = $evaluator->evaluateSilently($someExpr);\n} catch (ConstExprEvaluationException $e) {\n    // Either the expression contains unsupported expression types,\n    // or an error occurred during evaluation\n}\n```\n\nError handling\n--------------\n\nThe constant evaluator provides two methods, `evaluateDirectly()` and `evaluateSilently()`, which\ndiffer in error behavior. `evaluateDirectly()` will evaluate the expression as PHP would, including\nany generated warnings or Errors. `evaluateSilently()` will instead convert warnings and Errors into\na `ConstExprEvaluationException`. For example:\n\n```php\n<?php\n\nuse PhpParser\\{ConstExprEvaluator, ConstExprEvaluationException};\nuse PhpParser\\Node\\{Expr, Scalar};\n\n$evaluator = new ConstExprEvaluator();\n\n// 10 / 0\n$expr = new Expr\\BinaryOp\\Div(new Scalar\\Int_(10), new Scalar\\Int_(0));\n\nvar_dump($evaluator->evaluateDirectly($expr)); // float(INF)\n// Warning: Division by zero\n\ntry {\n    $evaluator->evaluateSilently($expr);\n} catch (ConstExprEvaluationException $e) {\n    var_dump($e->getPrevious()->getMessage()); // Division by zero\n}\n```\n\nFor the purposes of static analysis, you will likely want to use `evaluateSilently()` and leave\nerroring expressions unevaluated.\n\nUnsupported expressions and evaluator fallback\n----------------------------------------------\n\nThe constant expression evaluator supports all expression types that are permitted in constant\nexpressions, apart from the following:\n\n * `Scalar\\MagicConst\\*`\n * `Expr\\ConstFetch` (only null/false/true are handled)\n * `Expr\\ClassConstFetch`\n * `Expr\\New_` (since PHP 8.1)\n * `Expr\\PropertyFetch` (since PHP 8.2)\n\nHandling these expression types requires non-local information, such as which global constants are\ndefined. By default, the evaluator will throw a `ConstExprEvaluationException` when it encounters\nan unsupported expression type.\n\nIt is possible to override this behavior and support resolution for these expression types by\nspecifying an evaluation fallback function:\n\n```php\n<?php\n\nuse PhpParser\\{ConstExprEvaluator, ConstExprEvaluationException};\nuse PhpParser\\Node\\Expr;\n\n$evaluator = new ConstExprEvaluator(function(Expr $expr) {\n    if ($expr instanceof Expr\\ConstFetch) {\n        return fetchConstantSomehow($expr);\n    }\n    if ($expr instanceof Expr\\ClassConstFetch) {\n        return fetchClassConstantSomehow($expr);\n    }\n    // etc.\n    throw new ConstExprEvaluationException(\n        \"Expression of type {$expr->getType()} cannot be evaluated\");\n});\n\ntry {\n    $evaluator->evaluateSilently($someExpr);\n} catch (ConstExprEvaluationException $e) {\n    // Handle exception\n}\n```\n\nImplementers are advised to ensure that evaluation of indirect constant references cannot lead to\ninfinite recursion. For example, the following code could lead to infinite recursion if constant\nlookup is implemented naively.\n\n```php\n<?php\nclass Test {\n    const A = self::B;\n    const B = self::A;\n}\n```\n"
  },
  {
    "path": "doc/component/Error_handling.markdown",
    "content": "Error handling\n==============\n\nErrors during parsing or analysis are represented using the `PhpParser\\Error` exception class. In addition to an error\nmessage, an error can also store additional information about the location the error occurred at.\n\nHow much location information is available depends on the origin of the error. At a minimum the start line of the error\nis usually available.\n\nColumn information\n------------------\n\nBefore using column information, its availability needs to be checked with `$e->hasColumnInfo()`, as the precise\nlocation of an error cannot always be determined. The methods for retrieving column information also have to be passed\nthe source code of the parsed file. An example for printing an error:\n\n```php\nif ($e->hasColumnInfo()) {\n    echo $e->getRawMessage() . ' from ' . $e->getStartLine() . ':' . $e->getStartColumn($code)\n        . ' to ' . $e->getEndLine() . ':' . $e->getEndColumn($code);\n    // or:\n    echo $e->getMessageWithColumnInfo($code);\n} else {\n    echo $e->getMessage();\n}\n```\n\nBoth line numbers and column numbers are 1-based. EOF errors will be located at the position one past the end of the\nfile.\n\nError recovery\n--------------\n\nThe error behavior of the parser (and other components) is controlled by an `ErrorHandler`. Whenever an error is\nencountered, `ErrorHandler::handleError()` is invoked. The default error handling strategy is `ErrorHandler\\Throwing`,\nwhich will immediately throw when an error is encountered.\n\nTo instead collect all encountered errors into an array, while trying to continue parsing the rest of the source code,\nan instance of `ErrorHandler\\Collecting` can be passed to the `Parser::parse()` method. A usage example:\n\n```php\n$parser = (new PhpParser\\ParserFactory())->createForHostVersion();\n$errorHandler = new PhpParser\\ErrorHandler\\Collecting;\n\n$stmts = $parser->parse($code, $errorHandler);\n\nif ($errorHandler->hasErrors()) {\n    foreach ($errorHandler->getErrors() as $error) {\n        // $error is an ordinary PhpParser\\Error\n    }\n}\n\nif (null !== $stmts) {\n    // $stmts is a best-effort partial AST\n}\n```\n\nThe partial AST may contain `Expr\\Error` nodes that indicate that an error occurred while parsing an expression.\n\nThe `NameResolver` visitor also accepts an `ErrorHandler` as a constructor argument.\n"
  },
  {
    "path": "doc/component/FAQ.markdown",
    "content": "Frequently Asked Questions\n==========================\n\n * [How can the parent of a node be obtained?](#how-can-the-parent-of-a-node-be-obtained)\n * [How can the next/previous sibling of a node be obtained?](#how-can-the-nextprevious-sibling-of-a-node-be-obtained)\n\nHow can the parent of a node be obtained?\n-----\n\nThe AST does not store parent nodes by default. However, the `ParentConnectingVisitor` can be used to achieve this:\n\n```php\nuse PhpParser\\NodeTraverser;\nuse PhpParser\\NodeVisitor\\ParentConnectingVisitor;\nuse PhpParser\\ParserFactory;\n\n$code = '...';\n\n$traverser = new NodeTraverser(new ParentConnectingVisitor);\n\n$parser = (new ParserFactory())->createForHostVersion();\n$ast    = $parser->parse($code);\n$ast    = $traverser->traverse($ast);\n```\n\nAfter running this visitor, the parent node can be obtained through `$node->getAttribute('parent')`.\n\nHow can the next/previous sibling of a node be obtained?\n-----\n\nAgain, siblings are not stored by default, but the `NodeConnectingVisitor` can be used to store\nthe previous / next node with a common parent as well:\n\n```php\nuse PhpParser\\NodeTraverser;\nuse PhpParser\\NodeVisitor\\NodeConnectingVisitor;\nuse PhpParser\\ParserFactory;\n\n$code = '...';\n\n$traverser = new NodeTraverser(new NodeConnectingVisitor);\n\n$parser = (new ParserFactory())->createForHostVersion();\n$ast    = $parser->parse($code);\n$ast    = $traverser->traverse($ast);\n```\n\nAfter running this visitor, the parent node can be obtained through `$node->getAttribute('parent')`,\nthe previous node can be obtained through `$node->getAttribute('previous')`, and the next node can be\nobtained through `$node->getAttribute('next')`.\n\n`ParentConnectingVisitor` and `NodeConnectingVisitor` should not be used at the same time. The latter\nincludes the functionality of the former.\n\n\nHow can I limit the impact of cyclic references in the AST?\n-----\n\nNodeConnectingVisitor adds a parent reference, which introduces a cycle. This means that the AST can now only be collected by the cycle garbage collector.\nThis in turn can lead to performance and/or memory issues. \n\nTo break the cyclic references between AST nodes `NodeConnectingVisitor` supports a boolean `$weakReferences` constructor parameter.\nWhen set to `true`, all attributes added by `NodeConnectingVisitor` will be wrapped into a `WeakReference` object.\n\nAfter enabling this parameter, the parent node can be obtained through `$node->getAttribute('weak_parent')`,\nthe previous node can be obtained through `$node->getAttribute('weak_previous')`, and the next node can be\nobtained through `$node->getAttribute('weak_next')`."
  },
  {
    "path": "doc/component/JSON_representation.markdown",
    "content": "JSON representation\n===================\n\nNodes (and comments) implement the `JsonSerializable` interface. As such, it is possible to JSON\nencode the AST directly using `json_encode()`:\n\n```php\n<?php\n\nuse PhpParser\\ParserFactory;\n\n$code = <<<'CODE'\n<?php\n\n/** @param string $msg */\nfunction printLine($msg) {\n    echo $msg, \"\\n\";\n}\nCODE;\n\n$parser = (new ParserFactory())->createForHostVersion();\n\ntry {\n    $stmts = $parser->parse($code);\n\n    echo json_encode($stmts, JSON_PRETTY_PRINT), \"\\n\";\n} catch (PhpParser\\Error $e) {\n    echo 'Parse Error: ', $e->getMessage();\n}\n```\n\nThis will result in the following output (which includes attributes):\n\n```json\n[\n    {\n        \"nodeType\": \"Stmt_Function\",\n        \"attributes\": {\n            \"startLine\": 4,\n            \"comments\": [\n                {\n                    \"nodeType\": \"Comment_Doc\",\n                    \"text\": \"\\/** @param string $msg *\\/\",\n                    \"line\": 3,\n                    \"filePos\": 7,\n                    \"tokenPos\": 2,\n                    \"endLine\": 3,\n                    \"endFilePos\": 31,\n                    \"endTokenPos\": 2\n                }\n            ],\n            \"endLine\": 6\n        },\n        \"byRef\": false,\n        \"name\": {\n            \"nodeType\": \"Identifier\",\n            \"attributes\": {\n                \"startLine\": 4,\n                \"endLine\": 4\n            },\n            \"name\": \"printLine\"\n        },\n        \"params\": [\n            {\n                \"nodeType\": \"Param\",\n                \"attributes\": {\n                    \"startLine\": 4,\n                    \"endLine\": 4\n                },\n                \"type\": null,\n                \"byRef\": false,\n                \"variadic\": false,\n                \"var\": {\n                    \"nodeType\": \"Expr_Variable\",\n                    \"attributes\": {\n                        \"startLine\": 4,\n                        \"endLine\": 4\n                    },\n                    \"name\": \"msg\"\n                },\n                \"default\": null,\n                \"flags\": 0,\n                \"attrGroups\": []\n            }\n        ],\n        \"returnType\": null,\n        \"stmts\": [\n            {\n                \"nodeType\": \"Stmt_Echo\",\n                \"attributes\": {\n                    \"startLine\": 5,\n                    \"endLine\": 5\n                },\n                \"exprs\": [\n                    {\n                        \"nodeType\": \"Expr_Variable\",\n                        \"attributes\": {\n                            \"startLine\": 5,\n                            \"endLine\": 5\n                        },\n                        \"name\": \"msg\"\n                    },\n                    {\n                        \"nodeType\": \"Scalar_String\",\n                        \"attributes\": {\n                            \"startLine\": 5,\n                            \"endLine\": 5,\n                            \"kind\": 2,\n                            \"rawValue\": \"\\\"\\\\n\\\"\"\n                        },\n                        \"value\": \"\\n\"\n                    }\n                ]\n            }\n        ],\n        \"attrGroups\": [],\n        \"namespacedName\": null\n    }\n]\n```\n\nThe JSON representation may be converted back into an AST using the `JsonDecoder`:\n\n```php\n<?php\n\n$jsonDecoder = new PhpParser\\JsonDecoder();\n$ast = $jsonDecoder->decode($json);\n```\n\nNote that not all ASTs can be represented using JSON. In particular:\n\n * JSON only supports UTF-8 strings.\n * JSON does not support non-finite floating-point numbers. This can occur if the original source\n   code contains non-representable floating-pointing literals such as `1e1000`.\n\nIf the node tree is not representable in JSON, the initial `json_encode()` call will fail.\n\nFrom the command line, a JSON dump can be obtained using `vendor/bin/php-parse -j file.php`.\n"
  },
  {
    "path": "doc/component/Lexer.markdown",
    "content": "Lexer component documentation\n=============================\n\nThe lexer is responsible for providing tokens to the parser. Typical use of the library does not require direct\ninteraction with the lexer, as an appropriate lexer is created by `PhpParser\\ParserFactory`. The tokens produced\nby the lexer can then be retrieved using `PhpParser\\Parser::getTokens()`.\n\nEmulation\n---------\n\nWhile this library implements a custom parser, it relies on PHP's `ext/tokenizer` extension to perform lexing. However,\nthis extension only supports lexing code for the PHP version you are running on, while this library also wants to support\nparsing newer code. For that reason, the lexer performs additional \"emulation\" in three layers:\n\nFirst, PhpParser uses the `PhpToken` based representation introduced in PHP 8.0, rather than the array-based tokens from\nprevious versions. The `PhpParser\\Token` class either extends `PhpToken` (on PHP 8.0) or a polyfill implementation. The\npolyfill implementation will also perform two emulations that are required by the parser and cannot be disabled:\n\n * Single-line comments use the PHP 8.0 representation that does not include a trailing newline. The newline will be\n   part of a following `T_WHITESPACE` token.\n * Namespaced names use the PHP 8.0 representation using `T_NAME_FULLY_QUALIFIED`, `T_NAME_QUALIFIED` and\n   `T_NAME_RELATIVE` tokens, rather than the previous representation using a sequence of `T_STRING` and `T_NS_SEPARATOR`.\n   This means that certain code that is legal on older versions (namespaced names including whitespace, such as `A \\ B`)\n   will not be accepted by the parser.\n\nSecond, the `PhpParser\\Lexer` base class will convert `&` tokens into the PHP 8.1 representation of either\n`T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG` or `T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG`. This is required by the parser\nand cannot be disabled.\n\nFinally, `PhpParser\\Lexer\\Emulative` performs other, optional emulations. This lexer is parameterized by `PhpVersion`\nand will try to emulate `ext/tokenizer` output for that version. This is done using separate `TokenEmulator`s for each\nemulated feature.\n\nEmulation is usually used to support newer PHP versions, but there is also very limited support for reverse emulation to\nolder PHP versions, which can make keywords from newer versions non-reserved.\n\nTokens, positions and attributes\n--------------------------------\n\nThe `Lexer::tokenize()` method returns an array of `PhpParser\\Token`s. The most important parts of the interface can be\nsummarized as follows:\n\n```php\nclass Token {\n    /** @var int Token ID, either T_* or ord($char) for single-character tokens. */\n    public int $id;\n    /** @var string The textual content of the token. */\n    public string $text;\n    /** @var int The 1-based starting line of the token (or -1 if unknown). */\n    public int $line;\n    /** @var int The 0-based starting position of the token (or -1 if unknown). */\n    public int $pos;\n\n    /** @param int|string|(int|string)[] $kind Token ID or text (or array of them) */\n    public function is($kind): bool;\n}\n```\n\nUnlike PHP's own `PhpToken::tokenize()` output, the token array is terminated by a sentinel token with ID 0.\n\nThe lexer is normally invoked implicitly by the parser. In that case, the tokens for the last parse can be retrieved\nusing `Parser::getTokens()`.\n\nNodes in the AST produced by the parser always corresponds to some range of tokens. The parser adds a number of\npositioning attributes to allow mapping nodes back to lines, tokens or file offsets:\n\n * `startLine`: Line in which the node starts. Used by `$node->getStartLine()`.\n * `endLine`: Line in which the node ends. Used by `$node->getEndLine()`.\n * `startTokenPos`: Offset into the token array of the first token in the node. Used by `$node->getStartTokenPos()`.\n * `endTokenPos`: Offset into the token array of the last token in the node. Used by `$node->getEndTokenPos()`.\n * `startFilePos`: Offset into the code string of the first character that is part of the node. Used by `$node->getStartFilePos()`.\n * `endFilePos`: Offset into the code string of the last character that is part of the node. Used by `$node->getEndFilePos()`.\n\nNote that `start`/`end` here are closed rather than half-open ranges. This means that a node consisting of a single\ntoken will have `startTokenPos == endTokenPos` rather than `startTokenPos + 1 == endTokenPos`. This also means that a\nzero-length node will have `startTokenPos -1 == endTokenPos`.\n\n### Using token positions\n\n> **Note:** The example in this section is outdated in that this information is directly available in the AST: While\n> `$property->isPublic()` does not distinguish between `public` and `var`, directly checking `$property->flags` for\n> the `$property->flags & Class_::VISIBILITY_MODIFIER_MASK) === 0` allows making this distinction without resorting to\n> tokens. However, the general idea behind the example still applies in other cases.\n\nThe token offset information is useful if you wish to examine the exact formatting used for a node. For example the AST\ndoes not distinguish whether a property was declared using `public` or using `var`, but you can retrieve this\ninformation based on the token position:\n\n```php\n/** @param PhpParser\\Token[] $tokens */\nfunction isDeclaredUsingVar(array $tokens, PhpParser\\Node\\Stmt\\Property $prop) {\n    $i = $prop->getStartTokenPos();\n    return $tokens[$i]->id === T_VAR;\n}\n```\n\nIn order to make use of this function, you will have to provide the tokens from the lexer to your node visitor using\ncode similar to the following:\n\n```php\nclass MyNodeVisitor extends PhpParser\\NodeVisitorAbstract {\n    private $tokens;\n    public function setTokens(array $tokens) {\n        $this->tokens = $tokens;\n    }\n\n    public function leaveNode(PhpParser\\Node $node) {\n        if ($node instanceof PhpParser\\Node\\Stmt\\Property) {\n            var_dump(isDeclaredUsingVar($this->tokens, $node));\n        }\n    }\n}\n\n$parser = (new PhpParser\\ParserFactory())->createForHostVersion($lexerOptions);\n\n$visitor = new MyNodeVisitor();\n$traverser = new PhpParser\\NodeTraverser($visitor);\n\ntry {\n    $stmts = $parser->parse($code);\n    $visitor->setTokens($parser->getTokens());\n    $stmts = $traverser->traverse($stmts);\n} catch (PhpParser\\Error $e) {\n    echo 'Parse Error: ', $e->getMessage();\n}\n```\n"
  },
  {
    "path": "doc/component/Name_resolution.markdown",
    "content": "Name resolution\n===============\n\nSince the introduction of namespaces in PHP 5.3, literal names in PHP code are subject to a\nrelatively complex name resolution process, which is based on the current namespace, the current\nimport table state, as well the type of the referenced symbol. PHP-Parser implements name\nresolution and related functionality, both as reusable logic (NameContext), as well as a node\nvisitor (NameResolver) based on it.\n\nThe NameResolver visitor\n------------------------\n\nThe `NameResolver` visitor can (and for nearly all uses of the AST, should) be applied to resolve names\nto their fully-qualified form, to the degree that this is possible.\n\n```php\n$nameResolver = new PhpParser\\NodeVisitor\\NameResolver;\n$nodeTraverser = new PhpParser\\NodeTraverser;\n$nodeTraverser->addVisitor($nameResolver);\n\n// Resolve names\n$stmts = $nodeTraverser->traverse($stmts);\n```\n\nIn the default configuration, the name resolver will perform three actions:\n\n * Declarations of functions, classes, interfaces, traits, enums and global constants will have a\n   `namespacedName` property added, which contains the function/class/etc name including the\n   namespace prefix. For historic reasons this is a **property** rather than an attribute.\n * Names will be replaced by fully qualified resolved names, which are instances of\n   `Node\\Name\\FullyQualified`.\n * Unqualified function and constant names inside a namespace cannot be statically resolved. Inside\n   a namespace `Foo`, a call to `strlen()` may either refer to the namespaced `\\Foo\\strlen()`, or\n   the global `\\strlen()`. Because PHP-Parser does not have the necessary context to decide this,\n   such names are left unresolved. Additionally, a `namespacedName` **attribute** is added to the\n   name node.\n\nThe name resolver accepts an option array as the second argument, with the following default values:\n\n```php\n$nameResolver = new PhpParser\\NodeVisitor\\NameResolver(null, [\n    'preserveOriginalNames' => false,\n    'replaceNodes' => true,\n]);\n```\n\nIf the `preserveOriginalNames` option is enabled, then the resolved (fully qualified) name will have\nan `originalName` attribute, which contains the unresolved name.\n\nIf the `replaceNodes` option is disabled, then names will no longer be resolved in-place. Instead, a\n`resolvedName` attribute will be added to each name, which contains the resolved (fully qualified)\nname. Once again, if an unqualified function or constant name cannot be resolved, then the\n`resolvedName` attribute will not be present, and instead a `namespacedName` attribute is added.\n\nThe `replaceNodes` attribute is useful if you wish to perform modifications on the AST, as you\nprobably do not wish the resulting code to have fully resolved names as a side-effect.\n\nThe NameContext\n---------------\n\nThe actual name resolution logic is implemented in the `NameContext` class, which has the following\npublic API:\n\n```php\nclass NameContext {\n    public function __construct(ErrorHandler $errorHandler);\n    public function startNamespace(Name $namespace = null);\n    public function addAlias(Name $name, string $aliasName, int $type, array $errorAttrs = []);\n\n    public function getNamespace();\n    public function getResolvedName(Name $name, int $type);\n    public function getResolvedClassName(Name $name) : Name;\n    public function getPossibleNames(string $name, int $type) : array;\n    public function getShortName(string $name, int $type) : Name;\n}\n```\n\nThe `$type` parameters accept one of the `Stmt\\Use_::TYPE_*` constants, which represent the three\nbasic symbol types in PHP (functions, constants and everything else).\n\nNext to name resolution, the `NameContext` also supports the reverse operation of finding a short\nrepresentation of a name given the current name resolution environment.\n\nThe name context is intended to be used for name resolution operations outside the AST itself, such\nas class names inside doc comments. A visitor running in parallel with the name resolver can access\nthe name context using `$nameResolver->getNameContext()`. Alternatively a visitor can use an\nindependent context and explicitly feed `Namespace` and `Use` nodes to it.\n"
  },
  {
    "path": "doc/component/Performance.markdown",
    "content": "Performance\n===========\n\nParsing is computationally expensive task, to which the PHP language is not very well suited.\nNonetheless, there are a few things you can do to improve the performance of this library, which are\ndescribed in the following.\n\nXdebug\n------\n\nRunning PHP with Xdebug adds a lot of overhead, especially for code that performs many method calls.\nJust by loading Xdebug (without enabling profiling or other more intrusive Xdebug features), you\ncan expect that code using PHP-Parser will be approximately *five times slower*.\n\nAs such, you should make sure that Xdebug is not loaded when using this library. Note that setting\nthe `xdebug.default_enable=0` ini option does *not* disable Xdebug. The *only* way to disable\nXdebug is to not load the extension in the first place.\n\nIf you are building a command-line utility for use by developers (who often have Xdebug enabled),\nyou may want to consider automatically restarting PHP with Xdebug unloaded. The\n[composer/xdebug-handler](https://github.com/composer/xdebug-handler) package can be used to do\nthis.\n\nIf you do run with Xdebug, you may need to increase the `xdebug.max_nesting_level` option to a\nhigher level, such as 3000. While the parser itself is recursion free, most other code working on\nthe AST uses recursion and will generate an error if the value of this option is too low.\n\nAssertions\n----------\n\nAssertions should be disabled in a production context by setting `zend.assertions=-1` (or\n`zend.assertions=0` if set at runtime). The library currently doesn't make heavy use of assertions,\nbut they are used in an increasing number of places.\n\nObject reuse\n------------\n\nMany objects in this project are designed for reuse. For example, one `Parser` object can be used to\nparse multiple files.\n\nWhen possible, objects should be reused rather than being newly instantiated for every use. Some\nobjects have expensive initialization procedures, which will be unnecessarily repeated if the object\nis not reused. (Currently two objects with particularly expensive setup are parsers and pretty\nprinters, though the details might change between versions of this library.)\n"
  },
  {
    "path": "doc/component/Pretty_printing.markdown",
    "content": "Pretty printing\n===============\n\nPretty printing is the process of converting a syntax tree back to PHP code. In its basic mode of\noperation the pretty printer provided by this library will print the AST using a certain predefined\ncode style and will discard (nearly) all formatting of the original code. Because programmers tend\nto be rather picky about their code formatting, this mode of operation is not very suitable for\nrefactoring code, but can be used for automatically generated code, which is usually only read for\ndebugging purposes.\n\nBasic usage\n-----------\n\n```php\n$stmts = $parser->parse($code);\n\n// MODIFY $stmts here\n\n$prettyPrinter = new PhpParser\\PrettyPrinter\\Standard;\n$newCode = $prettyPrinter->prettyPrintFile($stmts);\n```\n\nThe pretty printer has three basic printing methods: `prettyPrint()`, `prettyPrintFile()` and\n`prettyPrintExpr()`. The one that is most commonly useful is `prettyPrintFile()`, which takes an\narray of statements and produces a full PHP file, including opening `<?php`.\n\n`prettyPrint()` also takes a statement array, but produces code which is valid inside an already\nopen `<?php` context. Lastly, `prettyPrintExpr()` takes an `Expr` node and prints only a single\nexpression.\n\nCustomizing the formatting\n--------------------------\n\nThe pretty printer respects a number of attributes used by some nodes:\n\n * `kind` on `Scalar\\String_` to use single quotes (default), double quotes, heredoc or nowdoc.\n   In the latter two cases, the heredoc/nowdoc label from the `docLabel` attribute is used.\n * `kind` on `Scalar\\Int_` to use decimal (default), binary, octal or hexadecimal representation.\n * `shouldPrintRawValue` and `rawValue` on `Scalar\\Int_` to preserve the original formatting of\n   integer literals (e.g., numeric separators like `1_000`). When `shouldPrintRawValue` is set to\n   `true`, the value from `rawValue` is used instead of the computed representation. This works for\n   all integer formats (decimal, binary, octal, hexadecimal).\n * `kind` on `Cast\\Double` to use `(double)` (default), `(float)` or `(real)`.\n * `kind` on `Expr\\List_` to use `[]` or `list()` (default depends on `phpVersion` option).\n * `kind` on `Expr\\Array_` to use `[]` or `array()` (default depends on `shortArraySyntax` option).\n * `kind` on `Expr\\Exit_` to use `die` (defaul) or `exit`.\n * `hasLeadingNewline` on `Stmt\\InlineHTML` to determine whether a newline is emitted after `?>`\n   or not.\n\nAdditionally, the pretty printer supports three options:\n\n* `phpVersion` (defaults to 7.4) allows opting into formatting that is not supported by older PHP\n  versions.\n* `newline` (defaults to `\"\\n\"`) can be set to `\"\\r\\n\"` in order to produce Windows newlines.\n* `indent` (defaults to four spaces `\"    \"`) can be set to any number of spaces or a single tab.\n* `shortArraySyntax` determines the used array syntax if the `kind` attribute is not set. This is\n  a legacy option, and `phpVersion` should be used to control this behavior instead.\n\nThe behaviors controlled by `phpVersion` (defaults to PHP 7.4) are:\n\n* For PHP >= 7.0, short array syntax `[]` will be used by default. This does not affect nodes that\n  specify an explicit array syntax using the `kind` attribute.\n* For PHP >= 7.0, parentheses around `yield` expressions will only be printed when necessary.\n* For PHP >= 7.1, the short array syntax `[]` will be used for destructuring by default (instead of\n  `list()`). This does not affect nodes that specify and explicit syntax using the `kind` attribute.\n* For PHP >= 7.3, a newline is no longer forced after heredoc/nowdoc strings, as the requirement\n  for this has been removed with the introduction of flexible heredoc/nowdoc strings.\n* For PHP >= 7.3, heredoc/nowdoc strings are indented just like regular code. This was allowed with\n  the introduction of flexible heredoc/nowdoc strings.\n\nThe default pretty printer does not provide functionality for fine-grained customization of code\nformatting.\n\nIf you want to make minor changes to the formatting, the easiest way is to extend the pretty printer\nand override the methods responsible for the node types you are interested in.\n\nIf you want to have more fine-grained formatting control, the recommended method is to combine the\ndefault pretty printer with an existing library for code reformatting, such as\n[PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer).\n\nFormatting-preserving pretty printing\n-------------------------------------\n\nFor automated code refactoring, migration and similar, you will usually only want to modify a small\nportion of the code and leave the remainder alone. The basic pretty printer is not suitable for\nthis, because it will also reformat parts of the code which have not been modified.\n\nSince PHP-Parser 4.0, a formatting-preserving pretty-printing mode is available, which\nattempts to preserve the formatting of code (those AST nodes that have not changed) and only reformat\ncode which has been modified or newly inserted.\n\nUse of the formatting-preservation functionality requires some additional preparatory steps:\n\n```php\nuse PhpParser\\{NodeTraverser, NodeVisitor, ParserFactory, PrettyPrinter};\n\n$parser = (new ParserFactory())->createForHostVersion();\n$oldStmts = $parser->parse($code);\n$oldTokens = $parser->getTokens();\n\n// Run CloningVisitor before making changes to the AST.\n$traverser = new NodeTraverser(new NodeVisitor\\CloningVisitor());\n$newStmts = $traverser->traverse($oldStmts);\n\n// MODIFY $newStmts HERE\n\n$printer = new PrettyPrinter\\Standard();\n$newCode = $printer->printFormatPreserving($newStmts, $oldStmts, $oldTokens);\n```\n\nIf you make use of the name resolution functionality, you will likely want to disable the\n`replaceNodes` option. This will add resolved names as attributes, instead of directly modifying\nthe AST and causing spurious changes to the pretty printed code. For more information, see the\n[name resolution documentation](Name_resolution.markdown).\n\nThe formatting-preservation works on a best-effort basis and may sometimes reformat more code than\nnecessary. If you encounter problems while using this functionality, please open an issue.\n"
  },
  {
    "path": "doc/component/Walking_the_AST.markdown",
    "content": "Walking the AST\n===============\n\nThe most common way to work with the AST is by using a node traverser and one or more node visitors.\nAs a basic example, the following code changes all literal integers in the AST into strings (e.g.,\n`42` becomes `'42'`.)\n\n```php\nuse PhpParser\\{Node, NodeTraverser, NodeVisitorAbstract};\n\n$traverser = new NodeTraverser;\n$traverser->addVisitor(new class extends NodeVisitorAbstract {\n    public function leaveNode(Node $node) {\n        if ($node instanceof Node\\Scalar\\Int_) {\n            return new Node\\Scalar\\String_((string) $node->value);\n        }\n    }\n});\n\n$stmts = ...;\n$modifiedStmts = $traverser->traverse($stmts);\n```\n\nVisitors can be either passed to the `NodeTraverser` constructor, or added using `addVisitor()`:\n\n```php\n$traverser = new NodeTraverser($visitor1, $visitor2, $visitor3);\n\n// Equivalent to:\n$traverser = new NodeTraverser();\n$traverser->addVisitor($visitor1);\n$traverser->addVisitor($visitor2);\n$traverser->addVisitor($visitor3);\n```\n\nNode visitors\n-------------\n\nEach node visitor implements an interface with following four methods:\n\n```php\ninterface NodeVisitor {\n    public function beforeTraverse(array $nodes);\n    public function enterNode(Node $node);\n    public function leaveNode(Node $node);\n    public function afterTraverse(array $nodes);\n}\n```\n\nThe `beforeTraverse()` and `afterTraverse()` methods are called before and after the traversal\nrespectively, and are passed the entire AST. They can be used to perform any necessary state\nsetup or cleanup.\n\nThe `enterNode()` method is called when a node is first encountered, before its children are\nprocessed (\"preorder\"). The `leaveNode()` method is called after all children have been visited\n(\"postorder\").\n\nFor example, if we have the following excerpt of an AST\n\n```\nExpr_FuncCall(\n   name: Name(\n       name: printLine\n   )\n   args: array(\n       0: Arg(\n           name: null\n           value: Scalar_String(\n               value: Hello World!!!\n           )\n           byRef: false\n           unpack: false\n       )\n   )\n)\n```\n\nthen the enter/leave methods will be called in the following order:\n\n```\nenterNode(Expr_FuncCall)\nenterNode(Name)\nleaveNode(Name)\nenterNode(Arg)\nenterNode(Scalar_String)\nleaveNode(Scalar_String)\nleaveNode(Arg)\nleaveNode(Expr_FuncCall)\n```\n\nA common pattern is that `enterNode` is used to collect some information and then `leaveNode`\nperforms modifications based on that. At the time when `leaveNode` is called, all the code inside\nthe node will have already been visited and necessary information collected.\n\nAs you usually do not want to implement all four methods, it is recommended that you extend\n`NodeVisitorAbstract` instead of implementing the interface directly. The abstract class provides\nempty default implementations.\n\nModifying the AST\n-----------------\n\nThere are a number of ways in which the AST can be modified from inside a node visitor. The first\nand simplest is to simply change AST properties inside the visitor:\n\n```php\npublic function leaveNode(Node $node) {\n    if ($node instanceof Node\\Scalar\\LNumber) {\n        // increment all integer literals\n        $node->value++;\n    }\n}\n```\n\nThe second is to replace a node entirely by returning a new node:\n\n```php\npublic function leaveNode(Node $node) {\n    if ($node instanceof Node\\Expr\\BinaryOp\\BooleanAnd) {\n        // Convert all $a && $b expressions into !($a && $b)\n        return new Node\\Expr\\BooleanNot($node);\n    }\n}\n```\n\nDoing this is supported both inside enterNode and leaveNode. However, you have to be mindful about\nwhere you perform the replacement: If a node is replaced in enterNode, then the recursive traversal\nwill also consider the children of the new node. If you aren't careful, this can lead to infinite\nrecursion. For example, let's take the previous code sample and use enterNode instead:\n\n```php\npublic function enterNode(Node $node) {\n    if ($node instanceof Node\\Expr\\BinaryOp\\BooleanAnd) {\n        // Convert all $a && $b expressions into !($a && $b)\n        return new Node\\Expr\\BooleanNot($node);\n    }\n}\n```\n\nNow `$a && $b` will be replaced by `!($a && $b)`. Then the traverser will go into the first (and\nonly) child of `!($a && $b)`, which is `$a && $b`. The transformation applies again and we end up\nwith `!!($a && $b)`. This will continue until PHP hits the memory limit.\n\nFinally, there are three special replacement types. The first is removal of a node:\n\n```php\npublic function leaveNode(Node $node) {\n    if ($node instanceof Node\\Stmt\\Return_) {\n        // Remove all return statements\n        return NodeVisitor::REMOVE_NODE;\n    }\n}\n```\n\nNode removal only works if the parent structure is an array. This means that usually it only makes\nsense to remove nodes of type `Node\\Stmt`, as they always occur inside statement lists (and a few\nmore node types like `Arg` or `Expr\\ArrayItem`, which are also always part of lists).\n\nOn the other hand, removing a `Node\\Expr` does not make sense: If you have `$a * $b`, there is no\nmeaningful way in which the `$a` part could be removed. If you want to remove an expression, you\ngenerally want to remove it together with a surrounding expression statement:\n\n```php\npublic function leaveNode(Node $node) {\n    if ($node instanceof Node\\Stmt\\Expression\n        && $node->expr instanceof Node\\Expr\\FuncCall\n        && $node->expr->name instanceof Node\\Name\n        && $node->expr->name->toString() === 'var_dump'\n    ) {\n        return NodeVisitor::REMOVE_NODE;\n    }\n}\n```\n\nThis example will remove all calls to `var_dump()` which occur as expression statements. This means\nthat `var_dump($a);` will be removed, but `if (var_dump($a))` will not be removed (and there is no\nobvious way in which it can be removed).\n\nAnother way to remove nodes is to replace them with `null`. For example, all `else` statements could\nbe removed as follows:\n\n```php\npublic function leaveNode(Node $node) {\n    if ($node instanceof Node\\Stmt\\Else_) {\n        return NodeVisitor::REPLACE_WITH_NULL;\n    }\n}\n```\n\nThis is only safe to do if the subnode the node is stored in is nullable. `Node\\Stmt\\Else_` only\noccurs inside `Node\\Stmt\\If_::$else`, which is nullable, so this particular replacement is safe.\n\nNext to removing nodes, it is also possible to replace one node with multiple nodes. This\nonly works if the parent structure is an array.\n\n```php\npublic function leaveNode(Node $node) {\n    if ($node instanceof Node\\Stmt\\Return_ && $node->expr !== null) {\n        // Convert \"return foo();\" into \"$retval = foo(); return $retval;\"\n        $var = new Node\\Expr\\Variable('retval');\n        return [\n            new Node\\Stmt\\Expression(new Node\\Expr\\Assign($var, $node->expr)),\n            new Node\\Stmt\\Return_($var),\n        ];\n    }\n}\n```\n\nShort-circuiting traversal\n--------------------------\n\nAn AST can easily contain thousands of nodes, and traversing over all of them may be slow,\nespecially if you have more than one visitor. In some cases, it is possible to avoid a full\ntraversal.\n\nIf you are looking for all class declarations in a file (and assuming you're not interested in\nanonymous classes), you know that once you've seen a class declaration, there is no point in also\nchecking all it's child nodes, because PHP does not allow nesting classes. In this case, you can\ninstruct the traverser to not recurse into the class node:\n\n```php\nprivate $classes = [];\npublic function enterNode(Node $node) {\n    if ($node instanceof Node\\Stmt\\Class_) {\n        $this->classes[] = $node;\n        return NodeVisitor::DONT_TRAVERSE_CHILDREN;\n    }\n}\n```\n\nOf course, this option is only available in enterNode, because it's already too late by the time\nleaveNode is reached.\n\nIf you are only looking for one specific node, it is also possible to abort the traversal entirely\nafter finding it. For example, if you are looking for the node of a class with a certain name (and\ndiscounting exotic cases like conditionally defining a class two times), you can stop traversal\nonce you found it:\n\n```php\nprivate $class = null;\npublic function enterNode(Node $node) {\n    if ($node instanceof Node\\Stmt\\Class_ &&\n        $node->namespacedName->toString() === 'Foo\\Bar\\Baz'\n    ) {\n        $this->class = $node;\n        return NodeVisitor::STOP_TRAVERSAL;\n    }\n}\n```\n\nThis works both in enterNode and leaveNode. Note that this particular case can also be more easily\nhandled using a NodeFinder, which will be introduced below.\n\nMultiple visitors\n-----------------\n\nA single traverser can be used with multiple visitors:\n\n```php\n$traverser = new NodeTraverser;\n$traverser->addVisitor($visitorA);\n$traverser->addVisitor($visitorB);\n$stmts = $traverser->traverse($stmts);\n```\n\nIt is important to understand that if a traverser is run with multiple visitors, the visitors will\nbe interleaved. Given the following AST excerpt\n\n```\nStmt_Return(\n    expr: Expr_Variable(\n        name: foobar\n    )\n)\n```\n\nthe following method calls will be performed:\n\n```php\n$visitorA->enterNode(Stmt_Return)\n$visitorB->enterNode(Stmt_Return)\n$visitorA->enterNode(Expr_Variable)\n$visitorB->enterNode(Expr_Variable)\n$visitorB->leaveNode(Expr_Variable)\n$visitorA->leaveNode(Expr_Variable)\n$visitorB->leaveNode(Stmt_Return)\n$visitorA->leaveNode(Stmt_Return)\n```\n\nThat is, when visiting a node, `enterNode()` and `leaveNode()` will always be called for all\nvisitors, with the `leaveNode()` calls happening in the reverse order of the `enterNode()` calls.\nRunning multiple visitors in parallel improves performance, as the AST only has to be traversed\nonce. However, it is not always possible to write visitors in a way that allows interleaved\nexecution. In this case, you can always fall back to performing multiple traversals:\n\n```php\n$traverserA = new NodeTraverser;\n$traverserA->addVisitor($visitorA);\n$traverserB = new NodeTraverser;\n$traverserB->addVisitor($visitorB);\n$stmts = $traverserA->traverser($stmts);\n$stmts = $traverserB->traverser($stmts);\n```\n\nWhen using multiple visitors, it is important to understand how they interact with the various\nspecial enterNode/leaveNode return values:\n\n * If *any* visitor returns `DONT_TRAVERSE_CHILDREN`, the children will be skipped for *all*\n   visitors.\n * If *any* visitor returns `DONT_TRAVERSE_CURRENT_AND_CHILDREN`, the children will be skipped for *all*\n   visitors, and all *subsequent* visitors will not visit the current node.\n * If *any* visitor returns `STOP_TRAVERSAL`, traversal is stopped for *all* visitors.\n * If a visitor returns a replacement node, subsequent visitors will be passed the replacement node,\n   not the original one.\n * If a visitor returns `REMOVE_NODE`, subsequent visitors will not see this node.\n * If a visitor returns `REPLACE_WITH_NULL`, subsequent visitors will not see this node.\n * If a visitor returns an array of replacement nodes, subsequent visitors will see neither the node\n   that was replaced, nor the replacement nodes.\n\nSimple node finding\n-------------------\n\nWhile the node visitor mechanism is very flexible, creating a node visitor can be overly cumbersome\nfor minor tasks. For this reason a `NodeFinder` is provided, which can find AST nodes that either\nsatisfy a certain callback, or which are instances of a certain node type. A couple of examples are\nshown in the following:\n\n```php\nuse PhpParser\\{Node, NodeFinder};\n\n$nodeFinder = new NodeFinder;\n\n// Find all class nodes.\n$classes = $nodeFinder->findInstanceOf($stmts, Node\\Stmt\\Class_::class);\n\n// Find all classes that extend another class\n$extendingClasses = $nodeFinder->find($stmts, function(Node $node) {\n    return $node instanceof Node\\Stmt\\Class_\n        && $node->extends !== null;\n});\n\n// Find first class occurring in the AST. Returns null if no class exists.\n$class = $nodeFinder->findFirstInstanceOf($stmts, Node\\Stmt\\Class_::class);\n\n// Find first class that has name $name\n$class = $nodeFinder->findFirst($stmts, function(Node $node) use ($name) {\n    return $node instanceof Node\\Stmt\\Class_\n        && $node->resolvedName->toString() === $name;\n});\n```\n\nInternally, the `NodeFinder` also uses a node traverser. It only simplifies the interface for a\ncommon use case.\n\nParent and sibling references\n-----------------------------\n\nThe node visitor mechanism is somewhat rigid, in that it prescribes an order in which nodes should\nbe accessed: From parents to children. However, it can often be convenient to operate in the\nreverse direction: When working on a node, you might want to check if the parent node satisfies a\ncertain property.\n\nPHP-Parser does not add parent (or sibling) references to nodes by default, but you can enable them\nusing the `ParentConnectingVisitor` or `NodeConnectingVisitor`. See the [FAQ](FAQ.markdown) for\nmore information.\n"
  },
  {
    "path": "grammar/README.md",
    "content": "What do all those files mean?\n=============================\n\n * `php.y`:              PHP 5-8 grammar written in a pseudo language\n * `parser.template`:    A `kmyacc` parser prototype file for PHP\n * `rebuildParsers.php`: Preprocesses the grammar and builds the parser using `kmyacc`\n\n.phpy pseudo language\n=====================\n\nThe `.y` file is a normal grammar in `kmyacc` (`yacc`) style, with some transformations\napplied to it:\n\n * Nodes are created using the syntax `Name[..., ...]`. This is transformed into\n   `new Name(..., ..., attributes())`\n * Some function-like constructs are resolved (see `rebuildParsers.php` for a list)\n\nBuilding the parser\n===================\n\nRun `php grammar/rebuildParsers.php` to rebuild the parsers. Additional options:\n\n * The `KMYACC` environment variable can be used to specify an alternative `kmyacc` binary.\n   By default the `phpyacc` dev dependency will be used. To use the original `kmyacc`, you\n   need to compile [moriyoshi's fork](https://github.com/moriyoshi/kmyacc-forked).\n * The `--debug` option enables emission of debug symbols and creates the `y.output` file.\n * The `--keep-tmp-grammar` option preserves the preprocessed grammar file.\n"
  },
  {
    "path": "grammar/parser.template",
    "content": "<?php declare(strict_types=1);\n$meta #\n#semval($) $self->semValue\n#semval($,%t) $self->semValue\n#semval(%n) $stackPos-(%l-%n)\n#semval(%n,%t) $stackPos-(%l-%n)\n\nnamespace PhpParser\\Parser;\n\nuse PhpParser\\Error;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Stmt;\n#include;\n\n/* This is an automatically GENERATED file, which should not be manually edited.\n * Instead edit one of the following:\n *  * the grammar file grammar/php.y\n *  * the skeleton file grammar/parser.template\n *  * the preprocessing script grammar/rebuildParsers.php\n */\nclass #(-p) extends \\PhpParser\\ParserAbstract\n{\n#tokenval\n    public const %s = %n;\n#endtokenval\n\n    protected int $tokenToSymbolMapSize = #(YYMAXLEX);\n    protected int $actionTableSize = #(YYLAST);\n    protected int $gotoTableSize = #(YYGLAST);\n\n    protected int $invalidSymbol = #(YYBADCH);\n    protected int $errorSymbol = #(YYINTERRTOK);\n    protected int $defaultAction = #(YYDEFAULT);\n    protected int $unexpectedTokenRule = #(YYUNEXPECTED);\n\n    protected int $YY2TBLSTATE = #(YY2TBLSTATE);\n    protected int $numNonLeafStates = #(YYNLSTATES);\n\n    protected array $symbolToName = array(\n        #listvar terminals\n    );\n\n    protected array $tokenToSymbol = array(\n        #listvar yytranslate\n    );\n\n    protected array $action = array(\n        #listvar yyaction\n    );\n\n    protected array $actionCheck = array(\n        #listvar yycheck\n    );\n\n    protected array $actionBase = array(\n        #listvar yybase\n    );\n\n    protected array $actionDefault = array(\n        #listvar yydefault\n    );\n\n    protected array $goto = array(\n        #listvar yygoto\n    );\n\n    protected array $gotoCheck = array(\n        #listvar yygcheck\n    );\n\n    protected array $gotoBase = array(\n        #listvar yygbase\n    );\n\n    protected array $gotoDefault = array(\n        #listvar yygdefault\n    );\n\n    protected array $ruleToNonTerminal = array(\n        #listvar yylhs\n    );\n\n    protected array $ruleToLength = array(\n        #listvar yylen\n    );\n#if -t\n\n    protected array $productions = array(\n        #production-strings;\n    );\n#endif\n\n    protected function initReduceCallbacks(): void {\n        $this->reduceCallbacks = [\n#reduce\n            %n => static function ($self, $stackPos) {\n                %b\n            },\n#noact\n            %n => null,\n#endreduce\n        ];\n    }\n}\n#tailcode;\n"
  },
  {
    "path": "grammar/php.y",
    "content": "%pure_parser\n%expect 2\n\n%right T_VOID_CAST\n%right T_THROW\n%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE\n%left ','\n%left T_LOGICAL_OR\n%left T_LOGICAL_XOR\n%left T_LOGICAL_AND\n%right T_PRINT\n%right T_YIELD\n%right T_DOUBLE_ARROW\n%right T_YIELD_FROM\n%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL T_COALESCE_EQUAL\n%left '?' ':'\n%right T_COALESCE\n%left T_BOOLEAN_OR\n%left T_BOOLEAN_AND\n%left '|'\n%left '^'\n%left T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG\n%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP\n%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL\n#if PHP7\n%left T_SL T_SR\n%left '+' '-' '.'\n#endif\n#if PHP8\n%left T_PIPE\n%left '.'\n%left T_SL T_SR\n%left '+' '-'\n#endif\n%left '*' '/' '%'\n%right '!'\n%nonassoc T_INSTANCEOF\n%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'\n%right T_POW\n%right '['\n%nonassoc T_NEW T_CLONE\n%token T_EXIT\n%token T_IF\n%left T_ELSEIF\n%left T_ELSE\n%left T_ENDIF\n%token T_LNUMBER\n%token T_DNUMBER\n%token T_STRING\n%token T_STRING_VARNAME\n%token T_VARIABLE\n%token T_NUM_STRING\n%token T_INLINE_HTML\n%token T_ENCAPSED_AND_WHITESPACE\n%token T_CONSTANT_ENCAPSED_STRING\n%token T_ECHO\n%token T_DO\n%token T_WHILE\n%token T_ENDWHILE\n%token T_FOR\n%token T_ENDFOR\n%token T_FOREACH\n%token T_ENDFOREACH\n%token T_DECLARE\n%token T_ENDDECLARE\n%token T_AS\n%token T_SWITCH\n%token T_MATCH\n%token T_ENDSWITCH\n%token T_CASE\n%token T_DEFAULT\n%token T_BREAK\n%token T_CONTINUE\n%token T_GOTO\n%token T_FUNCTION\n%token T_FN\n%token T_CONST\n%token T_RETURN\n%token T_TRY\n%token T_CATCH\n%token T_FINALLY\n%token T_THROW\n%token T_USE\n%token T_INSTEADOF\n%token T_GLOBAL\n%token T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC T_READONLY\n%token T_PUBLIC_SET\n%token T_PROTECTED_SET\n%token T_PRIVATE_SET\n%token T_VAR\n%token T_UNSET\n%token T_ISSET\n%token T_EMPTY\n%token T_HALT_COMPILER\n%token T_CLASS\n%token T_TRAIT\n%token T_INTERFACE\n%token T_ENUM\n%token T_EXTENDS\n%token T_IMPLEMENTS\n%token T_OBJECT_OPERATOR\n%token T_NULLSAFE_OBJECT_OPERATOR\n%token T_DOUBLE_ARROW\n%token T_LIST\n%token T_ARRAY\n%token T_CALLABLE\n%token T_CLASS_C\n%token T_TRAIT_C\n%token T_METHOD_C\n%token T_FUNC_C\n%token T_PROPERTY_C\n%token T_LINE\n%token T_FILE\n%token T_START_HEREDOC\n%token T_END_HEREDOC\n%token T_DOLLAR_OPEN_CURLY_BRACES\n%token T_CURLY_OPEN\n%token T_PAAMAYIM_NEKUDOTAYIM\n%token T_NAMESPACE\n%token T_NS_C\n%token T_DIR\n%token T_NS_SEPARATOR\n%token T_ELLIPSIS\n%token T_NAME_FULLY_QUALIFIED\n%token T_NAME_QUALIFIED\n%token T_NAME_RELATIVE\n%token T_ATTRIBUTE\n%token T_ENUM\n\n%%\n\nstart:\n    top_statement_list                                      { $$ = $this->handleNamespaces($1); }\n;\n\ntop_statement_list_ex:\n      top_statement_list_ex top_statement                   { pushNormalizing($1, $2); }\n    | /* empty */                                           { init(); }\n;\n\ntop_statement_list:\n      top_statement_list_ex\n          { makeZeroLengthNop($nop);\n            if ($nop !== null) { $1[] = $nop; } $$ = $1; }\n;\n\nampersand:\n      T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG\n    | T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG\n;\n\nreserved_non_modifiers:\n      T_INCLUDE | T_INCLUDE_ONCE | T_EVAL | T_REQUIRE | T_REQUIRE_ONCE | T_LOGICAL_OR | T_LOGICAL_XOR | T_LOGICAL_AND\n    | T_INSTANCEOF | T_NEW | T_CLONE | T_EXIT | T_IF | T_ELSEIF | T_ELSE | T_ENDIF | T_DO | T_WHILE\n    | T_ENDWHILE | T_FOR | T_ENDFOR | T_FOREACH | T_ENDFOREACH | T_DECLARE | T_ENDDECLARE | T_AS | T_TRY | T_CATCH\n    | T_FINALLY | T_THROW | T_USE | T_INSTEADOF | T_GLOBAL | T_VAR | T_UNSET | T_ISSET | T_EMPTY | T_CONTINUE | T_GOTO\n    | T_FUNCTION | T_CONST | T_RETURN | T_PRINT | T_YIELD | T_LIST | T_SWITCH | T_ENDSWITCH | T_CASE | T_DEFAULT\n    | T_BREAK | T_ARRAY | T_CALLABLE | T_EXTENDS | T_IMPLEMENTS | T_NAMESPACE | T_TRAIT | T_INTERFACE | T_CLASS\n    | T_CLASS_C | T_TRAIT_C | T_FUNC_C | T_METHOD_C | T_LINE | T_FILE | T_DIR | T_NS_C | T_FN\n    | T_MATCH | T_ENUM\n    | T_ECHO { $$ = $1; if ($$ === \"<?=\") $this->emitError(new Error('Cannot use \"<?=\" as an identifier', attributes())); }\n;\n\nsemi_reserved:\n      reserved_non_modifiers\n    | T_STATIC | T_ABSTRACT | T_FINAL | T_PRIVATE | T_PROTECTED | T_PUBLIC | T_READONLY\n;\n\nidentifier_maybe_reserved:\n      T_STRING                                              { $$ = Node\\Identifier[$1]; }\n    | semi_reserved                                         { $$ = Node\\Identifier[$1]; }\n;\n\nidentifier_not_reserved:\n      T_STRING                                              { $$ = Node\\Identifier[$1]; }\n;\n\nreserved_non_modifiers_identifier:\n      reserved_non_modifiers                                { $$ = Node\\Identifier[$1]; }\n;\n\nnamespace_declaration_name:\n      T_STRING                                              { $$ = Name[$1]; }\n    | semi_reserved                                         { $$ = Name[$1]; }\n    | T_NAME_QUALIFIED                                      { $$ = Name[$1]; }\n;\n\nnamespace_name:\n      T_STRING                                              { $$ = Name[$1]; }\n    | T_NAME_QUALIFIED                                      { $$ = Name[$1]; }\n;\n\nlegacy_namespace_name:\n      namespace_name\n    | T_NAME_FULLY_QUALIFIED                                { $$ = Name[substr($1, 1)]; }\n;\n\nplain_variable:\n      T_VARIABLE                                            { $$ = Expr\\Variable[parseVar($1)]; }\n;\n\nsemi:\n      ';'                                                   { /* nothing */ }\n    | error                                                 { /* nothing */ }\n;\n\nno_comma:\n      /* empty */ { /* nothing */ }\n    | ',' { $this->emitError(new Error('A trailing comma is not allowed here', attributes())); }\n;\n\noptional_comma:\n      /* empty */\n    | ','\n;\n\nattribute_decl:\n      class_name                                            { $$ = Node\\Attribute[$1, []]; }\n    | class_name argument_list                              { $$ = Node\\Attribute[$1, $2]; }\n;\n\nattribute_group:\n      attribute_decl                                        { init($1); }\n    | attribute_group ',' attribute_decl                    { push($1, $3); }\n;\n\nattribute:\n      T_ATTRIBUTE attribute_group optional_comma ']'        { $$ = Node\\AttributeGroup[$2]; }\n;\n\nattributes:\n      attribute                                             { init($1); }\n    | attributes attribute                                  { push($1, $2); }\n;\n\noptional_attributes:\n      /* empty */                                           { $$ = []; }\n    | attributes\n;\n\ntop_statement:\n      statement\n    | function_declaration_statement\n    | class_declaration_statement\n    | T_HALT_COMPILER '(' ')' ';'\n          { $$ = Stmt\\HaltCompiler[$this->handleHaltCompiler()]; }\n    | T_NAMESPACE namespace_declaration_name semi\n          { $$ = Stmt\\Namespace_[$2, null];\n            $$->setAttribute('kind', Stmt\\Namespace_::KIND_SEMICOLON);\n            $this->checkNamespace($$); }\n    | T_NAMESPACE namespace_declaration_name '{' top_statement_list '}'\n          { $$ = Stmt\\Namespace_[$2, $4];\n            $$->setAttribute('kind', Stmt\\Namespace_::KIND_BRACED);\n            $this->checkNamespace($$); }\n    | T_NAMESPACE '{' top_statement_list '}'\n          { $$ = Stmt\\Namespace_[null, $3];\n            $$->setAttribute('kind', Stmt\\Namespace_::KIND_BRACED);\n            $this->checkNamespace($$); }\n    | T_USE use_declarations semi                           { $$ = Stmt\\Use_[$2, Stmt\\Use_::TYPE_NORMAL]; }\n    | T_USE use_type use_declarations semi                  { $$ = Stmt\\Use_[$3, $2]; }\n    | group_use_declaration\n    | T_CONST constant_declaration_list semi                { $$ = new Stmt\\Const_($2, attributes(), []); }\n    | attributes T_CONST constant_declaration_list semi\n          { $$ = new Stmt\\Const_($3, attributes(), $1);\n            $this->checkConstantAttributes($$); }\n;\n\nuse_type:\n      T_FUNCTION                                            { $$ = Stmt\\Use_::TYPE_FUNCTION; }\n    | T_CONST                                               { $$ = Stmt\\Use_::TYPE_CONSTANT; }\n;\n\ngroup_use_declaration:\n      T_USE use_type legacy_namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations '}' semi\n          { $$ = Stmt\\GroupUse[$3, $6, $2]; }\n    | T_USE legacy_namespace_name T_NS_SEPARATOR '{' inline_use_declarations '}' semi\n          { $$ = Stmt\\GroupUse[$2, $5, Stmt\\Use_::TYPE_UNKNOWN]; }\n;\n\nunprefixed_use_declarations:\n      non_empty_unprefixed_use_declarations optional_comma\n;\n\nnon_empty_unprefixed_use_declarations:\n      non_empty_unprefixed_use_declarations ',' unprefixed_use_declaration\n          { push($1, $3); }\n    | unprefixed_use_declaration                            { init($1); }\n;\n\nuse_declarations:\n      non_empty_use_declarations no_comma\n;\n\nnon_empty_use_declarations:\n      non_empty_use_declarations ',' use_declaration        { push($1, $3); }\n    | use_declaration                                       { init($1); }\n;\n\ninline_use_declarations:\n      non_empty_inline_use_declarations optional_comma\n;\n\nnon_empty_inline_use_declarations:\n      non_empty_inline_use_declarations ',' inline_use_declaration\n          { push($1, $3); }\n    | inline_use_declaration                                { init($1); }\n;\n\nunprefixed_use_declaration:\n      namespace_name\n          { $$ = Node\\UseItem[$1, null, Stmt\\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); }\n    | namespace_name T_AS identifier_not_reserved\n          { $$ = Node\\UseItem[$1, $3, Stmt\\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); }\n;\n\nuse_declaration:\n      legacy_namespace_name\n          { $$ = Node\\UseItem[$1, null, Stmt\\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #1); }\n    | legacy_namespace_name T_AS identifier_not_reserved\n          { $$ = Node\\UseItem[$1, $3, Stmt\\Use_::TYPE_UNKNOWN]; $this->checkUseUse($$, #3); }\n;\n\ninline_use_declaration:\n      unprefixed_use_declaration                            { $$ = $1; $$->type = Stmt\\Use_::TYPE_NORMAL; }\n    | use_type unprefixed_use_declaration                   { $$ = $2; $$->type = $1; }\n;\n\nconstant_declaration_list:\n      non_empty_constant_declaration_list no_comma\n;\n\nnon_empty_constant_declaration_list:\n      non_empty_constant_declaration_list ',' constant_declaration\n          { push($1, $3); }\n    | constant_declaration                                  { init($1); }\n;\n\nconstant_declaration:\n    identifier_not_reserved '=' expr                        { $$ = Node\\Const_[$1, $3]; }\n;\n\nclass_const_list:\n      non_empty_class_const_list no_comma\n;\n\nnon_empty_class_const_list:\n      non_empty_class_const_list ',' class_const            { push($1, $3); }\n    | class_const                                           { init($1); }\n;\n\nclass_const:\n      T_STRING '=' expr\n          { $$ = Node\\Const_[new Node\\Identifier($1, stackAttributes(#1)), $3]; }\n    | semi_reserved '=' expr\n          { $$ = Node\\Const_[new Node\\Identifier($1, stackAttributes(#1)), $3]; }\n;\n\ninner_statement_list_ex:\n      inner_statement_list_ex inner_statement               { pushNormalizing($1, $2); }\n    | /* empty */                                           { init(); }\n;\n\ninner_statement_list:\n      inner_statement_list_ex\n          { makeZeroLengthNop($nop);\n            if ($nop !== null) { $1[] = $nop; } $$ = $1; }\n;\n\ninner_statement:\n      statement\n    | function_declaration_statement\n    | class_declaration_statement\n    | T_HALT_COMPILER\n          { throw new Error('__HALT_COMPILER() can only be used from the outermost scope', attributes()); }\n;\n\nnon_empty_statement:\n      '{' inner_statement_list '}'                          { $$ = Stmt\\Block[$2]; }\n    | T_IF '(' expr ')' blocklike_statement elseif_list else_single\n          { $$ = Stmt\\If_[$3, ['stmts' => $5, 'elseifs' => $6, 'else' => $7]]; }\n    | T_IF '(' expr ')' ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';'\n          { $$ = Stmt\\If_[$3, ['stmts' => $6, 'elseifs' => $7, 'else' => $8]]; }\n    | T_WHILE '(' expr ')' while_statement                  { $$ = Stmt\\While_[$3, $5]; }\n    | T_DO blocklike_statement T_WHILE '(' expr ')' ';'     { $$ = Stmt\\Do_   [$5, $2]; }\n    | T_FOR '(' for_expr ';'  for_expr ';' for_expr ')' for_statement\n          { $$ = Stmt\\For_[['init' => $3, 'cond' => $5, 'loop' => $7, 'stmts' => $9]]; }\n    | T_SWITCH '(' expr ')' switch_case_list                { $$ = Stmt\\Switch_[$3, $5]; }\n    | T_BREAK optional_expr semi                            { $$ = Stmt\\Break_[$2]; }\n    | T_CONTINUE optional_expr semi                         { $$ = Stmt\\Continue_[$2]; }\n    | T_RETURN optional_expr semi                           { $$ = Stmt\\Return_[$2]; }\n    | T_GLOBAL global_var_list semi                         { $$ = Stmt\\Global_[$2]; }\n    | T_STATIC static_var_list semi                         { $$ = Stmt\\Static_[$2]; }\n    | T_ECHO expr_list_forbid_comma semi                    { $$ = Stmt\\Echo_[$2]; }\n    | T_INLINE_HTML {\n        $$ = Stmt\\InlineHTML[$1];\n        $$->setAttribute('hasLeadingNewline', $this->inlineHtmlHasLeadingNewline(#1));\n    }\n    | expr semi                                             { $$ = Stmt\\Expression[$1]; }\n    | T_UNSET '(' variables_list ')' semi                   { $$ = Stmt\\Unset_[$3]; }\n    | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement\n          { $$ = Stmt\\Foreach_[$3, $5[0], ['keyVar' => null, 'byRef' => $5[1], 'stmts' => $7]]; }\n    | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement\n          { $$ = Stmt\\Foreach_[$3, $7[0], ['keyVar' => $5, 'byRef' => $7[1], 'stmts' => $9]]; }\n    | T_FOREACH '(' expr error ')' foreach_statement\n          { $$ = Stmt\\Foreach_[$3, new Expr\\Error(stackAttributes(#4)), ['stmts' => $6]]; }\n    | T_DECLARE '(' declare_list ')' declare_statement      { $$ = Stmt\\Declare_[$3, $5]; }\n    | T_TRY '{' inner_statement_list '}' catches optional_finally\n          { $$ = Stmt\\TryCatch[$3, $5, $6]; $this->checkTryCatch($$); }\n    | T_GOTO identifier_not_reserved semi                   { $$ = Stmt\\Goto_[$2]; }\n    | identifier_not_reserved ':'                           { $$ = Stmt\\Label[$1]; }\n    | error                                                 { $$ = null; /* means: no statement */ }\n;\n\nstatement:\n      non_empty_statement\n    | ';'                                                   { makeNop($$); }\n;\n\nblocklike_statement:\n     statement                                              { toBlock($1); }\n;\n\ncatches:\n      /* empty */                                           { init(); }\n    | catches catch                                         { push($1, $2); }\n;\n\nname_union:\n      name                                                  { init($1); }\n    | name_union '|' name                                   { push($1, $3); }\n;\n\ncatch:\n    T_CATCH '(' name_union optional_plain_variable ')' '{' inner_statement_list '}'\n        { $$ = Stmt\\Catch_[$3, $4, $7]; }\n;\n\noptional_finally:\n      /* empty */                                           { $$ = null; }\n    | T_FINALLY '{' inner_statement_list '}'                { $$ = Stmt\\Finally_[$3]; }\n;\n\nvariables_list:\n      non_empty_variables_list optional_comma\n;\n\nnon_empty_variables_list:\n      variable                                              { init($1); }\n    | non_empty_variables_list ',' variable                 { push($1, $3); }\n;\n\noptional_ref:\n      /* empty */                                           { $$ = false; }\n    | ampersand                                             { $$ = true; }\n;\n\noptional_arg_ref:\n      /* empty */                                           { $$ = false; }\n    | T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG                 { $$ = true; }\n;\n\noptional_ellipsis:\n      /* empty */                                           { $$ = false; }\n    | T_ELLIPSIS                                            { $$ = true; }\n;\n\nblock_or_error:\n      '{' inner_statement_list '}'                          { $$ = $2; }\n    | error                                                 { $$ = []; }\n;\n\nfn_identifier:\n      identifier_not_reserved\n    | T_READONLY                                            { $$ = Node\\Identifier[$1]; }\n    | T_EXIT                                                { $$ = Node\\Identifier[$1]; }\n    | T_CLONE                                               { $$ = Node\\Identifier[$1]; }\n;\n\nfunction_declaration_statement:\n      T_FUNCTION optional_ref fn_identifier '(' parameter_list ')' optional_return_type block_or_error\n          { $$ = Stmt\\Function_[$3, ['byRef' => $2, 'params' => $5, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; }\n    | attributes T_FUNCTION optional_ref fn_identifier '(' parameter_list ')' optional_return_type block_or_error\n          { $$ = Stmt\\Function_[$4, ['byRef' => $3, 'params' => $6, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; }\n;\n\nclass_declaration_statement:\n      class_entry_type identifier_not_reserved extends_from implements_list '{' class_statement_list '}'\n          { $$ = Stmt\\Class_[$2, ['type' => $1, 'extends' => $3, 'implements' => $4, 'stmts' => $6, 'attrGroups' => []]];\n            $this->checkClass($$, #2); }\n    | attributes class_entry_type identifier_not_reserved extends_from implements_list '{' class_statement_list '}'\n          { $$ = Stmt\\Class_[$3, ['type' => $2, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]];\n            $this->checkClass($$, #3); }\n    | optional_attributes T_INTERFACE identifier_not_reserved interface_extends_list '{' class_statement_list '}'\n          { $$ = Stmt\\Interface_[$3, ['extends' => $4, 'stmts' => $6, 'attrGroups' => $1]];\n            $this->checkInterface($$, #3); }\n    | optional_attributes T_TRAIT identifier_not_reserved '{' class_statement_list '}'\n          { $$ = Stmt\\Trait_[$3, ['stmts' => $5, 'attrGroups' => $1]]; }\n    | optional_attributes T_ENUM identifier_not_reserved enum_scalar_type implements_list '{' class_statement_list '}'\n          { $$ = Stmt\\Enum_[$3, ['scalarType' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]];\n            $this->checkEnum($$, #3); }\n;\n\nenum_scalar_type:\n      /* empty */                                           { $$ = null; }\n    | ':' type                                              { $$ = $2; }\n\nenum_case_expr:\n      /* empty */                                           { $$ = null; }\n    | '=' expr                                              { $$ = $2; }\n;\n\nclass_entry_type:\n      T_CLASS                                               { $$ = 0; }\n    | class_modifiers T_CLASS\n;\n\nclass_modifiers:\n      class_modifier\n    | class_modifiers class_modifier                        { $this->checkClassModifier($1, $2, #2); $$ = $1 | $2; }\n;\n\nclass_modifier:\n      T_ABSTRACT                                            { $$ = Modifiers::ABSTRACT; }\n    | T_FINAL                                               { $$ = Modifiers::FINAL; }\n    | T_READONLY                                            { $$ = Modifiers::READONLY; }\n;\n\nextends_from:\n      /* empty */                                           { $$ = null; }\n    | T_EXTENDS class_name                                  { $$ = $2; }\n;\n\ninterface_extends_list:\n      /* empty */                                           { $$ = array(); }\n    | T_EXTENDS class_name_list                             { $$ = $2; }\n;\n\nimplements_list:\n      /* empty */                                           { $$ = array(); }\n    | T_IMPLEMENTS class_name_list                          { $$ = $2; }\n;\n\nclass_name_list:\n      non_empty_class_name_list no_comma\n;\n\nnon_empty_class_name_list:\n      class_name                                            { init($1); }\n    | non_empty_class_name_list ',' class_name              { push($1, $3); }\n;\n\nfor_statement:\n      blocklike_statement\n    | ':' inner_statement_list T_ENDFOR ';'                 { $$ = $2; }\n;\n\nforeach_statement:\n      blocklike_statement\n    | ':' inner_statement_list T_ENDFOREACH ';'             { $$ = $2; }\n;\n\ndeclare_statement:\n      non_empty_statement                                   { toBlock($1); }\n    | ';'                                                   { $$ = null; }\n    | ':' inner_statement_list T_ENDDECLARE ';'             { $$ = $2; }\n;\n\ndeclare_list:\n      non_empty_declare_list no_comma\n;\n\nnon_empty_declare_list:\n      declare_list_element                                  { init($1); }\n    | non_empty_declare_list ',' declare_list_element       { push($1, $3); }\n;\n\ndeclare_list_element:\n      identifier_not_reserved '=' expr                      { $$ = Node\\DeclareItem[$1, $3]; }\n;\n\nswitch_case_list:\n      '{' case_list '}'                                     { $$ = $2; }\n    | '{' ';' case_list '}'                                 { $$ = $3; }\n    | ':' case_list T_ENDSWITCH ';'                         { $$ = $2; }\n    | ':' ';' case_list T_ENDSWITCH ';'                     { $$ = $3; }\n;\n\ncase_list:\n      /* empty */                                           { init(); }\n    | case_list case                                        { push($1, $2); }\n;\n\ncase:\n      T_CASE expr case_separator inner_statement_list_ex    { $$ = Stmt\\Case_[$2, $4]; }\n    | T_DEFAULT case_separator inner_statement_list_ex      { $$ = Stmt\\Case_[null, $3]; }\n;\n\ncase_separator:\n      ':'\n    | ';'\n;\n\nmatch:\n      T_MATCH '(' expr ')' '{' match_arm_list '}'           { $$ = Expr\\Match_[$3, $6]; }\n;\n\nmatch_arm_list:\n      /* empty */                                           { $$ = []; }\n    | non_empty_match_arm_list optional_comma\n;\n\nnon_empty_match_arm_list:\n      match_arm                                             { init($1); }\n    | non_empty_match_arm_list ',' match_arm                { push($1, $3); }\n;\n\nmatch_arm:\n      expr_list_allow_comma T_DOUBLE_ARROW expr             { $$ = Node\\MatchArm[$1, $3]; }\n    | T_DEFAULT optional_comma T_DOUBLE_ARROW expr          { $$ = Node\\MatchArm[null, $4]; }\n;\n\nwhile_statement:\n      blocklike_statement                                   { $$ = $1; }\n    | ':' inner_statement_list T_ENDWHILE ';'               { $$ = $2; }\n;\n\nelseif_list:\n      /* empty */                                           { init(); }\n    | elseif_list elseif                                    { push($1, $2); }\n;\n\nelseif:\n      T_ELSEIF '(' expr ')' blocklike_statement             { $$ = Stmt\\ElseIf_[$3, $5]; }\n;\n\nnew_elseif_list:\n      /* empty */                                           { init(); }\n    | new_elseif_list new_elseif                            { push($1, $2); }\n;\n\nnew_elseif:\n     T_ELSEIF '(' expr ')' ':' inner_statement_list\n         { $$ = Stmt\\ElseIf_[$3, $6]; $this->fixupAlternativeElse($$); }\n;\n\nelse_single:\n      /* empty */                                           { $$ = null; }\n    | T_ELSE blocklike_statement                            { $$ = Stmt\\Else_[$2]; }\n;\n\nnew_else_single:\n      /* empty */                                           { $$ = null; }\n    | T_ELSE ':' inner_statement_list\n          { $$ = Stmt\\Else_[$3]; $this->fixupAlternativeElse($$); }\n;\n\nforeach_variable:\n      variable                                              { $$ = array($1, false); }\n    | ampersand variable                                    { $$ = array($2, true); }\n    | list_expr                                             { $$ = array($1, false); }\n    | array_short_syntax\n          { $$ = array($this->fixupArrayDestructuring($1), false); }\n;\n\nparameter_list:\n      non_empty_parameter_list optional_comma\n    | /* empty */                                           { $$ = array(); }\n;\n\nnon_empty_parameter_list:\n      parameter                                             { init($1); }\n    | non_empty_parameter_list ',' parameter                { push($1, $3); }\n;\n\noptional_property_modifiers:\n      /* empty */               { $$ = 0; }\n    | optional_property_modifiers property_modifier\n          { $this->checkModifier($1, $2, #2); $$ = $1 | $2; }\n;\n\nproperty_modifier:\n      T_PUBLIC                  { $$ = Modifiers::PUBLIC; }\n    | T_PROTECTED               { $$ = Modifiers::PROTECTED; }\n    | T_PRIVATE                 { $$ = Modifiers::PRIVATE; }\n    | T_PUBLIC_SET              { $$ = Modifiers::PUBLIC_SET; }\n    | T_PROTECTED_SET           { $$ = Modifiers::PROTECTED_SET; }\n    | T_PRIVATE_SET             { $$ = Modifiers::PRIVATE_SET; }\n    | T_READONLY                { $$ = Modifiers::READONLY; }\n    | T_FINAL                   { $$ = Modifiers::FINAL; }\n;\n\nparameter:\n      optional_attributes optional_property_modifiers optional_type_without_static\n      optional_arg_ref optional_ellipsis plain_variable optional_property_hook_list\n          { $$ = new Node\\Param($6, null, $3, $4, $5, attributes(), $2, $1, $7);\n            $this->checkParam($$);\n            $this->addPropertyNameToHooks($$); }\n    | optional_attributes optional_property_modifiers optional_type_without_static\n      optional_arg_ref optional_ellipsis plain_variable '=' expr optional_property_hook_list\n          { $$ = new Node\\Param($6, $8, $3, $4, $5, attributes(), $2, $1, $9);\n            $this->checkParam($$);\n            $this->addPropertyNameToHooks($$); }\n    | optional_attributes optional_property_modifiers optional_type_without_static\n      optional_arg_ref optional_ellipsis error\n          { $$ = new Node\\Param(Expr\\Error[], null, $3, $4, $5, attributes(), $2, $1); }\n;\n\ntype_expr:\n      type\n    | '?' type                                              { $$ = Node\\NullableType[$2]; }\n    | union_type                                            { $$ = Node\\UnionType[$1]; }\n    | intersection_type\n;\n\ntype:\n      type_without_static\n    | T_STATIC                                              { $$ = Node\\Name['static']; }\n;\n\ntype_without_static:\n      name                                                  { $$ = $this->handleBuiltinTypes($1); }\n    | T_ARRAY                                               { $$ = Node\\Identifier['array']; }\n    | T_CALLABLE                                            { $$ = Node\\Identifier['callable']; }\n;\n\nunion_type_element:\n      type\n    | '(' intersection_type ')' { $$ = $2; }\n;\n\nunion_type:\n      union_type_element '|' union_type_element             { init($1, $3); }\n    | union_type '|' union_type_element                     { push($1, $3); }\n;\n\nunion_type_without_static_element:\n                type_without_static\n        |        '(' intersection_type_without_static ')' { $$ = $2; }\n;\n\nunion_type_without_static:\n      union_type_without_static_element '|' union_type_without_static_element   { init($1, $3); }\n    | union_type_without_static '|' union_type_without_static_element           { push($1, $3); }\n;\n\nintersection_type_list:\n      type T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type   { init($1, $3); }\n    | intersection_type_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type\n          { push($1, $3); }\n;\n\nintersection_type:\n      intersection_type_list { $$ = Node\\IntersectionType[$1]; }\n;\n\nintersection_type_without_static_list:\n      type_without_static T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static\n          { init($1, $3); }\n    | intersection_type_without_static_list T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG type_without_static\n          { push($1, $3); }\n;\n\nintersection_type_without_static:\n      intersection_type_without_static_list { $$ = Node\\IntersectionType[$1]; }\n;\n\ntype_expr_without_static:\n      type_without_static\n    | '?' type_without_static                               { $$ = Node\\NullableType[$2]; }\n    | union_type_without_static                             { $$ = Node\\UnionType[$1]; }\n    | intersection_type_without_static\n;\n\noptional_type_without_static:\n      /* empty */                                           { $$ = null; }\n    | type_expr_without_static\n;\n\noptional_return_type:\n      /* empty */                                           { $$ = null; }\n    | ':' type_expr                                         { $$ = $2; }\n    | ':' error                                             { $$ = null; }\n;\n\nargument_list:\n      '(' ')'                                               { $$ = array(); }\n    | '(' non_empty_argument_list optional_comma ')'        { $$ = $2; }\n    | '(' variadic_placeholder ')'                          { init($2); }\n;\n\nclone_argument_list:\n      '(' ')'                                              { $$ = array(); }\n    | '(' non_empty_clone_argument_list optional_comma ')' { $$ = $2; }\n    | '(' expr ',' ')'                                     { init(Node\\Arg[$2, false, false]); }\n    | '(' variadic_placeholder ')'                         { init($2); }\n;\n\nnon_empty_clone_argument_list:\n\t\texpr ',' argument\n\t\t\t{ init(new Node\\Arg($1, false, false, stackAttributes(#1)), $3); }\n\t|\targument_no_expr\n\t\t\t{ init($1); }\n\t|\tnon_empty_clone_argument_list ',' argument\n\t\t\t{ push($1, $3); }\n;\n\nvariadic_placeholder:\n      T_ELLIPSIS                                            { $$ = Node\\VariadicPlaceholder[]; }\n;\n\nnon_empty_argument_list:\n      argument                                              { init($1); }\n    | non_empty_argument_list ',' argument                  { push($1, $3); }\n;\n\nargument_no_expr:\n      ampersand variable                                    { $$ = Node\\Arg[$2, true, false]; }\n    | T_ELLIPSIS expr                                       { $$ = Node\\Arg[$2, false, true]; }\n    | identifier_maybe_reserved ':' expr\n          { $$ = new Node\\Arg($3, false, false, attributes(), $1); }\n;\n\nargument:\n      expr                                                  { $$ = Node\\Arg[$1, false, false]; }\n    | argument_no_expr                                      { $$ = $1; }\n;\n\nglobal_var_list:\n      non_empty_global_var_list no_comma\n;\n\nnon_empty_global_var_list:\n      non_empty_global_var_list ',' global_var              { push($1, $3); }\n    | global_var                                            { init($1); }\n;\n\nglobal_var:\n      simple_variable\n;\n\nstatic_var_list:\n      non_empty_static_var_list no_comma\n;\n\nnon_empty_static_var_list:\n      non_empty_static_var_list ',' static_var              { push($1, $3); }\n    | static_var                                            { init($1); }\n;\n\nstatic_var:\n      plain_variable                                        { $$ = Node\\StaticVar[$1, null]; }\n    | plain_variable '=' expr                               { $$ = Node\\StaticVar[$1, $3]; }\n;\n\nclass_statement_list_ex:\n      class_statement_list_ex class_statement               { if ($2 !== null) { push($1, $2); } else { $$ = $1; } }\n    | /* empty */                                           { init(); }\n;\n\nclass_statement_list:\n      class_statement_list_ex\n          { makeZeroLengthNop($nop);\n            if ($nop !== null) { $1[] = $nop; } $$ = $1; }\n;\n\nclass_statement:\n      optional_attributes variable_modifiers optional_type_without_static property_declaration_list semi\n          { $$ = new Stmt\\Property($2, $4, attributes(), $3, $1); }\n#if PHP8\n    | optional_attributes variable_modifiers optional_type_without_static property_declaration_list '{' property_hook_list '}'\n          { $$ = new Stmt\\Property($2, $4, attributes(), $3, $1, $6);\n            $this->checkPropertyHooksForMultiProperty($$, #5);\n            $this->checkEmptyPropertyHookList($6, #5);\n            $this->addPropertyNameToHooks($$); }\n#endif\n    | optional_attributes method_modifiers T_CONST class_const_list semi\n          { $$ = new Stmt\\ClassConst($4, $2, attributes(), $1);\n            $this->checkClassConst($$, #2); }\n    | optional_attributes method_modifiers T_CONST type_expr class_const_list semi\n          { $$ = new Stmt\\ClassConst($5, $2, attributes(), $1, $4);\n            $this->checkClassConst($$, #2); }\n    | optional_attributes method_modifiers T_FUNCTION optional_ref identifier_maybe_reserved '(' parameter_list ')'\n      optional_return_type method_body\n          { $$ = Stmt\\ClassMethod[$5, ['type' => $2, 'byRef' => $4, 'params' => $7, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]];\n            $this->checkClassMethod($$, #2); }\n    | T_USE class_name_list trait_adaptations               { $$ = Stmt\\TraitUse[$2, $3]; }\n    | optional_attributes T_CASE identifier_maybe_reserved enum_case_expr semi\n         { $$ = Stmt\\EnumCase[$3, $4, $1]; }\n    | error                                                 { $$ = null; /* will be skipped */ }\n;\n\ntrait_adaptations:\n      ';'                                                   { $$ = array(); }\n    | '{' trait_adaptation_list '}'                         { $$ = $2; }\n;\n\ntrait_adaptation_list:\n      /* empty */                                           { init(); }\n    | trait_adaptation_list trait_adaptation                { push($1, $2); }\n;\n\ntrait_adaptation:\n      trait_method_reference_fully_qualified T_INSTEADOF class_name_list ';'\n          { $$ = Stmt\\TraitUseAdaptation\\Precedence[$1[0], $1[1], $3]; }\n    | trait_method_reference T_AS member_modifier identifier_maybe_reserved ';'\n          { $$ = Stmt\\TraitUseAdaptation\\Alias[$1[0], $1[1], $3, $4]; }\n    | trait_method_reference T_AS member_modifier ';'\n          { $$ = Stmt\\TraitUseAdaptation\\Alias[$1[0], $1[1], $3, null]; }\n    | trait_method_reference T_AS identifier_not_reserved ';'\n          { $$ = Stmt\\TraitUseAdaptation\\Alias[$1[0], $1[1], null, $3]; }\n    | trait_method_reference T_AS reserved_non_modifiers_identifier ';'\n          { $$ = Stmt\\TraitUseAdaptation\\Alias[$1[0], $1[1], null, $3]; }\n;\n\ntrait_method_reference_fully_qualified:\n      name T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved { $$ = array($1, $3); }\n;\ntrait_method_reference:\n      trait_method_reference_fully_qualified\n    | identifier_maybe_reserved                             { $$ = array(null, $1); }\n;\n\nmethod_body:\n      ';' /* abstract method */                             { $$ = null; }\n    | block_or_error\n;\n\nvariable_modifiers:\n      non_empty_member_modifiers\n    | T_VAR                                                 { $$ = 0; }\n;\n\nmethod_modifiers:\n      /* empty */                                           { $$ = 0; }\n    | non_empty_member_modifiers\n;\n\nnon_empty_member_modifiers:\n      member_modifier\n    | non_empty_member_modifiers member_modifier            { $this->checkModifier($1, $2, #2); $$ = $1 | $2; }\n;\n\nmember_modifier:\n      T_PUBLIC                                              { $$ = Modifiers::PUBLIC; }\n    | T_PROTECTED                                           { $$ = Modifiers::PROTECTED; }\n    | T_PRIVATE                                             { $$ = Modifiers::PRIVATE; }\n    | T_PUBLIC_SET                                          { $$ = Modifiers::PUBLIC_SET; }\n    | T_PROTECTED_SET                                       { $$ = Modifiers::PROTECTED_SET; }\n    | T_PRIVATE_SET                                         { $$ = Modifiers::PRIVATE_SET; }\n    | T_STATIC                                              { $$ = Modifiers::STATIC; }\n    | T_ABSTRACT                                            { $$ = Modifiers::ABSTRACT; }\n    | T_FINAL                                               { $$ = Modifiers::FINAL; }\n    | T_READONLY                                            { $$ = Modifiers::READONLY; }\n;\n\nproperty_declaration_list:\n      non_empty_property_declaration_list no_comma\n;\n\nnon_empty_property_declaration_list:\n      property_declaration                                  { init($1); }\n    | non_empty_property_declaration_list ',' property_declaration\n          { push($1, $3); }\n;\n\nproperty_decl_name:\n      T_VARIABLE                                            { $$ = Node\\VarLikeIdentifier[parseVar($1)]; }\n;\n\nproperty_declaration:\n      property_decl_name                                    { $$ = Node\\PropertyItem[$1, null]; }\n    | property_decl_name '=' expr                           { $$ = Node\\PropertyItem[$1, $3]; }\n;\n\nproperty_hook_list:\n      /* empty */                                           { $$ = []; }\n    | property_hook_list property_hook                      { push($1, $2); }\n;\n\noptional_property_hook_list:\n      /* empty */                                           { $$ = []; }\n#if PHP8\n    | '{' property_hook_list '}'                            { $$ = $2; $this->checkEmptyPropertyHookList($2, #1); }\n#endif\n;\n\nproperty_hook:\n      optional_attributes property_hook_modifiers optional_ref identifier_not_reserved property_hook_body\n          { $$ = Node\\PropertyHook[$4, $5, ['flags' => $2, 'byRef' => $3, 'params' => [], 'attrGroups' => $1]];\n            $this->checkPropertyHook($$, null); }\n    | optional_attributes property_hook_modifiers optional_ref identifier_not_reserved '(' parameter_list ')' property_hook_body\n          { $$ = Node\\PropertyHook[$4, $8, ['flags' => $2, 'byRef' => $3, 'params' => $6, 'attrGroups' => $1]];\n            $this->checkPropertyHook($$, #5); }\n;\n\nproperty_hook_body:\n      ';'                                                   { $$ = null; }\n    | '{' inner_statement_list '}'                          { $$ = $2; }\n    | T_DOUBLE_ARROW expr ';'                               { $$ = $2; }\n;\n\nproperty_hook_modifiers:\n      /* empty */                                           { $$ = 0; }\n    | property_hook_modifiers member_modifier\n          { $this->checkPropertyHookModifiers($1, $2, #2); $$ = $1 | $2; }\n;\n\nexpr_list_forbid_comma:\n      non_empty_expr_list no_comma\n;\n\nexpr_list_allow_comma:\n      non_empty_expr_list optional_comma\n;\n\nnon_empty_expr_list:\n      non_empty_expr_list ',' expr                          { push($1, $3); }\n    | expr                                                  { init($1); }\n;\n\nfor_expr:\n      /* empty */                                           { $$ = array(); }\n    | expr_list_forbid_comma\n;\n\nexpr:\n      variable\n    | list_expr '=' expr                                    { $$ = Expr\\Assign[$1, $3]; }\n    | array_short_syntax '=' expr\n          { $$ = Expr\\Assign[$this->fixupArrayDestructuring($1), $3]; }\n    | variable '=' expr                                     { $$ = Expr\\Assign[$1, $3]; }\n    | variable '=' ampersand variable                       { $$ = Expr\\AssignRef[$1, $4]; }\n    | variable '=' ampersand new_expr\n          { $$ = Expr\\AssignRef[$1, $4];\n            if (!$this->phpVersion->allowsAssignNewByReference()) {\n                $this->emitError(new Error('Cannot assign new by reference', attributes()));\n            }\n          }\n    | new_expr\n    | match\n    | T_CLONE clone_argument_list                           { $$ = Expr\\FuncCall[new Node\\Name($1, stackAttributes(#1)), $2]; }\n    | T_CLONE expr                                          { $$ = Expr\\Clone_[$2]; }\n    | variable T_PLUS_EQUAL expr                            { $$ = Expr\\AssignOp\\Plus      [$1, $3]; }\n    | variable T_MINUS_EQUAL expr                           { $$ = Expr\\AssignOp\\Minus     [$1, $3]; }\n    | variable T_MUL_EQUAL expr                             { $$ = Expr\\AssignOp\\Mul       [$1, $3]; }\n    | variable T_DIV_EQUAL expr                             { $$ = Expr\\AssignOp\\Div       [$1, $3]; }\n    | variable T_CONCAT_EQUAL expr                          { $$ = Expr\\AssignOp\\Concat    [$1, $3]; }\n    | variable T_MOD_EQUAL expr                             { $$ = Expr\\AssignOp\\Mod       [$1, $3]; }\n    | variable T_AND_EQUAL expr                             { $$ = Expr\\AssignOp\\BitwiseAnd[$1, $3]; }\n    | variable T_OR_EQUAL expr                              { $$ = Expr\\AssignOp\\BitwiseOr [$1, $3]; }\n    | variable T_XOR_EQUAL expr                             { $$ = Expr\\AssignOp\\BitwiseXor[$1, $3]; }\n    | variable T_SL_EQUAL expr                              { $$ = Expr\\AssignOp\\ShiftLeft [$1, $3]; }\n    | variable T_SR_EQUAL expr                              { $$ = Expr\\AssignOp\\ShiftRight[$1, $3]; }\n    | variable T_POW_EQUAL expr                             { $$ = Expr\\AssignOp\\Pow       [$1, $3]; }\n    | variable T_COALESCE_EQUAL expr                        { $$ = Expr\\AssignOp\\Coalesce  [$1, $3]; }\n    | variable T_INC                                        { $$ = Expr\\PostInc[$1]; }\n    | T_INC variable                                        { $$ = Expr\\PreInc [$2]; }\n    | variable T_DEC                                        { $$ = Expr\\PostDec[$1]; }\n    | T_DEC variable                                        { $$ = Expr\\PreDec [$2]; }\n    | expr T_BOOLEAN_OR expr                                { $$ = Expr\\BinaryOp\\BooleanOr [$1, $3]; }\n    | expr T_BOOLEAN_AND expr                               { $$ = Expr\\BinaryOp\\BooleanAnd[$1, $3]; }\n    | expr T_LOGICAL_OR expr                                { $$ = Expr\\BinaryOp\\LogicalOr [$1, $3]; }\n    | expr T_LOGICAL_AND expr                               { $$ = Expr\\BinaryOp\\LogicalAnd[$1, $3]; }\n    | expr T_LOGICAL_XOR expr                               { $$ = Expr\\BinaryOp\\LogicalXor[$1, $3]; }\n    | expr '|' expr                                         { $$ = Expr\\BinaryOp\\BitwiseOr [$1, $3]; }\n    | expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr   { $$ = Expr\\BinaryOp\\BitwiseAnd[$1, $3]; }\n    | expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr       { $$ = Expr\\BinaryOp\\BitwiseAnd[$1, $3]; }\n    | expr '^' expr                                         { $$ = Expr\\BinaryOp\\BitwiseXor[$1, $3]; }\n    | expr '.' expr                                         { $$ = Expr\\BinaryOp\\Concat    [$1, $3]; }\n    | expr '+' expr                                         { $$ = Expr\\BinaryOp\\Plus      [$1, $3]; }\n    | expr '-' expr                                         { $$ = Expr\\BinaryOp\\Minus     [$1, $3]; }\n    | expr '*' expr                                         { $$ = Expr\\BinaryOp\\Mul       [$1, $3]; }\n    | expr '/' expr                                         { $$ = Expr\\BinaryOp\\Div       [$1, $3]; }\n    | expr '%' expr                                         { $$ = Expr\\BinaryOp\\Mod       [$1, $3]; }\n    | expr T_SL expr                                        { $$ = Expr\\BinaryOp\\ShiftLeft [$1, $3]; }\n    | expr T_SR expr                                        { $$ = Expr\\BinaryOp\\ShiftRight[$1, $3]; }\n    | expr T_POW expr                                       { $$ = Expr\\BinaryOp\\Pow       [$1, $3]; }\n    | '+' expr %prec T_INC                                  { $$ = Expr\\UnaryPlus [$2]; }\n    | '-' expr %prec T_INC                                  { $$ = Expr\\UnaryMinus[$2]; }\n    | '!' expr                                              { $$ = Expr\\BooleanNot[$2]; }\n    | '~' expr                                              { $$ = Expr\\BitwiseNot[$2]; }\n    | expr T_IS_IDENTICAL expr                              { $$ = Expr\\BinaryOp\\Identical     [$1, $3]; }\n    | expr T_IS_NOT_IDENTICAL expr                          { $$ = Expr\\BinaryOp\\NotIdentical  [$1, $3]; }\n    | expr T_IS_EQUAL expr                                  { $$ = Expr\\BinaryOp\\Equal         [$1, $3]; }\n    | expr T_IS_NOT_EQUAL expr                              { $$ = Expr\\BinaryOp\\NotEqual      [$1, $3]; }\n    | expr T_SPACESHIP expr                                 { $$ = Expr\\BinaryOp\\Spaceship     [$1, $3]; }\n    | expr '<' expr                                         { $$ = Expr\\BinaryOp\\Smaller       [$1, $3]; }\n    | expr T_IS_SMALLER_OR_EQUAL expr                       { $$ = Expr\\BinaryOp\\SmallerOrEqual[$1, $3]; }\n    | expr '>' expr                                         { $$ = Expr\\BinaryOp\\Greater       [$1, $3]; }\n    | expr T_IS_GREATER_OR_EQUAL expr                       { $$ = Expr\\BinaryOp\\GreaterOrEqual[$1, $3]; }\n#if PHP8\n    | expr T_PIPE expr {\n          $$ = Expr\\BinaryOp\\Pipe[$1, $3];\n          $this->checkPipeOperatorParentheses($3);\n      }\n#endif\n    | expr T_INSTANCEOF class_name_reference                { $$ = Expr\\Instanceof_[$1, $3]; }\n    | '(' expr ')' {\n          $$ = $2;\n          if ($$ instanceof Expr\\ArrowFunction) {\n              $this->parenthesizedArrowFunctions->offsetSet($$);\n          }\n      }\n    | expr '?' expr ':' expr                                { $$ = Expr\\Ternary[$1, $3,   $5]; }\n    | expr '?' ':' expr                                     { $$ = Expr\\Ternary[$1, null, $4]; }\n    | expr T_COALESCE expr                                  { $$ = Expr\\BinaryOp\\Coalesce[$1, $3]; }\n    | T_ISSET '(' expr_list_allow_comma ')'                 { $$ = Expr\\Isset_[$3]; }\n    | T_EMPTY '(' expr ')'                                  { $$ = Expr\\Empty_[$3]; }\n    | T_INCLUDE expr                                        { $$ = Expr\\Include_[$2, Expr\\Include_::TYPE_INCLUDE]; }\n    | T_INCLUDE_ONCE expr                                   { $$ = Expr\\Include_[$2, Expr\\Include_::TYPE_INCLUDE_ONCE]; }\n    | T_EVAL '(' expr ')'                                   { $$ = Expr\\Eval_[$3]; }\n    | T_REQUIRE expr                                        { $$ = Expr\\Include_[$2, Expr\\Include_::TYPE_REQUIRE]; }\n    | T_REQUIRE_ONCE expr                                   { $$ = Expr\\Include_[$2, Expr\\Include_::TYPE_REQUIRE_ONCE]; }\n    | T_INT_CAST expr\n          { $attrs = attributes();\n            $attrs['kind'] = $this->getIntCastKind($1);\n            $$ = new Expr\\Cast\\Int_($2, $attrs); }\n    | T_DOUBLE_CAST expr\n          { $attrs = attributes();\n            $attrs['kind'] = $this->getFloatCastKind($1);\n            $$ = new Expr\\Cast\\Double($2, $attrs); }\n    | T_STRING_CAST expr\n          { $attrs = attributes();\n            $attrs['kind'] = $this->getStringCastKind($1);\n            $$ = new Expr\\Cast\\String_($2, $attrs); }\n    | T_ARRAY_CAST expr                                     { $$ = Expr\\Cast\\Array_  [$2]; }\n    | T_OBJECT_CAST expr                                    { $$ = Expr\\Cast\\Object_ [$2]; }\n    | T_BOOL_CAST expr\n          { $attrs = attributes();\n            $attrs['kind'] = $this->getBoolCastKind($1);\n            $$ = new Expr\\Cast\\Bool_($2, $attrs); }\n    | T_UNSET_CAST expr                                     { $$ = Expr\\Cast\\Unset_  [$2]; }\n    | T_VOID_CAST expr                                      { $$ = Expr\\Cast\\Void_   [$2]; }\n    | T_EXIT ctor_arguments\n          { $$ = $this->createExitExpr($1, #1, $2, attributes()); }\n    | '@' expr                                              { $$ = Expr\\ErrorSuppress[$2]; }\n    | scalar\n    | '`' backticks_expr '`'                                { $$ = Expr\\ShellExec[$2]; }\n    | T_PRINT expr                                          { $$ = Expr\\Print_[$2]; }\n    | T_YIELD                                               { $$ = Expr\\Yield_[null, null]; }\n    | T_YIELD expr                                          { $$ = Expr\\Yield_[$2, null]; }\n    | T_YIELD expr T_DOUBLE_ARROW expr                      { $$ = Expr\\Yield_[$4, $2]; }\n    | T_YIELD_FROM expr                                     { $$ = Expr\\YieldFrom[$2]; }\n    | T_THROW expr                                          { $$ = Expr\\Throw_[$2]; }\n\n    | T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW\n          { $$ = Expr\\ArrowFunction[['static' => false, 'byRef' => $2, 'params' => $4, 'returnType' => $6, 'expr' => $8, 'attrGroups' => []]]; }\n    | T_STATIC T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW\n          { $$ = Expr\\ArrowFunction[['static' => true, 'byRef' => $3, 'params' => $5, 'returnType' => $7, 'expr' => $9, 'attrGroups' => []]]; }\n    | T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error\n          { $$ = Expr\\Closure[['static' => false, 'byRef' => $2, 'params' => $4, 'uses' => $6, 'returnType' => $7, 'stmts' => $8, 'attrGroups' => []]]; }\n    | T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type       block_or_error\n          { $$ = Expr\\Closure[['static' => true, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => []]]; }\n\n    | attributes T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW\n          { $$ = Expr\\ArrowFunction[['static' => false, 'byRef' => $3, 'params' => $5, 'returnType' => $7, 'expr' => $9, 'attrGroups' => $1]]; }\n    | attributes T_STATIC T_FN optional_ref '(' parameter_list ')' optional_return_type T_DOUBLE_ARROW expr %prec T_THROW\n          { $$ = Expr\\ArrowFunction[['static' => true, 'byRef' => $4, 'params' => $6, 'returnType' => $8, 'expr' => $10, 'attrGroups' => $1]]; }\n    | attributes T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type block_or_error\n          { $$ = Expr\\Closure[['static' => false, 'byRef' => $3, 'params' => $5, 'uses' => $7, 'returnType' => $8, 'stmts' => $9, 'attrGroups' => $1]]; }\n    | attributes T_STATIC T_FUNCTION optional_ref '(' parameter_list ')' lexical_vars optional_return_type       block_or_error\n          { $$ = Expr\\Closure[['static' => true, 'byRef' => $4, 'params' => $6, 'uses' => $8, 'returnType' => $9, 'stmts' => $10, 'attrGroups' => $1]]; }\n;\n\nanonymous_class:\n      optional_attributes class_entry_type ctor_arguments extends_from implements_list '{' class_statement_list '}'\n          { $$ = array(Stmt\\Class_[null, ['type' => $2, 'extends' => $4, 'implements' => $5, 'stmts' => $7, 'attrGroups' => $1]], $3);\n            $this->checkClass($$[0], -1); }\n;\n\nnew_dereferenceable:\n      T_NEW class_name_reference argument_list              { $$ = Expr\\New_[$2, $3]; }\n    | T_NEW anonymous_class\n          { list($class, $ctorArgs) = $2; $$ = Expr\\New_[$class, $ctorArgs]; }\n;\n\nnew_non_dereferenceable:\n      T_NEW class_name_reference                            { $$ = Expr\\New_[$2, []]; }\n;\n\nnew_expr:\n      new_dereferenceable\n    | new_non_dereferenceable\n;\n\nlexical_vars:\n      /* empty */                                           { $$ = array(); }\n    | T_USE '(' lexical_var_list ')'                        { $$ = $3; }\n;\n\nlexical_var_list:\n      non_empty_lexical_var_list optional_comma\n;\n\nnon_empty_lexical_var_list:\n      lexical_var                                           { init($1); }\n    | non_empty_lexical_var_list ',' lexical_var            { push($1, $3); }\n;\n\nlexical_var:\n      optional_ref plain_variable                           { $$ = Node\\ClosureUse[$2, $1]; }\n;\n\nname_readonly:\n      T_READONLY                                            { $$ = Name[$1]; }\n;\n\nfunction_call:\n      name argument_list                                    { $$ = Expr\\FuncCall[$1, $2]; }\n    | name_readonly argument_list                           { $$ = Expr\\FuncCall[$1, $2]; }\n    | callable_expr argument_list                           { $$ = Expr\\FuncCall[$1, $2]; }\n    | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM member_name argument_list\n          { $$ = Expr\\StaticCall[$1, $3, $4]; }\n;\n\nclass_name:\n      T_STATIC                                              { $$ = Name[$1]; }\n    | name\n;\n\nname:\n      T_STRING                                              { $$ = Name[$1]; }\n    | T_NAME_QUALIFIED                                      { $$ = Name[$1]; }\n    | T_NAME_FULLY_QUALIFIED                                { $$ = Name\\FullyQualified[substr($1, 1)]; }\n    | T_NAME_RELATIVE                                       { $$ = Name\\Relative[substr($1, 10)]; }\n;\n\nclass_name_reference:\n      class_name\n    | new_variable\n    | '(' expr ')'                                          { $$ = $2; }\n    | error                                                 { $$ = Expr\\Error[]; $this->errorState = 2; }\n;\n\nclass_name_or_var:\n      class_name\n    | fully_dereferenceable\n;\n\nbackticks_expr:\n      /* empty */                                           { $$ = array(); }\n    | encaps_string_part\n          { $$ = array($1); parseEncapsed($$, '`', $this->phpVersion->supportsUnicodeEscapes()); }\n    | encaps_list                                           { parseEncapsed($1, '`', $this->phpVersion->supportsUnicodeEscapes()); $$ = $1; }\n;\n\nctor_arguments:\n      /* empty */                                           { $$ = array(); }\n    | argument_list\n;\n\nconstant:\n      name                                                  { $$ = Expr\\ConstFetch[$1]; }\n    | T_LINE                                                { $$ = Scalar\\MagicConst\\Line[]; }\n    | T_FILE                                                { $$ = Scalar\\MagicConst\\File[]; }\n    | T_DIR                                                 { $$ = Scalar\\MagicConst\\Dir[]; }\n    | T_CLASS_C                                             { $$ = Scalar\\MagicConst\\Class_[]; }\n    | T_TRAIT_C                                             { $$ = Scalar\\MagicConst\\Trait_[]; }\n    | T_METHOD_C                                            { $$ = Scalar\\MagicConst\\Method[]; }\n    | T_FUNC_C                                              { $$ = Scalar\\MagicConst\\Function_[]; }\n    | T_NS_C                                                { $$ = Scalar\\MagicConst\\Namespace_[]; }\n    | T_PROPERTY_C                                          { $$ = Scalar\\MagicConst\\Property[]; }\n;\n\nclass_constant:\n      class_name_or_var T_PAAMAYIM_NEKUDOTAYIM identifier_maybe_reserved\n          { $$ = Expr\\ClassConstFetch[$1, $3]; }\n    | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM '{' expr '}'\n          { $$ = Expr\\ClassConstFetch[$1, $4]; }\n    /* We interpret an isolated FOO:: as an unfinished class constant fetch. It could also be\n       an unfinished static property fetch or unfinished scoped call. */\n    | class_name_or_var T_PAAMAYIM_NEKUDOTAYIM error\n          { $$ = Expr\\ClassConstFetch[$1, new Expr\\Error(stackAttributes(#3))]; $this->errorState = 2; }\n;\n\narray_short_syntax:\n      '[' array_pair_list ']'\n          { $attrs = attributes(); $attrs['kind'] = Expr\\Array_::KIND_SHORT;\n            $$ = new Expr\\Array_($2, $attrs); }\n;\n\ndereferenceable_scalar:\n      T_ARRAY '(' array_pair_list ')'\n          { $attrs = attributes(); $attrs['kind'] = Expr\\Array_::KIND_LONG;\n            $$ = new Expr\\Array_($3, $attrs);\n            $this->createdArrays->offsetSet($$); }\n    | array_short_syntax\n\t      { $$ = $1; $this->createdArrays->offsetSet($$); }\n    | T_CONSTANT_ENCAPSED_STRING\n          { $$ = Scalar\\String_::fromString($1, attributes(), $this->phpVersion->supportsUnicodeEscapes()); }\n    | '\"' encaps_list '\"'\n          { $attrs = attributes(); $attrs['kind'] = Scalar\\String_::KIND_DOUBLE_QUOTED;\n            parseEncapsed($2, '\"', $this->phpVersion->supportsUnicodeEscapes()); $$ = new Scalar\\InterpolatedString($2, $attrs); }\n;\n\nscalar:\n      T_LNUMBER\n          { $$ = $this->parseLNumber($1, attributes(), $this->phpVersion->allowsInvalidOctals()); }\n    | T_DNUMBER                                             { $$ = Scalar\\Float_::fromString($1, attributes()); }\n    | dereferenceable_scalar\n    | constant\n    | class_constant\n    | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC\n          { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); }\n    | T_START_HEREDOC T_END_HEREDOC\n          { $$ = $this->parseDocString($1, '', $2, attributes(), stackAttributes(#2), true); }\n    | T_START_HEREDOC encaps_list T_END_HEREDOC\n          { $$ = $this->parseDocString($1, $2, $3, attributes(), stackAttributes(#3), true); }\n;\n\noptional_expr:\n      /* empty */                                           { $$ = null; }\n    | expr\n;\n\nfully_dereferenceable:\n      variable\n    | '(' expr ')'                                          { $$ = $2; }\n    | dereferenceable_scalar\n    | class_constant\n    | new_dereferenceable\n;\n\narray_object_dereferenceable:\n      fully_dereferenceable\n    | constant\n;\n\ncallable_expr:\n      callable_variable\n    | '(' expr ')'                                          { $$ = $2; }\n    | dereferenceable_scalar\n    | new_dereferenceable\n;\n\ncallable_variable:\n      simple_variable\n    | array_object_dereferenceable '[' optional_expr ']'     { $$ = Expr\\ArrayDimFetch[$1, $3]; }\n#if PHP7\n    | array_object_dereferenceable '{' expr '}'              { $$ = Expr\\ArrayDimFetch[$1, $3]; }\n#endif\n    | function_call\n    | array_object_dereferenceable T_OBJECT_OPERATOR property_name argument_list\n          { $$ = Expr\\MethodCall[$1, $3, $4]; }\n    | array_object_dereferenceable T_NULLSAFE_OBJECT_OPERATOR property_name argument_list\n          { $$ = Expr\\NullsafeMethodCall[$1, $3, $4]; }\n;\n\noptional_plain_variable:\n      /* empty */                                           { $$ = null; }\n    | plain_variable\n;\n\nvariable:\n      callable_variable\n    | static_member\n    | array_object_dereferenceable T_OBJECT_OPERATOR property_name\n          { $$ = Expr\\PropertyFetch[$1, $3]; }\n    | array_object_dereferenceable T_NULLSAFE_OBJECT_OPERATOR property_name\n          { $$ = Expr\\NullsafePropertyFetch[$1, $3]; }\n;\n\nsimple_variable:\n      plain_variable\n    | '$' '{' expr '}'                                      { $$ = Expr\\Variable[$3]; }\n    | '$' simple_variable                                   { $$ = Expr\\Variable[$2]; }\n    | '$' error                                             { $$ = Expr\\Variable[Expr\\Error[]]; $this->errorState = 2; }\n;\n\nstatic_member_prop_name:\n      simple_variable\n          { $var = $1->name; $$ = \\is_string($var) ? Node\\VarLikeIdentifier[$var] : $var; }\n;\n\nstatic_member:\n      class_name_or_var T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name\n          { $$ = Expr\\StaticPropertyFetch[$1, $3]; }\n;\n\nnew_variable:\n      simple_variable\n    | new_variable '[' optional_expr ']'                    { $$ = Expr\\ArrayDimFetch[$1, $3]; }\n#if PHP7\n    | new_variable '{' expr '}'                             { $$ = Expr\\ArrayDimFetch[$1, $3]; }\n#endif\n    | new_variable T_OBJECT_OPERATOR property_name          { $$ = Expr\\PropertyFetch[$1, $3]; }\n    | new_variable T_NULLSAFE_OBJECT_OPERATOR property_name { $$ = Expr\\NullsafePropertyFetch[$1, $3]; }\n    | class_name T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name\n          { $$ = Expr\\StaticPropertyFetch[$1, $3]; }\n    | new_variable T_PAAMAYIM_NEKUDOTAYIM static_member_prop_name\n          { $$ = Expr\\StaticPropertyFetch[$1, $3]; }\n;\n\nmember_name:\n      identifier_maybe_reserved\n    | '{' expr '}'                                          { $$ = $2; }\n    | simple_variable\n;\n\nproperty_name:\n      identifier_not_reserved\n    | '{' expr '}'                                          { $$ = $2; }\n    | simple_variable\n    | error                                                 { $$ = Expr\\Error[]; $this->errorState = 2; }\n;\n\nlist_expr:\n      T_LIST '(' inner_array_pair_list ')'\n          { $$ = Expr\\List_[$3]; $$->setAttribute('kind', Expr\\List_::KIND_LIST);\n            $this->postprocessList($$); }\n;\n\narray_pair_list:\n      inner_array_pair_list\n          { $$ = $1; $end = count($$)-1; if ($$[$end]->value instanceof Expr\\Error) array_pop($$); }\n;\n\ncomma_or_error:\n      ','\n    | error\n          { /* do nothing -- prevent default action of $$=$1. See #551. */ }\n;\n\ninner_array_pair_list:\n      inner_array_pair_list comma_or_error array_pair       { push($1, $3); }\n    | array_pair                                            { init($1); }\n;\n\narray_pair:\n      expr                                                  { $$ = Node\\ArrayItem[$1, null, false]; }\n    | ampersand variable                                    { $$ = Node\\ArrayItem[$2, null, true]; }\n    | list_expr                                             { $$ = Node\\ArrayItem[$1, null, false]; }\n    | expr T_DOUBLE_ARROW expr                              { $$ = Node\\ArrayItem[$3, $1,   false]; }\n    | expr T_DOUBLE_ARROW ampersand variable                { $$ = Node\\ArrayItem[$4, $1,   true]; }\n    | expr T_DOUBLE_ARROW list_expr                         { $$ = Node\\ArrayItem[$3, $1,   false]; }\n    | T_ELLIPSIS expr                                       { $$ = new Node\\ArrayItem($2, null, false, attributes(), true); }\n    | /* empty */\n        { /* Create an Error node now to remember the position. We'll later either report an error,\n             or convert this into a null element, depending on whether this is a creation or destructuring context. */\n          $attrs = $this->createEmptyElemAttributes($this->tokenPos);\n          $$ = new Node\\ArrayItem(new Expr\\Error($attrs), null, false, $attrs); }\n;\n\nencaps_list:\n      encaps_list encaps_var                                { push($1, $2); }\n    | encaps_list encaps_string_part                        { push($1, $2); }\n    | encaps_var                                            { init($1); }\n    | encaps_string_part encaps_var                         { init($1, $2); }\n;\n\nencaps_string_part:\n      T_ENCAPSED_AND_WHITESPACE\n          { $attrs = attributes(); $attrs['rawValue'] = $1; $$ = new Node\\InterpolatedStringPart($1, $attrs); }\n;\n\nencaps_str_varname:\n      T_STRING_VARNAME                                      { $$ = Expr\\Variable[$1]; }\n;\n\nencaps_var:\n      plain_variable\n    | plain_variable '[' encaps_var_offset ']'              { $$ = Expr\\ArrayDimFetch[$1, $3]; }\n    | plain_variable T_OBJECT_OPERATOR identifier_not_reserved\n          { $$ = Expr\\PropertyFetch[$1, $3]; }\n    | plain_variable T_NULLSAFE_OBJECT_OPERATOR identifier_not_reserved\n          { $$ = Expr\\NullsafePropertyFetch[$1, $3]; }\n    | T_DOLLAR_OPEN_CURLY_BRACES expr '}'                   { $$ = Expr\\Variable[$2]; }\n    | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}'       { $$ = Expr\\Variable[$2]; }\n    | T_DOLLAR_OPEN_CURLY_BRACES encaps_str_varname '[' expr ']' '}'\n          { $$ = Expr\\ArrayDimFetch[$2, $4]; }\n    | T_CURLY_OPEN variable '}'                             { $$ = $2; }\n;\n\nencaps_var_offset:\n      T_STRING                                              { $$ = Scalar\\String_[$1]; }\n    | T_NUM_STRING                                          { $$ = $this->parseNumString($1, attributes()); }\n    | '-' T_NUM_STRING                                      { $$ = $this->parseNumString('-' . $2, attributes()); }\n    | plain_variable\n;\n\n%%\n"
  },
  {
    "path": "grammar/phpyLang.php",
    "content": "<?php declare(strict_types=1);\n\n///////////////////////////////\n/// Utility regex constants ///\n///////////////////////////////\n\nconst LIB = '(?(DEFINE)\n    (?<singleQuotedString>\\'[^\\\\\\\\\\']*+(?:\\\\\\\\.[^\\\\\\\\\\']*+)*+\\')\n    (?<doubleQuotedString>\"[^\\\\\\\\\"]*+(?:\\\\\\\\.[^\\\\\\\\\"]*+)*+\")\n    (?<string>(?&singleQuotedString)|(?&doubleQuotedString))\n    (?<comment>/\\*[^*]*+(?:\\*(?!/)[^*]*+)*+\\*/)\n    (?<code>\\{[^\\'\"/{}]*+(?:(?:(?&string)|(?&comment)|(?&code)|/)[^\\'\"/{}]*+)*+})\n)';\n\nconst PARAMS = '\\[(?<params>[^[\\]]*+(?:\\[(?&params)\\][^[\\]]*+)*+)\\]';\nconst ARGS   = '\\((?<args>[^()]*+(?:\\((?&args)\\)[^()]*+)*+)\\)';\n\n///////////////////////////////\n/// Preprocessing functions ///\n///////////////////////////////\n\nfunction preprocessGrammar($code) {\n    $code = resolveNodes($code);\n    $code = resolveMacros($code);\n    $code = resolveStackAccess($code);\n    $code = str_replace('$this', '$self', $code);\n\n    return $code;\n}\n\nfunction resolveNodes($code) {\n    return preg_replace_callback(\n        '~\\b(?<name>[A-Z][a-zA-Z_\\\\\\\\]++)\\s*' . PARAMS . '~',\n        function ($matches) {\n            // recurse\n            $matches['params'] = resolveNodes($matches['params']);\n\n            $params = magicSplit(\n                '(?:' . PARAMS . '|' . ARGS . ')(*SKIP)(*FAIL)|,',\n                $matches['params']\n            );\n\n            $paramCode = '';\n            foreach ($params as $param) {\n                $paramCode .= $param . ', ';\n            }\n\n            return 'new ' . $matches['name'] . '(' . $paramCode . 'attributes())';\n        },\n        $code\n    );\n}\n\nfunction resolveMacros($code) {\n    return preg_replace_callback(\n        '~\\b(?<!::|->)(?!array\\()(?<name>[a-z][A-Za-z]++)' . ARGS . '~',\n        function ($matches) {\n            // recurse\n            $matches['args'] = resolveMacros($matches['args']);\n\n            $name = $matches['name'];\n            $args = magicSplit(\n                '(?:' . PARAMS . '|' . ARGS . ')(*SKIP)(*FAIL)|,',\n                $matches['args']\n            );\n\n            if ('attributes' === $name) {\n                assertArgs(0, $args, $name);\n                return '$this->getAttributes($this->tokenStartStack[#1], $this->tokenEndStack[$stackPos])';\n            }\n\n            if ('stackAttributes' === $name) {\n                assertArgs(1, $args, $name);\n                return '$this->getAttributes($this->tokenStartStack[' . $args[0] . '], '\n                       . ' $this->tokenEndStack[' . $args[0] . '])';\n            }\n\n            if ('init' === $name) {\n                return '$$ = array(' . implode(', ', $args) . ')';\n            }\n\n            if ('push' === $name) {\n                assertArgs(2, $args, $name);\n\n                return $args[0] . '[] = ' . $args[1] . '; $$ = ' . $args[0];\n            }\n\n            if ('pushNormalizing' === $name) {\n                assertArgs(2, $args, $name);\n\n                return 'if (' . $args[1] . ' !== null) { ' . $args[0] . '[] = ' . $args[1] . '; } $$ = ' . $args[0] . ';';\n            }\n\n            if ('toBlock' == $name) {\n                assertArgs(1, $args, $name);\n\n                return 'if (' . $args[0] . ' instanceof Stmt\\Block) { $$ = ' . $args[0] . '->stmts; } '\n                     . 'else if (' . $args[0] . ' === null) { $$ = []; } '\n                     . 'else { $$ = [' . $args[0] . ']; }';\n            }\n\n            if ('parseVar' === $name) {\n                assertArgs(1, $args, $name);\n\n                return 'substr(' . $args[0] . ', 1)';\n            }\n\n            if ('parseEncapsed' === $name) {\n                assertArgs(3, $args, $name);\n\n                return 'foreach (' . $args[0] . ' as $s) { if ($s instanceof Node\\InterpolatedStringPart) {'\n                       . ' $s->value = Node\\Scalar\\String_::parseEscapeSequences($s->value, ' . $args[1] . ', ' . $args[2] . '); } }';\n            }\n\n            if ('makeNop' === $name) {\n                assertArgs(1, $args, $name);\n\n                return $args[0] . ' = $this->maybeCreateNop($this->tokenStartStack[#1], $this->tokenEndStack[$stackPos])';\n            }\n\n            if ('makeZeroLengthNop' == $name) {\n                assertArgs(1, $args, $name);\n\n                return $args[0] . ' = $this->maybeCreateZeroLengthNop($this->tokenPos);';\n            }\n\n            return $matches[0];\n        },\n        $code\n    );\n}\n\nfunction assertArgs($num, $args, $name) {\n    if ($num != count($args)) {\n        die('Wrong argument count for ' . $name . '().');\n    }\n}\n\nfunction resolveStackAccess($code) {\n    $code = preg_replace('/\\$\\d+/', '$this->semStack[$0]', $code);\n    $code = preg_replace('/#(\\d+)/', '$$1', $code);\n    return $code;\n}\n\nfunction removeTrailingWhitespace($code) {\n    $lines = explode(\"\\n\", $code);\n    $lines = array_map('rtrim', $lines);\n    return implode(\"\\n\", $lines);\n}\n\n//////////////////////////////\n/// Regex helper functions ///\n//////////////////////////////\n\nfunction regex($regex) {\n    return '~' . LIB . '(?:' . str_replace('~', '\\~', $regex) . ')~';\n}\n\nfunction magicSplit($regex, $string) {\n    $pieces = preg_split(regex('(?:(?&string)|(?&comment)|(?&code))(*SKIP)(*FAIL)|' . $regex), $string);\n\n    foreach ($pieces as &$piece) {\n        $piece = trim($piece);\n    }\n\n    if ($pieces === ['']) {\n        return [];\n    }\n\n    return $pieces;\n}\n"
  },
  {
    "path": "grammar/rebuildParsers.php",
    "content": "<?php declare(strict_types=1);\n\nrequire __DIR__ . '/phpyLang.php';\n\n$parserToDefines = [\n    'Php7' => ['PHP7' => true],\n    'Php8' => ['PHP8' => true],\n];\n\n$grammarFile    = __DIR__ . '/php.y';\n$skeletonFile   = __DIR__ . '/parser.template';\n$tmpGrammarFile = __DIR__ . '/tmp_parser.phpy';\n$tmpResultFile  = __DIR__ . '/tmp_parser.php';\n$resultDir = __DIR__ . '/../lib/PhpParser/Parser';\n\n$kmyacc = getenv('KMYACC');\nif (!$kmyacc) {\n    // Use phpyacc from dev dependencies by default.\n    $kmyacc = __DIR__ . '/../vendor/bin/phpyacc';\n}\n\n$options = array_flip($argv);\n$optionDebug = isset($options['--debug']);\n$optionKeepTmpGrammar = isset($options['--keep-tmp-grammar']);\n\n///////////////////\n/// Main script ///\n///////////////////\n\nforeach ($parserToDefines as $name => $defines) {\n    echo \"Building temporary $name grammar file.\\n\";\n\n    $grammarCode = file_get_contents($grammarFile);\n    $grammarCode = replaceIfBlocks($grammarCode, $defines);\n    $grammarCode = preprocessGrammar($grammarCode);\n\n    file_put_contents($tmpGrammarFile, $grammarCode);\n\n    $additionalArgs = $optionDebug ? '-t -v' : '';\n\n    echo \"Building $name parser.\\n\";\n    $output = execCmd(\"$kmyacc $additionalArgs -m $skeletonFile -p $name $tmpGrammarFile\");\n\n    $resultCode = file_get_contents($tmpResultFile);\n    $resultCode = removeTrailingWhitespace($resultCode);\n\n    ensureDirExists($resultDir);\n    file_put_contents(\"$resultDir/$name.php\", $resultCode);\n    unlink($tmpResultFile);\n\n    if (!$optionKeepTmpGrammar) {\n        unlink($tmpGrammarFile);\n    }\n}\n\n////////////////////////////////\n/// Utility helper functions ///\n////////////////////////////////\n\nfunction ensureDirExists($dir) {\n    if (!is_dir($dir)) {\n        mkdir($dir, 0777, true);\n    }\n}\n\nfunction execCmd($cmd) {\n    $output = trim(shell_exec(\"$cmd 2>&1\") ?? '');\n    if ($output !== \"\") {\n        echo \"> \" . $cmd . \"\\n\";\n        echo $output;\n    }\n    return $output;\n}\n\nfunction replaceIfBlocks(string $code, array $defines): string {\n    return preg_replace_callback('/\\n#if\\s+(\\w+)\\n(.*?)\\n#endif/s', function ($matches) use ($defines) {\n        $value = $defines[$matches[1]] ?? false;\n        return $value ? $matches[2] : '';\n    }, $code);\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/ClassConst.php",
    "content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Const_;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Stmt;\n\nclass ClassConst implements PhpParser\\Builder {\n    protected int $flags = 0;\n    /** @var array<string, mixed> */\n    protected array $attributes = [];\n    /** @var list<Const_> */\n    protected array $constants = [];\n\n    /** @var list<Node\\AttributeGroup> */\n    protected array $attributeGroups = [];\n    /** @var Identifier|Node\\Name|Node\\ComplexType|null */\n    protected ?Node $type = null;\n\n    /**\n     * Creates a class constant builder\n     *\n     * @param string|Identifier $name Name\n     * @param Node\\Expr|bool|null|int|float|string|array|\\UnitEnum $value Value\n     */\n    public function __construct($name, $value) {\n        $this->constants = [new Const_($name, BuilderHelpers::normalizeValue($value))];\n    }\n\n    /**\n     * Add another constant to const group\n     *\n     * @param string|Identifier $name Name\n     * @param Node\\Expr|bool|null|int|float|string|array|\\UnitEnum $value Value\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addConst($name, $value) {\n        $this->constants[] = new Const_($name, BuilderHelpers::normalizeValue($value));\n\n        return $this;\n    }\n\n    /**\n     * Makes the constant public.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePublic() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC);\n\n        return $this;\n    }\n\n    /**\n     * Makes the constant protected.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeProtected() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED);\n\n        return $this;\n    }\n\n    /**\n     * Makes the constant private.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePrivate() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE);\n\n        return $this;\n    }\n\n    /**\n     * Makes the constant final.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeFinal() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::FINAL);\n\n        return $this;\n    }\n\n    /**\n     * Sets doc comment for the constant.\n     *\n     * @param PhpParser\\Comment\\Doc|string $docComment Doc comment to set\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function setDocComment($docComment) {\n        $this->attributes = [\n            'comments' => [BuilderHelpers::normalizeDocComment($docComment)]\n        ];\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n\n    /**\n     * Sets the constant type.\n     *\n     * @param string|Node\\Name|Identifier|Node\\ComplexType $type\n     *\n     * @return $this\n     */\n    public function setType($type) {\n        $this->type = BuilderHelpers::normalizeType($type);\n\n        return $this;\n    }\n\n    /**\n     * Returns the built class node.\n     *\n     * @return Stmt\\ClassConst The built constant node\n     */\n    public function getNode(): PhpParser\\Node {\n        return new Stmt\\ClassConst(\n            $this->constants,\n            $this->flags,\n            $this->attributes,\n            $this->attributeGroups,\n            $this->type\n        );\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Class_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Stmt;\n\nclass Class_ extends Declaration {\n    protected string $name;\n    protected ?Name $extends = null;\n    /** @var list<Name> */\n    protected array $implements = [];\n    protected int $flags = 0;\n    /** @var list<Stmt\\TraitUse> */\n    protected array $uses = [];\n    /** @var list<Stmt\\ClassConst> */\n    protected array $constants = [];\n    /** @var list<Stmt\\Property> */\n    protected array $properties = [];\n    /** @var list<Stmt\\ClassMethod> */\n    protected array $methods = [];\n    /** @var list<Node\\AttributeGroup> */\n    protected array $attributeGroups = [];\n\n    /**\n     * Creates a class builder.\n     *\n     * @param string $name Name of the class\n     */\n    public function __construct(string $name) {\n        $this->name = $name;\n    }\n\n    /**\n     * Extends a class.\n     *\n     * @param Name|string $class Name of class to extend\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function extend($class) {\n        $this->extends = BuilderHelpers::normalizeName($class);\n\n        return $this;\n    }\n\n    /**\n     * Implements one or more interfaces.\n     *\n     * @param Name|string ...$interfaces Names of interfaces to implement\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function implement(...$interfaces) {\n        foreach ($interfaces as $interface) {\n            $this->implements[] = BuilderHelpers::normalizeName($interface);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Makes the class abstract.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeAbstract() {\n        $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::ABSTRACT);\n\n        return $this;\n    }\n\n    /**\n     * Makes the class final.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeFinal() {\n        $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::FINAL);\n\n        return $this;\n    }\n\n    /**\n     * Makes the class readonly.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeReadonly() {\n        $this->flags = BuilderHelpers::addClassModifier($this->flags, Modifiers::READONLY);\n\n        return $this;\n    }\n\n    /**\n     * Adds a statement.\n     *\n     * @param Stmt|PhpParser\\Builder $stmt The statement to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addStmt($stmt) {\n        $stmt = BuilderHelpers::normalizeNode($stmt);\n\n        if ($stmt instanceof Stmt\\Property) {\n            $this->properties[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\ClassMethod) {\n            $this->methods[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\TraitUse) {\n            $this->uses[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\ClassConst) {\n            $this->constants[] = $stmt;\n        } else {\n            throw new \\LogicException(sprintf('Unexpected node of type \"%s\"', $stmt->getType()));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n\n    /**\n     * Returns the built class node.\n     *\n     * @return Stmt\\Class_ The built class node\n     */\n    public function getNode(): PhpParser\\Node {\n        return new Stmt\\Class_($this->name, [\n            'flags' => $this->flags,\n            'extends' => $this->extends,\n            'implements' => $this->implements,\n            'stmts' => array_merge($this->uses, $this->constants, $this->properties, $this->methods),\n            'attrGroups' => $this->attributeGroups,\n        ], $this->attributes);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Declaration.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\n\nabstract class Declaration implements PhpParser\\Builder {\n    /** @var array<string, mixed> */\n    protected array $attributes = [];\n\n    /**\n     * Adds a statement.\n     *\n     * @param PhpParser\\Node\\Stmt|PhpParser\\Builder $stmt The statement to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    abstract public function addStmt($stmt);\n\n    /**\n     * Adds multiple statements.\n     *\n     * @param (PhpParser\\Node\\Stmt|PhpParser\\Builder)[] $stmts The statements to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addStmts(array $stmts) {\n        foreach ($stmts as $stmt) {\n            $this->addStmt($stmt);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Sets doc comment for the declaration.\n     *\n     * @param PhpParser\\Comment\\Doc|string $docComment Doc comment to set\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function setDocComment($docComment) {\n        $this->attributes['comments'] = [\n            BuilderHelpers::normalizeDocComment($docComment)\n        ];\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/EnumCase.php",
    "content": "<?php\n\ndeclare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Stmt;\n\nclass EnumCase implements PhpParser\\Builder {\n    /** @var Identifier|string */\n    protected $name;\n    protected ?Node\\Expr $value = null;\n    /** @var array<string, mixed> */\n    protected array $attributes = [];\n\n    /** @var list<Node\\AttributeGroup> */\n    protected array $attributeGroups = [];\n\n    /**\n     * Creates an enum case builder.\n     *\n     * @param string|Identifier $name Name\n     */\n    public function __construct($name) {\n        $this->name = $name;\n    }\n\n    /**\n     * Sets the value.\n     *\n     * @param Node\\Expr|string|int $value\n     *\n     * @return $this\n     */\n    public function setValue($value) {\n        $this->value = BuilderHelpers::normalizeValue($value);\n\n        return $this;\n    }\n\n    /**\n     * Sets doc comment for the constant.\n     *\n     * @param PhpParser\\Comment\\Doc|string $docComment Doc comment to set\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function setDocComment($docComment) {\n        $this->attributes = [\n            'comments' => [BuilderHelpers::normalizeDocComment($docComment)]\n        ];\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n\n    /**\n     * Returns the built enum case node.\n     *\n     * @return Stmt\\EnumCase The built constant node\n     */\n    public function getNode(): PhpParser\\Node {\n        return new Stmt\\EnumCase(\n            $this->name,\n            $this->value,\n            $this->attributeGroups,\n            $this->attributes\n        );\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Enum_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Stmt;\n\nclass Enum_ extends Declaration {\n    protected string $name;\n    protected ?Identifier $scalarType = null;\n    /** @var list<Name> */\n    protected array $implements = [];\n    /** @var list<Stmt\\TraitUse> */\n    protected array $uses = [];\n    /** @var list<Stmt\\EnumCase> */\n    protected array $enumCases = [];\n    /** @var list<Stmt\\ClassConst> */\n    protected array $constants = [];\n    /** @var list<Stmt\\ClassMethod> */\n    protected array $methods = [];\n    /** @var list<Node\\AttributeGroup> */\n    protected array $attributeGroups = [];\n\n    /**\n     * Creates an enum builder.\n     *\n     * @param string $name Name of the enum\n     */\n    public function __construct(string $name) {\n        $this->name = $name;\n    }\n\n    /**\n     * Sets the scalar type.\n     *\n     * @param string|Identifier $scalarType\n     *\n     * @return $this\n     */\n    public function setScalarType($scalarType) {\n        $this->scalarType = BuilderHelpers::normalizeType($scalarType);\n\n        return $this;\n    }\n\n    /**\n     * Implements one or more interfaces.\n     *\n     * @param Name|string ...$interfaces Names of interfaces to implement\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function implement(...$interfaces) {\n        foreach ($interfaces as $interface) {\n            $this->implements[] = BuilderHelpers::normalizeName($interface);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Adds a statement.\n     *\n     * @param Stmt|PhpParser\\Builder $stmt The statement to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addStmt($stmt) {\n        $stmt = BuilderHelpers::normalizeNode($stmt);\n\n        if ($stmt instanceof Stmt\\EnumCase) {\n            $this->enumCases[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\ClassMethod) {\n            $this->methods[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\TraitUse) {\n            $this->uses[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\ClassConst) {\n            $this->constants[] = $stmt;\n        } else {\n            throw new \\LogicException(sprintf('Unexpected node of type \"%s\"', $stmt->getType()));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n\n    /**\n     * Returns the built class node.\n     *\n     * @return Stmt\\Enum_ The built enum node\n     */\n    public function getNode(): PhpParser\\Node {\n        return new Stmt\\Enum_($this->name, [\n            'scalarType' => $this->scalarType,\n            'implements' => $this->implements,\n            'stmts' => array_merge($this->uses, $this->enumCases, $this->constants, $this->methods),\n            'attrGroups' => $this->attributeGroups,\n        ], $this->attributes);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/FunctionLike.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Node;\n\nabstract class FunctionLike extends Declaration {\n    protected bool $returnByRef = false;\n    /** @var Node\\Param[] */\n    protected array $params = [];\n\n    /** @var Node\\Identifier|Node\\Name|Node\\ComplexType|null */\n    protected ?Node $returnType = null;\n\n    /**\n     * Make the function return by reference.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeReturnByRef() {\n        $this->returnByRef = true;\n\n        return $this;\n    }\n\n    /**\n     * Adds a parameter.\n     *\n     * @param Node\\Param|Param $param The parameter to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addParam($param) {\n        $param = BuilderHelpers::normalizeNode($param);\n\n        if (!$param instanceof Node\\Param) {\n            throw new \\LogicException(sprintf('Expected parameter node, got \"%s\"', $param->getType()));\n        }\n\n        $this->params[] = $param;\n\n        return $this;\n    }\n\n    /**\n     * Adds multiple parameters.\n     *\n     * @param (Node\\Param|Param)[] $params The parameters to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addParams(array $params) {\n        foreach ($params as $param) {\n            $this->addParam($param);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Sets the return type for PHP 7.\n     *\n     * @param string|Node\\Name|Node\\Identifier|Node\\ComplexType $type\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function setReturnType($type) {\n        $this->returnType = BuilderHelpers::normalizeType($type);\n\n        return $this;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Function_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt;\n\nclass Function_ extends FunctionLike {\n    protected string $name;\n    /** @var list<Stmt> */\n    protected array $stmts = [];\n\n    /** @var list<Node\\AttributeGroup> */\n    protected array $attributeGroups = [];\n\n    /**\n     * Creates a function builder.\n     *\n     * @param string $name Name of the function\n     */\n    public function __construct(string $name) {\n        $this->name = $name;\n    }\n\n    /**\n     * Adds a statement.\n     *\n     * @param Node|PhpParser\\Builder $stmt The statement to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addStmt($stmt) {\n        $this->stmts[] = BuilderHelpers::normalizeStmt($stmt);\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n\n    /**\n     * Returns the built function node.\n     *\n     * @return Stmt\\Function_ The built function node\n     */\n    public function getNode(): Node {\n        return new Stmt\\Function_($this->name, [\n            'byRef'      => $this->returnByRef,\n            'params'     => $this->params,\n            'returnType' => $this->returnType,\n            'stmts'      => $this->stmts,\n            'attrGroups' => $this->attributeGroups,\n        ], $this->attributes);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Interface_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Stmt;\n\nclass Interface_ extends Declaration {\n    protected string $name;\n    /** @var list<Name> */\n    protected array $extends = [];\n    /** @var list<Stmt\\ClassConst> */\n    protected array $constants = [];\n    /** @var list<Stmt\\ClassMethod> */\n    protected array $methods = [];\n    /** @var list<Node\\AttributeGroup> */\n    protected array $attributeGroups = [];\n\n    /**\n     * Creates an interface builder.\n     *\n     * @param string $name Name of the interface\n     */\n    public function __construct(string $name) {\n        $this->name = $name;\n    }\n\n    /**\n     * Extends one or more interfaces.\n     *\n     * @param Name|string ...$interfaces Names of interfaces to extend\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function extend(...$interfaces) {\n        foreach ($interfaces as $interface) {\n            $this->extends[] = BuilderHelpers::normalizeName($interface);\n        }\n\n        return $this;\n    }\n\n    /**\n     * Adds a statement.\n     *\n     * @param Stmt|PhpParser\\Builder $stmt The statement to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addStmt($stmt) {\n        $stmt = BuilderHelpers::normalizeNode($stmt);\n\n        if ($stmt instanceof Stmt\\ClassConst) {\n            $this->constants[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\ClassMethod) {\n            // we erase all statements in the body of an interface method\n            $stmt->stmts = null;\n            $this->methods[] = $stmt;\n        } else {\n            throw new \\LogicException(sprintf('Unexpected node of type \"%s\"', $stmt->getType()));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n\n    /**\n     * Returns the built interface node.\n     *\n     * @return Stmt\\Interface_ The built interface node\n     */\n    public function getNode(): PhpParser\\Node {\n        return new Stmt\\Interface_($this->name, [\n            'extends' => $this->extends,\n            'stmts' => array_merge($this->constants, $this->methods),\n            'attrGroups' => $this->attributeGroups,\n        ], $this->attributes);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Method.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt;\n\nclass Method extends FunctionLike {\n    protected string $name;\n\n    protected int $flags = 0;\n\n    /** @var list<Stmt>|null */\n    protected ?array $stmts = [];\n\n    /** @var list<Node\\AttributeGroup> */\n    protected array $attributeGroups = [];\n\n    /**\n     * Creates a method builder.\n     *\n     * @param string $name Name of the method\n     */\n    public function __construct(string $name) {\n        $this->name = $name;\n    }\n\n    /**\n     * Makes the method public.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePublic() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC);\n\n        return $this;\n    }\n\n    /**\n     * Makes the method protected.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeProtected() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED);\n\n        return $this;\n    }\n\n    /**\n     * Makes the method private.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePrivate() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE);\n\n        return $this;\n    }\n\n    /**\n     * Makes the method static.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeStatic() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::STATIC);\n\n        return $this;\n    }\n\n    /**\n     * Makes the method abstract.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeAbstract() {\n        if (!empty($this->stmts)) {\n            throw new \\LogicException('Cannot make method with statements abstract');\n        }\n\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::ABSTRACT);\n        $this->stmts = null; // abstract methods don't have statements\n\n        return $this;\n    }\n\n    /**\n     * Makes the method final.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeFinal() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::FINAL);\n\n        return $this;\n    }\n\n    /**\n     * Adds a statement.\n     *\n     * @param Node|PhpParser\\Builder $stmt The statement to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addStmt($stmt) {\n        if (null === $this->stmts) {\n            throw new \\LogicException('Cannot add statements to an abstract method');\n        }\n\n        $this->stmts[] = BuilderHelpers::normalizeStmt($stmt);\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n\n    /**\n     * Returns the built method node.\n     *\n     * @return Stmt\\ClassMethod The built method node\n     */\n    public function getNode(): Node {\n        return new Stmt\\ClassMethod($this->name, [\n            'flags'      => $this->flags,\n            'byRef'      => $this->returnByRef,\n            'params'     => $this->params,\n            'returnType' => $this->returnType,\n            'stmts'      => $this->stmts,\n            'attrGroups' => $this->attributeGroups,\n        ], $this->attributes);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Namespace_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt;\n\nclass Namespace_ extends Declaration {\n    private ?Node\\Name $name;\n    /** @var Stmt[] */\n    private array $stmts = [];\n\n    /**\n     * Creates a namespace builder.\n     *\n     * @param Node\\Name|string|null $name Name of the namespace\n     */\n    public function __construct($name) {\n        $this->name = null !== $name ? BuilderHelpers::normalizeName($name) : null;\n    }\n\n    /**\n     * Adds a statement.\n     *\n     * @param Node|PhpParser\\Builder $stmt The statement to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addStmt($stmt) {\n        $this->stmts[] = BuilderHelpers::normalizeStmt($stmt);\n\n        return $this;\n    }\n\n    /**\n     * Returns the built node.\n     *\n     * @return Stmt\\Namespace_ The built node\n     */\n    public function getNode(): Node {\n        return new Stmt\\Namespace_($this->name, $this->stmts, $this->attributes);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Param.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\n\nclass Param implements PhpParser\\Builder {\n    protected string $name;\n    protected ?Node\\Expr $default = null;\n    /** @var Node\\Identifier|Node\\Name|Node\\ComplexType|null */\n    protected ?Node $type = null;\n    protected bool $byRef = false;\n    protected int $flags = 0;\n    protected bool $variadic = false;\n    /** @var list<Node\\AttributeGroup> */\n    protected array $attributeGroups = [];\n\n    /**\n     * Creates a parameter builder.\n     *\n     * @param string $name Name of the parameter\n     */\n    public function __construct(string $name) {\n        $this->name = $name;\n    }\n\n    /**\n     * Sets default value for the parameter.\n     *\n     * @param mixed $value Default value to use\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function setDefault($value) {\n        $this->default = BuilderHelpers::normalizeValue($value);\n\n        return $this;\n    }\n\n    /**\n     * Sets type for the parameter.\n     *\n     * @param string|Node\\Name|Node\\Identifier|Node\\ComplexType $type Parameter type\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function setType($type) {\n        $this->type = BuilderHelpers::normalizeType($type);\n        if ($this->type == 'void') {\n            throw new \\LogicException('Parameter type cannot be void');\n        }\n\n        return $this;\n    }\n\n    /**\n     * Make the parameter accept the value by reference.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeByRef() {\n        $this->byRef = true;\n\n        return $this;\n    }\n\n    /**\n     * Make the parameter variadic\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeVariadic() {\n        $this->variadic = true;\n\n        return $this;\n    }\n\n    /**\n     * Makes the (promoted) parameter public.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePublic() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC);\n\n        return $this;\n    }\n\n    /**\n     * Makes the (promoted) parameter protected.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeProtected() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED);\n\n        return $this;\n    }\n\n    /**\n     * Makes the (promoted) parameter private.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePrivate() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE);\n\n        return $this;\n    }\n\n    /**\n     * Makes the (promoted) parameter readonly.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeReadonly() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::READONLY);\n\n        return $this;\n    }\n\n    /**\n     * Gives the promoted property private(set) visibility.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePrivateSet() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE_SET);\n\n        return $this;\n    }\n\n    /**\n     * Gives the promoted property protected(set) visibility.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeProtectedSet() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED_SET);\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n\n    /**\n     * Returns the built parameter node.\n     *\n     * @return Node\\Param The built parameter node\n     */\n    public function getNode(): Node {\n        return new Node\\Param(\n            new Node\\Expr\\Variable($this->name),\n            $this->default, $this->type, $this->byRef, $this->variadic, [], $this->flags, $this->attributeGroups\n        );\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Property.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\Node\\ComplexType;\n\nclass Property implements PhpParser\\Builder {\n    protected string $name;\n\n    protected int $flags = 0;\n\n    protected ?Node\\Expr $default = null;\n    /** @var array<string, mixed> */\n    protected array $attributes = [];\n    /** @var null|Identifier|Name|ComplexType */\n    protected ?Node $type = null;\n    /** @var list<Node\\AttributeGroup> */\n    protected array $attributeGroups = [];\n    /** @var list<Node\\PropertyHook> */\n    protected array $hooks = [];\n\n    /**\n     * Creates a property builder.\n     *\n     * @param string $name Name of the property\n     */\n    public function __construct(string $name) {\n        $this->name = $name;\n    }\n\n    /**\n     * Makes the property public.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePublic() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PUBLIC);\n\n        return $this;\n    }\n\n    /**\n     * Makes the property protected.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeProtected() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED);\n\n        return $this;\n    }\n\n    /**\n     * Makes the property private.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePrivate() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE);\n\n        return $this;\n    }\n\n    /**\n     * Makes the property static.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeStatic() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::STATIC);\n\n        return $this;\n    }\n\n    /**\n     * Makes the property readonly.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeReadonly() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::READONLY);\n\n        return $this;\n    }\n\n    /**\n     * Makes the property abstract. Requires at least one property hook to be specified as well.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeAbstract() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::ABSTRACT);\n\n        return $this;\n    }\n\n    /**\n     * Makes the property final.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeFinal() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::FINAL);\n\n        return $this;\n    }\n\n    /**\n     * Gives the property private(set) visibility.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePrivateSet() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PRIVATE_SET);\n\n        return $this;\n    }\n\n    /**\n     * Gives the property protected(set) visibility.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeProtectedSet() {\n        $this->flags = BuilderHelpers::addModifier($this->flags, Modifiers::PROTECTED_SET);\n\n        return $this;\n    }\n\n    /**\n     * Sets default value for the property.\n     *\n     * @param mixed $value Default value to use\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function setDefault($value) {\n        $this->default = BuilderHelpers::normalizeValue($value);\n\n        return $this;\n    }\n\n    /**\n     * Sets doc comment for the property.\n     *\n     * @param PhpParser\\Comment\\Doc|string $docComment Doc comment to set\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function setDocComment($docComment) {\n        $this->attributes = [\n            'comments' => [BuilderHelpers::normalizeDocComment($docComment)]\n        ];\n\n        return $this;\n    }\n\n    /**\n     * Sets the property type for PHP 7.4+.\n     *\n     * @param string|Name|Identifier|ComplexType $type\n     *\n     * @return $this\n     */\n    public function setType($type) {\n        $this->type = BuilderHelpers::normalizeType($type);\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n\n    /**\n     * Adds a property hook.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addHook(Node\\PropertyHook $hook) {\n        $this->hooks[] = $hook;\n\n        return $this;\n    }\n\n    /**\n     * Returns the built class node.\n     *\n     * @return Stmt\\Property The built property node\n     */\n    public function getNode(): PhpParser\\Node {\n        if ($this->flags & Modifiers::ABSTRACT && !$this->hooks) {\n            throw new PhpParser\\Error('Only hooked properties may be declared abstract');\n        }\n\n        return new Stmt\\Property(\n            $this->flags !== 0 ? $this->flags : Modifiers::PUBLIC,\n            [\n                new Node\\PropertyItem($this->name, $this->default)\n            ],\n            $this->attributes,\n            $this->type,\n            $this->attributeGroups,\n            $this->hooks\n        );\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/TraitUse.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Builder;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt;\n\nclass TraitUse implements Builder {\n    /** @var Node\\Name[] */\n    protected array $traits = [];\n    /** @var Stmt\\TraitUseAdaptation[] */\n    protected array $adaptations = [];\n\n    /**\n     * Creates a trait use builder.\n     *\n     * @param Node\\Name|string ...$traits Names of used traits\n     */\n    public function __construct(...$traits) {\n        foreach ($traits as $trait) {\n            $this->and($trait);\n        }\n    }\n\n    /**\n     * Adds used trait.\n     *\n     * @param Node\\Name|string $trait Trait name\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function and($trait) {\n        $this->traits[] = BuilderHelpers::normalizeName($trait);\n        return $this;\n    }\n\n    /**\n     * Adds trait adaptation.\n     *\n     * @param Stmt\\TraitUseAdaptation|Builder\\TraitUseAdaptation $adaptation Trait adaptation\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function with($adaptation) {\n        $adaptation = BuilderHelpers::normalizeNode($adaptation);\n\n        if (!$adaptation instanceof Stmt\\TraitUseAdaptation) {\n            throw new \\LogicException('Adaptation must have type TraitUseAdaptation');\n        }\n\n        $this->adaptations[] = $adaptation;\n        return $this;\n    }\n\n    /**\n     * Returns the built node.\n     *\n     * @return Node The built node\n     */\n    public function getNode(): Node {\n        return new Stmt\\TraitUse($this->traits, $this->adaptations);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/TraitUseAdaptation.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Builder;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt;\n\nclass TraitUseAdaptation implements Builder {\n    private const TYPE_UNDEFINED  = 0;\n    private const TYPE_ALIAS      = 1;\n    private const TYPE_PRECEDENCE = 2;\n\n    protected int $type;\n    protected ?Node\\Name $trait;\n    protected Node\\Identifier $method;\n    protected ?int $modifier = null;\n    protected ?Node\\Identifier $alias = null;\n    /** @var Node\\Name[] */\n    protected array $insteadof = [];\n\n    /**\n     * Creates a trait use adaptation builder.\n     *\n     * @param Node\\Name|string|null $trait Name of adapted trait\n     * @param Node\\Identifier|string $method Name of adapted method\n     */\n    public function __construct($trait, $method) {\n        $this->type = self::TYPE_UNDEFINED;\n\n        $this->trait = is_null($trait) ? null : BuilderHelpers::normalizeName($trait);\n        $this->method = BuilderHelpers::normalizeIdentifier($method);\n    }\n\n    /**\n     * Sets alias of method.\n     *\n     * @param Node\\Identifier|string $alias Alias for adapted method\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function as($alias) {\n        if ($this->type === self::TYPE_UNDEFINED) {\n            $this->type = self::TYPE_ALIAS;\n        }\n\n        if ($this->type !== self::TYPE_ALIAS) {\n            throw new \\LogicException('Cannot set alias for not alias adaptation buider');\n        }\n\n        $this->alias = BuilderHelpers::normalizeIdentifier($alias);\n        return $this;\n    }\n\n    /**\n     * Sets adapted method public.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePublic() {\n        $this->setModifier(Modifiers::PUBLIC);\n        return $this;\n    }\n\n    /**\n     * Sets adapted method protected.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makeProtected() {\n        $this->setModifier(Modifiers::PROTECTED);\n        return $this;\n    }\n\n    /**\n     * Sets adapted method private.\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function makePrivate() {\n        $this->setModifier(Modifiers::PRIVATE);\n        return $this;\n    }\n\n    /**\n     * Adds overwritten traits.\n     *\n     * @param Node\\Name|string ...$traits Traits for overwrite\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function insteadof(...$traits) {\n        if ($this->type === self::TYPE_UNDEFINED) {\n            if (is_null($this->trait)) {\n                throw new \\LogicException('Precedence adaptation must have trait');\n            }\n\n            $this->type = self::TYPE_PRECEDENCE;\n        }\n\n        if ($this->type !== self::TYPE_PRECEDENCE) {\n            throw new \\LogicException('Cannot add overwritten traits for not precedence adaptation buider');\n        }\n\n        foreach ($traits as $trait) {\n            $this->insteadof[] = BuilderHelpers::normalizeName($trait);\n        }\n\n        return $this;\n    }\n\n    protected function setModifier(int $modifier): void {\n        if ($this->type === self::TYPE_UNDEFINED) {\n            $this->type = self::TYPE_ALIAS;\n        }\n\n        if ($this->type !== self::TYPE_ALIAS) {\n            throw new \\LogicException('Cannot set access modifier for not alias adaptation buider');\n        }\n\n        if (is_null($this->modifier)) {\n            $this->modifier = $modifier;\n        } else {\n            throw new \\LogicException('Multiple access type modifiers are not allowed');\n        }\n    }\n\n    /**\n     * Returns the built node.\n     *\n     * @return Node The built node\n     */\n    public function getNode(): Node {\n        switch ($this->type) {\n            case self::TYPE_ALIAS:\n                return new Stmt\\TraitUseAdaptation\\Alias($this->trait, $this->method, $this->modifier, $this->alias);\n            case self::TYPE_PRECEDENCE:\n                return new Stmt\\TraitUseAdaptation\\Precedence($this->trait, $this->method, $this->insteadof);\n            default:\n                throw new \\LogicException('Type of adaptation is not defined');\n        }\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Trait_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt;\n\nclass Trait_ extends Declaration {\n    protected string $name;\n    /** @var list<Stmt\\TraitUse> */\n    protected array $uses = [];\n    /** @var list<Stmt\\ClassConst> */\n    protected array $constants = [];\n    /** @var list<Stmt\\Property> */\n    protected array $properties = [];\n    /** @var list<Stmt\\ClassMethod> */\n    protected array $methods = [];\n    /** @var list<Node\\AttributeGroup> */\n    protected array $attributeGroups = [];\n\n    /**\n     * Creates an interface builder.\n     *\n     * @param string $name Name of the interface\n     */\n    public function __construct(string $name) {\n        $this->name = $name;\n    }\n\n    /**\n     * Adds a statement.\n     *\n     * @param Stmt|PhpParser\\Builder $stmt The statement to add\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addStmt($stmt) {\n        $stmt = BuilderHelpers::normalizeNode($stmt);\n\n        if ($stmt instanceof Stmt\\Property) {\n            $this->properties[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\ClassMethod) {\n            $this->methods[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\TraitUse) {\n            $this->uses[] = $stmt;\n        } elseif ($stmt instanceof Stmt\\ClassConst) {\n            $this->constants[] = $stmt;\n        } else {\n            throw new \\LogicException(sprintf('Unexpected node of type \"%s\"', $stmt->getType()));\n        }\n\n        return $this;\n    }\n\n    /**\n     * Adds an attribute group.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function addAttribute($attribute) {\n        $this->attributeGroups[] = BuilderHelpers::normalizeAttribute($attribute);\n\n        return $this;\n    }\n\n    /**\n     * Returns the built trait node.\n     *\n     * @return Stmt\\Trait_ The built interface node\n     */\n    public function getNode(): PhpParser\\Node {\n        return new Stmt\\Trait_(\n            $this->name, [\n                'stmts' => array_merge($this->uses, $this->constants, $this->properties, $this->methods),\n                'attrGroups' => $this->attributeGroups,\n            ], $this->attributes\n        );\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder/Use_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Builder;\nuse PhpParser\\BuilderHelpers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt;\n\nclass Use_ implements Builder {\n    protected Node\\Name $name;\n    /** @var Stmt\\Use_::TYPE_* */\n    protected int $type;\n    protected ?string $alias = null;\n\n    /**\n     * Creates a name use (alias) builder.\n     *\n     * @param Node\\Name|string $name Name of the entity (namespace, class, function, constant) to alias\n     * @param Stmt\\Use_::TYPE_* $type One of the Stmt\\Use_::TYPE_* constants\n     */\n    public function __construct($name, int $type) {\n        $this->name = BuilderHelpers::normalizeName($name);\n        $this->type = $type;\n    }\n\n    /**\n     * Sets alias for used name.\n     *\n     * @param string $alias Alias to use (last component of full name by default)\n     *\n     * @return $this The builder instance (for fluid interface)\n     */\n    public function as(string $alias) {\n        $this->alias = $alias;\n        return $this;\n    }\n\n    /**\n     * Returns the built node.\n     *\n     * @return Stmt\\Use_ The built node\n     */\n    public function getNode(): Node {\n        return new Stmt\\Use_([\n            new Node\\UseItem($this->name, $this->alias)\n        ], $this->type);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Builder.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\ninterface Builder {\n    /**\n     * Returns the built node.\n     *\n     * @return Node The built node\n     */\n    public function getNode(): Node;\n}\n"
  },
  {
    "path": "lib/PhpParser/BuilderFactory.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Expr\\BinaryOp\\Concat;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar\\String_;\nuse PhpParser\\Node\\Stmt\\Use_;\n\nclass BuilderFactory {\n    /**\n     * Creates an attribute node.\n     *\n     * @param string|Name $name Name of the attribute\n     * @param array $args Attribute named arguments\n     */\n    public function attribute($name, array $args = []): Node\\Attribute {\n        return new Node\\Attribute(\n            BuilderHelpers::normalizeName($name),\n            $this->args($args)\n        );\n    }\n\n    /**\n     * Creates a namespace builder.\n     *\n     * @param null|string|Node\\Name $name Name of the namespace\n     *\n     * @return Builder\\Namespace_ The created namespace builder\n     */\n    public function namespace($name): Builder\\Namespace_ {\n        return new Builder\\Namespace_($name);\n    }\n\n    /**\n     * Creates a class builder.\n     *\n     * @param string $name Name of the class\n     *\n     * @return Builder\\Class_ The created class builder\n     */\n    public function class(string $name): Builder\\Class_ {\n        return new Builder\\Class_($name);\n    }\n\n    /**\n     * Creates an interface builder.\n     *\n     * @param string $name Name of the interface\n     *\n     * @return Builder\\Interface_ The created interface builder\n     */\n    public function interface(string $name): Builder\\Interface_ {\n        return new Builder\\Interface_($name);\n    }\n\n    /**\n     * Creates a trait builder.\n     *\n     * @param string $name Name of the trait\n     *\n     * @return Builder\\Trait_ The created trait builder\n     */\n    public function trait(string $name): Builder\\Trait_ {\n        return new Builder\\Trait_($name);\n    }\n\n    /**\n     * Creates an enum builder.\n     *\n     * @param string $name Name of the enum\n     *\n     * @return Builder\\Enum_ The created enum builder\n     */\n    public function enum(string $name): Builder\\Enum_ {\n        return new Builder\\Enum_($name);\n    }\n\n    /**\n     * Creates a trait use builder.\n     *\n     * @param Node\\Name|string ...$traits Trait names\n     *\n     * @return Builder\\TraitUse The created trait use builder\n     */\n    public function useTrait(...$traits): Builder\\TraitUse {\n        return new Builder\\TraitUse(...$traits);\n    }\n\n    /**\n     * Creates a trait use adaptation builder.\n     *\n     * @param Node\\Name|string|null $trait Trait name\n     * @param Node\\Identifier|string $method Method name\n     *\n     * @return Builder\\TraitUseAdaptation The created trait use adaptation builder\n     */\n    public function traitUseAdaptation($trait, $method = null): Builder\\TraitUseAdaptation {\n        if ($method === null) {\n            $method = $trait;\n            $trait = null;\n        }\n\n        return new Builder\\TraitUseAdaptation($trait, $method);\n    }\n\n    /**\n     * Creates a method builder.\n     *\n     * @param string $name Name of the method\n     *\n     * @return Builder\\Method The created method builder\n     */\n    public function method(string $name): Builder\\Method {\n        return new Builder\\Method($name);\n    }\n\n    /**\n     * Creates a parameter builder.\n     *\n     * @param string $name Name of the parameter\n     *\n     * @return Builder\\Param The created parameter builder\n     */\n    public function param(string $name): Builder\\Param {\n        return new Builder\\Param($name);\n    }\n\n    /**\n     * Creates a property builder.\n     *\n     * @param string $name Name of the property\n     *\n     * @return Builder\\Property The created property builder\n     */\n    public function property(string $name): Builder\\Property {\n        return new Builder\\Property($name);\n    }\n\n    /**\n     * Creates a function builder.\n     *\n     * @param string $name Name of the function\n     *\n     * @return Builder\\Function_ The created function builder\n     */\n    public function function(string $name): Builder\\Function_ {\n        return new Builder\\Function_($name);\n    }\n\n    /**\n     * Creates a namespace/class use builder.\n     *\n     * @param Node\\Name|string $name Name of the entity (namespace or class) to alias\n     *\n     * @return Builder\\Use_ The created use builder\n     */\n    public function use($name): Builder\\Use_ {\n        return new Builder\\Use_($name, Use_::TYPE_NORMAL);\n    }\n\n    /**\n     * Creates a function use builder.\n     *\n     * @param Node\\Name|string $name Name of the function to alias\n     *\n     * @return Builder\\Use_ The created use function builder\n     */\n    public function useFunction($name): Builder\\Use_ {\n        return new Builder\\Use_($name, Use_::TYPE_FUNCTION);\n    }\n\n    /**\n     * Creates a constant use builder.\n     *\n     * @param Node\\Name|string $name Name of the const to alias\n     *\n     * @return Builder\\Use_ The created use const builder\n     */\n    public function useConst($name): Builder\\Use_ {\n        return new Builder\\Use_($name, Use_::TYPE_CONSTANT);\n    }\n\n    /**\n     * Creates a class constant builder.\n     *\n     * @param string|Identifier $name Name\n     * @param Node\\Expr|bool|null|int|float|string|array $value Value\n     *\n     * @return Builder\\ClassConst The created use const builder\n     */\n    public function classConst($name, $value): Builder\\ClassConst {\n        return new Builder\\ClassConst($name, $value);\n    }\n\n    /**\n     * Creates an enum case builder.\n     *\n     * @param string|Identifier $name Name\n     *\n     * @return Builder\\EnumCase The created use const builder\n     */\n    public function enumCase($name): Builder\\EnumCase {\n        return new Builder\\EnumCase($name);\n    }\n\n    /**\n     * Creates node a for a literal value.\n     *\n     * @param Expr|bool|null|int|float|string|array|\\UnitEnum $value $value\n     */\n    public function val($value): Expr {\n        return BuilderHelpers::normalizeValue($value);\n    }\n\n    /**\n     * Creates variable node.\n     *\n     * @param string|Expr $name Name\n     */\n    public function var($name): Expr\\Variable {\n        if (!\\is_string($name) && !$name instanceof Expr) {\n            throw new \\LogicException('Variable name must be string or Expr');\n        }\n\n        return new Expr\\Variable($name);\n    }\n\n    /**\n     * Normalizes an argument list.\n     *\n     * Creates Arg nodes for all arguments and converts literal values to expressions.\n     *\n     * @param array $args List of arguments to normalize\n     *\n     * @return list<Arg>\n     */\n    public function args(array $args): array {\n        $normalizedArgs = [];\n        foreach ($args as $key => $arg) {\n            if (!($arg instanceof Arg)) {\n                $arg = new Arg(BuilderHelpers::normalizeValue($arg));\n            }\n            if (\\is_string($key)) {\n                $arg->name = BuilderHelpers::normalizeIdentifier($key);\n            }\n            $normalizedArgs[] = $arg;\n        }\n        return $normalizedArgs;\n    }\n\n    /**\n     * Creates a function call node.\n     *\n     * @param string|Name|Expr $name Function name\n     * @param array $args Function arguments\n     */\n    public function funcCall($name, array $args = []): Expr\\FuncCall {\n        return new Expr\\FuncCall(\n            BuilderHelpers::normalizeNameOrExpr($name),\n            $this->args($args)\n        );\n    }\n\n    /**\n     * Creates a method call node.\n     *\n     * @param Expr $var Variable the method is called on\n     * @param string|Identifier|Expr $name Method name\n     * @param array $args Method arguments\n     */\n    public function methodCall(Expr $var, $name, array $args = []): Expr\\MethodCall {\n        return new Expr\\MethodCall(\n            $var,\n            BuilderHelpers::normalizeIdentifierOrExpr($name),\n            $this->args($args)\n        );\n    }\n\n    /**\n     * Creates a static method call node.\n     *\n     * @param string|Name|Expr $class Class name\n     * @param string|Identifier|Expr $name Method name\n     * @param array $args Method arguments\n     */\n    public function staticCall($class, $name, array $args = []): Expr\\StaticCall {\n        return new Expr\\StaticCall(\n            BuilderHelpers::normalizeNameOrExpr($class),\n            BuilderHelpers::normalizeIdentifierOrExpr($name),\n            $this->args($args)\n        );\n    }\n\n    /**\n     * Creates an object creation node.\n     *\n     * @param string|Name|Expr $class Class name\n     * @param array $args Constructor arguments\n     */\n    public function new($class, array $args = []): Expr\\New_ {\n        return new Expr\\New_(\n            BuilderHelpers::normalizeNameOrExpr($class),\n            $this->args($args)\n        );\n    }\n\n    /**\n     * Creates a constant fetch node.\n     *\n     * @param string|Name $name Constant name\n     */\n    public function constFetch($name): Expr\\ConstFetch {\n        return new Expr\\ConstFetch(BuilderHelpers::normalizeName($name));\n    }\n\n    /**\n     * Creates a property fetch node.\n     *\n     * @param Expr $var Variable holding object\n     * @param string|Identifier|Expr $name Property name\n     */\n    public function propertyFetch(Expr $var, $name): Expr\\PropertyFetch {\n        return new Expr\\PropertyFetch($var, BuilderHelpers::normalizeIdentifierOrExpr($name));\n    }\n\n    /**\n     * Creates a class constant fetch node.\n     *\n     * @param string|Name|Expr $class Class name\n     * @param string|Identifier|Expr $name Constant name\n     */\n    public function classConstFetch($class, $name): Expr\\ClassConstFetch {\n        return new Expr\\ClassConstFetch(\n            BuilderHelpers::normalizeNameOrExpr($class),\n            BuilderHelpers::normalizeIdentifierOrExpr($name)\n        );\n    }\n\n    /**\n     * Creates nested Concat nodes from a list of expressions.\n     *\n     * @param Expr|string ...$exprs Expressions or literal strings\n     */\n    public function concat(...$exprs): Concat {\n        $numExprs = count($exprs);\n        if ($numExprs < 2) {\n            throw new \\LogicException('Expected at least two expressions');\n        }\n\n        $lastConcat = $this->normalizeStringExpr($exprs[0]);\n        for ($i = 1; $i < $numExprs; $i++) {\n            $lastConcat = new Concat($lastConcat, $this->normalizeStringExpr($exprs[$i]));\n        }\n        return $lastConcat;\n    }\n\n    /**\n     * @param string|Expr $expr\n     */\n    private function normalizeStringExpr($expr): Expr {\n        if ($expr instanceof Expr) {\n            return $expr;\n        }\n\n        if (\\is_string($expr)) {\n            return new String_($expr);\n        }\n\n        throw new \\LogicException('Expected string or Expr');\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/BuilderHelpers.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\ComplexType;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Name\\FullyQualified;\nuse PhpParser\\Node\\NullableType;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Stmt;\n\n/**\n * This class defines helpers used in the implementation of builders. Don't use it directly.\n *\n * @internal\n */\nfinal class BuilderHelpers {\n    /**\n     * Normalizes a node: Converts builder objects to nodes.\n     *\n     * @param Node|Builder $node The node to normalize\n     *\n     * @return Node The normalized node\n     */\n    public static function normalizeNode($node): Node {\n        if ($node instanceof Builder) {\n            return $node->getNode();\n        }\n\n        if ($node instanceof Node) {\n            return $node;\n        }\n\n        throw new \\LogicException('Expected node or builder object');\n    }\n\n    /**\n     * Normalizes a node to a statement.\n     *\n     * Expressions are wrapped in a Stmt\\Expression node.\n     *\n     * @param Node|Builder $node The node to normalize\n     *\n     * @return Stmt The normalized statement node\n     */\n    public static function normalizeStmt($node): Stmt {\n        $node = self::normalizeNode($node);\n        if ($node instanceof Stmt) {\n            return $node;\n        }\n\n        if ($node instanceof Expr) {\n            return new Stmt\\Expression($node);\n        }\n\n        throw new \\LogicException('Expected statement or expression node');\n    }\n\n    /**\n     * Normalizes strings to Identifier.\n     *\n     * @param string|Identifier $name The identifier to normalize\n     *\n     * @return Identifier The normalized identifier\n     */\n    public static function normalizeIdentifier($name): Identifier {\n        if ($name instanceof Identifier) {\n            return $name;\n        }\n\n        if (\\is_string($name)) {\n            return new Identifier($name);\n        }\n\n        throw new \\LogicException('Expected string or instance of Node\\Identifier');\n    }\n\n    /**\n     * Normalizes strings to Identifier, also allowing expressions.\n     *\n     * @param string|Identifier|Expr $name The identifier to normalize\n     *\n     * @return Identifier|Expr The normalized identifier or expression\n     */\n    public static function normalizeIdentifierOrExpr($name) {\n        if ($name instanceof Identifier || $name instanceof Expr) {\n            return $name;\n        }\n\n        if (\\is_string($name)) {\n            return new Identifier($name);\n        }\n\n        throw new \\LogicException('Expected string or instance of Node\\Identifier or Node\\Expr');\n    }\n\n    /**\n     * Normalizes a name: Converts string names to Name nodes.\n     *\n     * @param Name|string $name The name to normalize\n     *\n     * @return Name The normalized name\n     */\n    public static function normalizeName($name): Name {\n        if ($name instanceof Name) {\n            return $name;\n        }\n\n        if (is_string($name)) {\n            if (!$name) {\n                throw new \\LogicException('Name cannot be empty');\n            }\n\n            if ($name[0] === '\\\\') {\n                return new Name\\FullyQualified(substr($name, 1));\n            }\n\n            if (0 === strpos($name, 'namespace\\\\')) {\n                return new Name\\Relative(substr($name, strlen('namespace\\\\')));\n            }\n\n            return new Name($name);\n        }\n\n        throw new \\LogicException('Name must be a string or an instance of Node\\Name');\n    }\n\n    /**\n     * Normalizes a name: Converts string names to Name nodes, while also allowing expressions.\n     *\n     * @param Expr|Name|string $name The name to normalize\n     *\n     * @return Name|Expr The normalized name or expression\n     */\n    public static function normalizeNameOrExpr($name) {\n        if ($name instanceof Expr) {\n            return $name;\n        }\n\n        if (!is_string($name) && !($name instanceof Name)) {\n            throw new \\LogicException(\n                'Name must be a string or an instance of Node\\Name or Node\\Expr'\n            );\n        }\n\n        return self::normalizeName($name);\n    }\n\n    /**\n     * Normalizes a type: Converts plain-text type names into proper AST representation.\n     *\n     * In particular, builtin types become Identifiers, custom types become Names and nullables\n     * are wrapped in NullableType nodes.\n     *\n     * @param string|Name|Identifier|ComplexType $type The type to normalize\n     *\n     * @return Name|Identifier|ComplexType The normalized type\n     */\n    public static function normalizeType($type) {\n        if (!is_string($type)) {\n            if (\n                !$type instanceof Name && !$type instanceof Identifier &&\n                !$type instanceof ComplexType\n            ) {\n                throw new \\LogicException(\n                    'Type must be a string, or an instance of Name, Identifier or ComplexType'\n                );\n            }\n            return $type;\n        }\n\n        $nullable = false;\n        if (strlen($type) > 0 && $type[0] === '?') {\n            $nullable = true;\n            $type = substr($type, 1);\n        }\n\n        $builtinTypes = [\n            'array',\n            'callable',\n            'bool',\n            'int',\n            'float',\n            'string',\n            'iterable',\n            'void',\n            'object',\n            'null',\n            'false',\n            'mixed',\n            'never',\n            'true',\n        ];\n\n        $lowerType = strtolower($type);\n        if (in_array($lowerType, $builtinTypes)) {\n            $type = new Identifier($lowerType);\n        } else {\n            $type = self::normalizeName($type);\n        }\n\n        $notNullableTypes = [\n            'void', 'mixed', 'never',\n        ];\n        if ($nullable && in_array((string) $type, $notNullableTypes)) {\n            throw new \\LogicException(sprintf('%s type cannot be nullable', $type));\n        }\n\n        return $nullable ? new NullableType($type) : $type;\n    }\n\n    /**\n     * Normalizes a value: Converts nulls, booleans, integers,\n     * floats, strings and arrays into their respective nodes\n     *\n     * @param Node\\Expr|bool|null|int|float|string|array|\\UnitEnum $value The value to normalize\n     *\n     * @return Expr The normalized value\n     */\n    public static function normalizeValue($value): Expr {\n        if ($value instanceof Node\\Expr) {\n            return $value;\n        }\n\n        if (is_null($value)) {\n            return new Expr\\ConstFetch(\n                new Name('null')\n            );\n        }\n\n        if (is_bool($value)) {\n            return new Expr\\ConstFetch(\n                new Name($value ? 'true' : 'false')\n            );\n        }\n\n        if (is_int($value)) {\n            return new Scalar\\Int_($value);\n        }\n\n        if (is_float($value)) {\n            return new Scalar\\Float_($value);\n        }\n\n        if (is_string($value)) {\n            return new Scalar\\String_($value);\n        }\n\n        if (is_array($value)) {\n            $items = [];\n            $lastKey = -1;\n            foreach ($value as $itemKey => $itemValue) {\n                // for consecutive, numeric keys don't generate keys\n                if (null !== $lastKey && ++$lastKey === $itemKey) {\n                    $items[] = new Node\\ArrayItem(\n                        self::normalizeValue($itemValue)\n                    );\n                } else {\n                    $lastKey = null;\n                    $items[] = new Node\\ArrayItem(\n                        self::normalizeValue($itemValue),\n                        self::normalizeValue($itemKey)\n                    );\n                }\n            }\n\n            return new Expr\\Array_($items);\n        }\n\n        if ($value instanceof \\UnitEnum) {\n            return new Expr\\ClassConstFetch(new FullyQualified(\\get_class($value)), new Identifier($value->name));\n        }\n\n        throw new \\LogicException('Invalid value');\n    }\n\n    /**\n     * Normalizes a doc comment: Converts plain strings to PhpParser\\Comment\\Doc.\n     *\n     * @param Comment\\Doc|string $docComment The doc comment to normalize\n     *\n     * @return Comment\\Doc The normalized doc comment\n     */\n    public static function normalizeDocComment($docComment): Comment\\Doc {\n        if ($docComment instanceof Comment\\Doc) {\n            return $docComment;\n        }\n\n        if (is_string($docComment)) {\n            return new Comment\\Doc($docComment);\n        }\n\n        throw new \\LogicException('Doc comment must be a string or an instance of PhpParser\\Comment\\Doc');\n    }\n\n    /**\n     * Normalizes a attribute: Converts attribute to the Attribute Group if needed.\n     *\n     * @param Node\\Attribute|Node\\AttributeGroup $attribute\n     *\n     * @return Node\\AttributeGroup The Attribute Group\n     */\n    public static function normalizeAttribute($attribute): Node\\AttributeGroup {\n        if ($attribute instanceof Node\\AttributeGroup) {\n            return $attribute;\n        }\n\n        if (!($attribute instanceof Node\\Attribute)) {\n            throw new \\LogicException('Attribute must be an instance of PhpParser\\Node\\Attribute or PhpParser\\Node\\AttributeGroup');\n        }\n\n        return new Node\\AttributeGroup([$attribute]);\n    }\n\n    /**\n     * Adds a modifier and returns new modifier bitmask.\n     *\n     * @param int $modifiers Existing modifiers\n     * @param int $modifier Modifier to set\n     *\n     * @return int New modifiers\n     */\n    public static function addModifier(int $modifiers, int $modifier): int {\n        Modifiers::verifyModifier($modifiers, $modifier);\n        return $modifiers | $modifier;\n    }\n\n    /**\n     * Adds a modifier and returns new modifier bitmask.\n     * @return int New modifiers\n     */\n    public static function addClassModifier(int $existingModifiers, int $modifierToSet): int {\n        Modifiers::verifyClassModifier($existingModifiers, $modifierToSet);\n        return $existingModifiers | $modifierToSet;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Comment/Doc.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Comment;\n\nclass Doc extends \\PhpParser\\Comment {\n}\n"
  },
  {
    "path": "lib/PhpParser/Comment.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass Comment implements \\JsonSerializable {\n    protected string $text;\n    protected int $startLine;\n    protected int $startFilePos;\n    protected int $startTokenPos;\n    protected int $endLine;\n    protected int $endFilePos;\n    protected int $endTokenPos;\n\n    /**\n     * Constructs a comment node.\n     *\n     * @param string $text Comment text (including comment delimiters like /*)\n     * @param int $startLine Line number the comment started on\n     * @param int $startFilePos File offset the comment started on\n     * @param int $startTokenPos Token offset the comment started on\n     */\n    public function __construct(\n        string $text,\n        int $startLine = -1, int $startFilePos = -1, int $startTokenPos = -1,\n        int $endLine = -1, int $endFilePos = -1, int $endTokenPos = -1\n    ) {\n        $this->text = $text;\n        $this->startLine = $startLine;\n        $this->startFilePos = $startFilePos;\n        $this->startTokenPos = $startTokenPos;\n        $this->endLine = $endLine;\n        $this->endFilePos = $endFilePos;\n        $this->endTokenPos = $endTokenPos;\n    }\n\n    /**\n     * Gets the comment text.\n     *\n     * @return string The comment text (including comment delimiters like /*)\n     */\n    public function getText(): string {\n        return $this->text;\n    }\n\n    /**\n     * Gets the line number the comment started on.\n     *\n     * @return int Line number (or -1 if not available)\n     * @phpstan-return -1|positive-int\n     */\n    public function getStartLine(): int {\n        return $this->startLine;\n    }\n\n    /**\n     * Gets the file offset the comment started on.\n     *\n     * @return int File offset (or -1 if not available)\n     */\n    public function getStartFilePos(): int {\n        return $this->startFilePos;\n    }\n\n    /**\n     * Gets the token offset the comment started on.\n     *\n     * @return int Token offset (or -1 if not available)\n     */\n    public function getStartTokenPos(): int {\n        return $this->startTokenPos;\n    }\n\n    /**\n     * Gets the line number the comment ends on.\n     *\n     * @return int Line number (or -1 if not available)\n     * @phpstan-return -1|positive-int\n     */\n    public function getEndLine(): int {\n        return $this->endLine;\n    }\n\n    /**\n     * Gets the file offset the comment ends on.\n     *\n     * @return int File offset (or -1 if not available)\n     */\n    public function getEndFilePos(): int {\n        return $this->endFilePos;\n    }\n\n    /**\n     * Gets the token offset the comment ends on.\n     *\n     * @return int Token offset (or -1 if not available)\n     */\n    public function getEndTokenPos(): int {\n        return $this->endTokenPos;\n    }\n\n    /**\n     * Gets the comment text.\n     *\n     * @return string The comment text (including comment delimiters like /*)\n     */\n    public function __toString(): string {\n        return $this->text;\n    }\n\n    /**\n     * Gets the reformatted comment text.\n     *\n     * \"Reformatted\" here means that we try to clean up the whitespace at the\n     * starts of the lines. This is necessary because we receive the comments\n     * without leading whitespace on the first line, but with leading whitespace\n     * on all subsequent lines.\n     *\n     * Additionally, this normalizes CRLF newlines to LF newlines.\n     */\n    public function getReformattedText(): string {\n        $text = str_replace(\"\\r\\n\", \"\\n\", $this->text);\n        $newlinePos = strpos($text, \"\\n\");\n        if (false === $newlinePos) {\n            // Single line comments don't need further processing\n            return $text;\n        }\n        if (preg_match('(^.*(?:\\n\\s+\\*.*)+$)', $text)) {\n            // Multi line comment of the type\n            //\n            //     /*\n            //      * Some text.\n            //      * Some more text.\n            //      */\n            //\n            // is handled by replacing the whitespace sequences before the * by a single space\n            return preg_replace('(^\\s+\\*)m', ' *', $text);\n        }\n        if (preg_match('(^/\\*\\*?\\s*\\n)', $text) && preg_match('(\\n(\\s*)\\*/$)', $text, $matches)) {\n            // Multi line comment of the type\n            //\n            //    /*\n            //        Some text.\n            //        Some more text.\n            //    */\n            //\n            // is handled by removing the whitespace sequence on the line before the closing\n            // */ on all lines. So if the last line is \"    */\", then \"    \" is removed at the\n            // start of all lines.\n            return preg_replace('(^' . preg_quote($matches[1]) . ')m', '', $text);\n        }\n        if (preg_match('(^/\\*\\*?\\s*(?!\\s))', $text, $matches)) {\n            // Multi line comment of the type\n            //\n            //     /* Some text.\n            //        Some more text.\n            //          Indented text.\n            //        Even more text. */\n            //\n            // is handled by removing the difference between the shortest whitespace prefix on all\n            // lines and the length of the \"/* \" opening sequence.\n            $prefixLen = $this->getShortestWhitespacePrefixLen(substr($text, $newlinePos + 1));\n            $removeLen = $prefixLen - strlen($matches[0]);\n            return preg_replace('(^\\s{' . $removeLen . '})m', '', $text);\n        }\n\n        // No idea how to format this comment, so simply return as is\n        return $text;\n    }\n\n    /**\n     * Get length of shortest whitespace prefix (at the start of a line).\n     *\n     * If there is a line with no prefix whitespace, 0 is a valid return value.\n     *\n     * @param string $str String to check\n     * @return int Length in characters. Tabs count as single characters.\n     */\n    private function getShortestWhitespacePrefixLen(string $str): int {\n        $lines = explode(\"\\n\", $str);\n        $shortestPrefixLen = \\PHP_INT_MAX;\n        foreach ($lines as $line) {\n            preg_match('(^\\s*)', $line, $matches);\n            $prefixLen = strlen($matches[0]);\n            if ($prefixLen < $shortestPrefixLen) {\n                $shortestPrefixLen = $prefixLen;\n            }\n        }\n        return $shortestPrefixLen;\n    }\n\n    /**\n     * @return array{nodeType:string, text:mixed, line:mixed, filePos:mixed}\n     */\n    public function jsonSerialize(): array {\n        // Technically not a node, but we make it look like one anyway\n        $type = $this instanceof Comment\\Doc ? 'Comment_Doc' : 'Comment';\n        return [\n            'nodeType' => $type,\n            'text' => $this->text,\n            // TODO: Rename these to include \"start\".\n            'line' => $this->startLine,\n            'filePos' => $this->startFilePos,\n            'tokenPos' => $this->startTokenPos,\n            'endLine' => $this->endLine,\n            'endFilePos' => $this->endFilePos,\n            'endTokenPos' => $this->endTokenPos,\n        ];\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/ConstExprEvaluationException.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass ConstExprEvaluationException extends \\Exception {\n}\n"
  },
  {
    "path": "lib/PhpParser/ConstExprEvaluator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Scalar;\n\nuse function array_merge;\n\n/**\n * Evaluates constant expressions.\n *\n * This evaluator is able to evaluate all constant expressions (as defined by PHP), which can be\n * evaluated without further context. If a subexpression is not of this type, a user-provided\n * fallback evaluator is invoked. To support all constant expressions that are also supported by\n * PHP (and not already handled by this class), the fallback evaluator must be able to handle the\n * following node types:\n *\n *  * All Scalar\\MagicConst\\* nodes.\n *  * Expr\\ConstFetch nodes. Only null/false/true are already handled by this class.\n *  * Expr\\ClassConstFetch nodes.\n *\n * The fallback evaluator should throw ConstExprEvaluationException for nodes it cannot evaluate.\n *\n * The evaluation is dependent on runtime configuration in two respects: Firstly, floating\n * point to string conversions are affected by the precision ini setting. Secondly, they are also\n * affected by the LC_NUMERIC locale.\n */\nclass ConstExprEvaluator {\n    /** @var callable|null */\n    private $fallbackEvaluator;\n\n    /**\n     * Create a constant expression evaluator.\n     *\n     * The provided fallback evaluator is invoked whenever a subexpression cannot be evaluated. See\n     * class doc comment for more information.\n     *\n     * @param callable|null $fallbackEvaluator To call if subexpression cannot be evaluated\n     */\n    public function __construct(?callable $fallbackEvaluator = null) {\n        $this->fallbackEvaluator = $fallbackEvaluator ?? function (Expr $expr) {\n            throw new ConstExprEvaluationException(\n                \"Expression of type {$expr->getType()} cannot be evaluated\"\n            );\n        };\n    }\n\n    /**\n     * Silently evaluates a constant expression into a PHP value.\n     *\n     * Thrown Errors, warnings or notices will be converted into a ConstExprEvaluationException.\n     * The original source of the exception is available through getPrevious().\n     *\n     * If some part of the expression cannot be evaluated, the fallback evaluator passed to the\n     * constructor will be invoked. By default, if no fallback is provided, an exception of type\n     * ConstExprEvaluationException is thrown.\n     *\n     * See class doc comment for caveats and limitations.\n     *\n     * @param Expr $expr Constant expression to evaluate\n     * @return mixed Result of evaluation\n     *\n     * @throws ConstExprEvaluationException if the expression cannot be evaluated or an error occurred\n     */\n    public function evaluateSilently(Expr $expr) {\n        set_error_handler(function ($num, $str, $file, $line) {\n            throw new \\ErrorException($str, 0, $num, $file, $line);\n        });\n\n        try {\n            return $this->evaluate($expr);\n        } catch (\\Throwable $e) {\n            if (!$e instanceof ConstExprEvaluationException) {\n                $e = new ConstExprEvaluationException(\n                    \"An error occurred during constant expression evaluation\", 0, $e);\n            }\n            throw $e;\n        } finally {\n            restore_error_handler();\n        }\n    }\n\n    /**\n     * Directly evaluates a constant expression into a PHP value.\n     *\n     * May generate Error exceptions, warnings or notices. Use evaluateSilently() to convert these\n     * into a ConstExprEvaluationException.\n     *\n     * If some part of the expression cannot be evaluated, the fallback evaluator passed to the\n     * constructor will be invoked. By default, if no fallback is provided, an exception of type\n     * ConstExprEvaluationException is thrown.\n     *\n     * See class doc comment for caveats and limitations.\n     *\n     * @param Expr $expr Constant expression to evaluate\n     * @return mixed Result of evaluation\n     *\n     * @throws ConstExprEvaluationException if the expression cannot be evaluated\n     */\n    public function evaluateDirectly(Expr $expr) {\n        return $this->evaluate($expr);\n    }\n\n    /** @return mixed */\n    private function evaluate(Expr $expr) {\n        if ($expr instanceof Scalar\\Int_\n            || $expr instanceof Scalar\\Float_\n            || $expr instanceof Scalar\\String_\n        ) {\n            return $expr->value;\n        }\n\n        if ($expr instanceof Expr\\Array_) {\n            return $this->evaluateArray($expr);\n        }\n\n        // Unary operators\n        if ($expr instanceof Expr\\UnaryPlus) {\n            return +$this->evaluate($expr->expr);\n        }\n        if ($expr instanceof Expr\\UnaryMinus) {\n            return -$this->evaluate($expr->expr);\n        }\n        if ($expr instanceof Expr\\BooleanNot) {\n            return !$this->evaluate($expr->expr);\n        }\n        if ($expr instanceof Expr\\BitwiseNot) {\n            return ~$this->evaluate($expr->expr);\n        }\n\n        if ($expr instanceof Expr\\BinaryOp) {\n            return $this->evaluateBinaryOp($expr);\n        }\n\n        if ($expr instanceof Expr\\Ternary) {\n            return $this->evaluateTernary($expr);\n        }\n\n        if ($expr instanceof Expr\\ArrayDimFetch && null !== $expr->dim) {\n            return $this->evaluate($expr->var)[$this->evaluate($expr->dim)];\n        }\n\n        if ($expr instanceof Expr\\ConstFetch) {\n            return $this->evaluateConstFetch($expr);\n        }\n\n        return ($this->fallbackEvaluator)($expr);\n    }\n\n    private function evaluateArray(Expr\\Array_ $expr): array {\n        $array = [];\n        foreach ($expr->items as $item) {\n            if (null !== $item->key) {\n                $array[$this->evaluate($item->key)] = $this->evaluate($item->value);\n            } elseif ($item->unpack) {\n                $array = array_merge($array, $this->evaluate($item->value));\n            } else {\n                $array[] = $this->evaluate($item->value);\n            }\n        }\n        return $array;\n    }\n\n    /** @return mixed */\n    private function evaluateTernary(Expr\\Ternary $expr) {\n        if (null === $expr->if) {\n            return $this->evaluate($expr->cond) ?: $this->evaluate($expr->else);\n        }\n\n        return $this->evaluate($expr->cond)\n            ? $this->evaluate($expr->if)\n            : $this->evaluate($expr->else);\n    }\n\n    /** @return mixed */\n    private function evaluateBinaryOp(Expr\\BinaryOp $expr) {\n        if ($expr instanceof Expr\\BinaryOp\\Coalesce\n            && $expr->left instanceof Expr\\ArrayDimFetch\n        ) {\n            // This needs to be special cased to respect BP_VAR_IS fetch semantics\n            return $this->evaluate($expr->left->var)[$this->evaluate($expr->left->dim)]\n                ?? $this->evaluate($expr->right);\n        }\n\n        // The evaluate() calls are repeated in each branch, because some of the operators are\n        // short-circuiting and evaluating the RHS in advance may be illegal in that case\n        $l = $expr->left;\n        $r = $expr->right;\n        switch ($expr->getOperatorSigil()) {\n            case '&':   return $this->evaluate($l) &   $this->evaluate($r);\n            case '|':   return $this->evaluate($l) |   $this->evaluate($r);\n            case '^':   return $this->evaluate($l) ^   $this->evaluate($r);\n            case '&&':  return $this->evaluate($l) &&  $this->evaluate($r);\n            case '||':  return $this->evaluate($l) ||  $this->evaluate($r);\n            case '??':  return $this->evaluate($l) ??  $this->evaluate($r);\n            case '.':   return $this->evaluate($l) .   $this->evaluate($r);\n            case '/':   return $this->evaluate($l) /   $this->evaluate($r);\n            case '==':  return $this->evaluate($l) ==  $this->evaluate($r);\n            case '>':   return $this->evaluate($l) >   $this->evaluate($r);\n            case '>=':  return $this->evaluate($l) >=  $this->evaluate($r);\n            case '===': return $this->evaluate($l) === $this->evaluate($r);\n            case 'and': return $this->evaluate($l) and $this->evaluate($r);\n            case 'or':  return $this->evaluate($l) or  $this->evaluate($r);\n            case 'xor': return $this->evaluate($l) xor $this->evaluate($r);\n            case '-':   return $this->evaluate($l) -   $this->evaluate($r);\n            case '%':   return $this->evaluate($l) %   $this->evaluate($r);\n            case '*':   return $this->evaluate($l) *   $this->evaluate($r);\n            case '!=':  return $this->evaluate($l) !=  $this->evaluate($r);\n            case '!==': return $this->evaluate($l) !== $this->evaluate($r);\n            case '+':   return $this->evaluate($l) +   $this->evaluate($r);\n            case '**':  return $this->evaluate($l) **  $this->evaluate($r);\n            case '<<':  return $this->evaluate($l) <<  $this->evaluate($r);\n            case '>>':  return $this->evaluate($l) >>  $this->evaluate($r);\n            case '<':   return $this->evaluate($l) <   $this->evaluate($r);\n            case '<=':  return $this->evaluate($l) <=  $this->evaluate($r);\n            case '<=>': return $this->evaluate($l) <=> $this->evaluate($r);\n            case '|>':\n                $lval = $this->evaluate($l);\n                return $this->evaluate($r)($lval);\n        }\n\n        throw new \\Exception('Should not happen');\n    }\n\n    /** @return mixed */\n    private function evaluateConstFetch(Expr\\ConstFetch $expr) {\n        $name = $expr->name->toLowerString();\n        switch ($name) {\n            case 'null': return null;\n            case 'false': return false;\n            case 'true': return true;\n        }\n\n        return ($this->fallbackEvaluator)($expr);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Error.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass Error extends \\RuntimeException {\n    protected string $rawMessage;\n    /** @var array<string, mixed> */\n    protected array $attributes;\n\n    /**\n     * Creates an Exception signifying a parse error.\n     *\n     * @param string $message Error message\n     * @param array<string, mixed> $attributes Attributes of node/token where error occurred\n     */\n    public function __construct(string $message, array $attributes = []) {\n        $this->rawMessage = $message;\n        $this->attributes = $attributes;\n        $this->updateMessage();\n    }\n\n    /**\n     * Gets the error message\n     *\n     * @return string Error message\n     */\n    public function getRawMessage(): string {\n        return $this->rawMessage;\n    }\n\n    /**\n     * Gets the line the error starts in.\n     *\n     * @return int Error start line\n     * @phpstan-return -1|positive-int\n     */\n    public function getStartLine(): int {\n        return $this->attributes['startLine'] ?? -1;\n    }\n\n    /**\n     * Gets the line the error ends in.\n     *\n     * @return int Error end line\n     * @phpstan-return -1|positive-int\n     */\n    public function getEndLine(): int {\n        return $this->attributes['endLine'] ?? -1;\n    }\n\n    /**\n     * Gets the attributes of the node/token the error occurred at.\n     *\n     * @return array<string, mixed>\n     */\n    public function getAttributes(): array {\n        return $this->attributes;\n    }\n\n    /**\n     * Sets the attributes of the node/token the error occurred at.\n     *\n     * @param array<string, mixed> $attributes\n     */\n    public function setAttributes(array $attributes): void {\n        $this->attributes = $attributes;\n        $this->updateMessage();\n    }\n\n    /**\n     * Sets the line of the PHP file the error occurred in.\n     *\n     * @param string $message Error message\n     */\n    public function setRawMessage(string $message): void {\n        $this->rawMessage = $message;\n        $this->updateMessage();\n    }\n\n    /**\n     * Sets the line the error starts in.\n     *\n     * @param int $line Error start line\n     */\n    public function setStartLine(int $line): void {\n        $this->attributes['startLine'] = $line;\n        $this->updateMessage();\n    }\n\n    /**\n     * Returns whether the error has start and end column information.\n     *\n     * For column information enable the startFilePos and endFilePos in the lexer options.\n     */\n    public function hasColumnInfo(): bool {\n        return isset($this->attributes['startFilePos'], $this->attributes['endFilePos']);\n    }\n\n    /**\n     * Gets the start column (1-based) into the line where the error started.\n     *\n     * @param string $code Source code of the file\n     */\n    public function getStartColumn(string $code): int {\n        if (!$this->hasColumnInfo()) {\n            throw new \\RuntimeException('Error does not have column information');\n        }\n\n        return $this->toColumn($code, $this->attributes['startFilePos']);\n    }\n\n    /**\n     * Gets the end column (1-based) into the line where the error ended.\n     *\n     * @param string $code Source code of the file\n     */\n    public function getEndColumn(string $code): int {\n        if (!$this->hasColumnInfo()) {\n            throw new \\RuntimeException('Error does not have column information');\n        }\n\n        return $this->toColumn($code, $this->attributes['endFilePos']);\n    }\n\n    /**\n     * Formats message including line and column information.\n     *\n     * @param string $code Source code associated with the error, for calculation of the columns\n     *\n     * @return string Formatted message\n     */\n    public function getMessageWithColumnInfo(string $code): string {\n        return sprintf(\n            '%s from %d:%d to %d:%d', $this->getRawMessage(),\n            $this->getStartLine(), $this->getStartColumn($code),\n            $this->getEndLine(), $this->getEndColumn($code)\n        );\n    }\n\n    /**\n     * Converts a file offset into a column.\n     *\n     * @param string $code Source code that $pos indexes into\n     * @param int $pos 0-based position in $code\n     *\n     * @return int 1-based column (relative to start of line)\n     */\n    private function toColumn(string $code, int $pos): int {\n        if ($pos > strlen($code)) {\n            throw new \\RuntimeException('Invalid position information');\n        }\n\n        $lineStartPos = strrpos($code, \"\\n\", $pos - strlen($code));\n        if (false === $lineStartPos) {\n            $lineStartPos = -1;\n        }\n\n        return $pos - $lineStartPos;\n    }\n\n    /**\n     * Updates the exception message after a change to rawMessage or rawLine.\n     */\n    protected function updateMessage(): void {\n        $this->message = $this->rawMessage;\n\n        if (-1 === $this->getStartLine()) {\n            $this->message .= ' on unknown line';\n        } else {\n            $this->message .= ' on line ' . $this->getStartLine();\n        }\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/ErrorHandler/Collecting.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\ErrorHandler;\n\nuse PhpParser\\Error;\nuse PhpParser\\ErrorHandler;\n\n/**\n * Error handler that collects all errors into an array.\n *\n * This allows graceful handling of errors.\n */\nclass Collecting implements ErrorHandler {\n    /** @var Error[] Collected errors */\n    private array $errors = [];\n\n    public function handleError(Error $error): void {\n        $this->errors[] = $error;\n    }\n\n    /**\n     * Get collected errors.\n     *\n     * @return Error[]\n     */\n    public function getErrors(): array {\n        return $this->errors;\n    }\n\n    /**\n     * Check whether there are any errors.\n     */\n    public function hasErrors(): bool {\n        return !empty($this->errors);\n    }\n\n    /**\n     * Reset/clear collected errors.\n     */\n    public function clearErrors(): void {\n        $this->errors = [];\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/ErrorHandler/Throwing.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\ErrorHandler;\n\nuse PhpParser\\Error;\nuse PhpParser\\ErrorHandler;\n\n/**\n * Error handler that handles all errors by throwing them.\n *\n * This is the default strategy used by all components.\n */\nclass Throwing implements ErrorHandler {\n    public function handleError(Error $error): void {\n        throw $error;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/ErrorHandler.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\ninterface ErrorHandler {\n    /**\n     * Handle an error generated during lexing, parsing or some other operation.\n     *\n     * @param Error $error The error that needs to be handled\n     */\n    public function handleError(Error $error): void;\n}\n"
  },
  {
    "path": "lib/PhpParser/Internal/DiffElem.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Internal;\n\n/**\n * @internal\n */\nclass DiffElem {\n    public const TYPE_KEEP = 0;\n    public const TYPE_REMOVE = 1;\n    public const TYPE_ADD = 2;\n    public const TYPE_REPLACE = 3;\n\n    /** @var int One of the TYPE_* constants */\n    public int $type;\n    /** @var mixed Is null for add operations */\n    public $old;\n    /** @var mixed Is null for remove operations */\n    public $new;\n\n    /**\n     * @param int $type One of the TYPE_* constants\n     * @param mixed $old Is null for add operations\n     * @param mixed $new Is null for remove operations\n     */\n    public function __construct(int $type, $old, $new) {\n        $this->type = $type;\n        $this->old = $old;\n        $this->new = $new;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Internal/Differ.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Internal;\n\n/**\n * Implements the Myers diff algorithm.\n *\n * Myers, Eugene W. \"An O (ND) difference algorithm and its variations.\"\n * Algorithmica 1.1 (1986): 251-266.\n *\n * @template T\n * @internal\n */\nclass Differ {\n    /** @var callable(T, T): bool */\n    private $isEqual;\n\n    /**\n     * Create differ over the given equality relation.\n     *\n     * @param callable(T, T): bool $isEqual Equality relation\n     */\n    public function __construct(callable $isEqual) {\n        $this->isEqual = $isEqual;\n    }\n\n    /**\n     * Calculate diff (edit script) from $old to $new.\n     *\n     * @param T[] $old Original array\n     * @param T[] $new New array\n     *\n     * @return DiffElem[] Diff (edit script)\n     */\n    public function diff(array $old, array $new): array {\n        $old = \\array_values($old);\n        $new = \\array_values($new);\n        list($trace, $x, $y) = $this->calculateTrace($old, $new);\n        return $this->extractDiff($trace, $x, $y, $old, $new);\n    }\n\n    /**\n     * Calculate diff, including \"replace\" operations.\n     *\n     * If a sequence of remove operations is followed by the same number of add operations, these\n     * will be coalesced into replace operations.\n     *\n     * @param T[] $old Original array\n     * @param T[] $new New array\n     *\n     * @return DiffElem[] Diff (edit script), including replace operations\n     */\n    public function diffWithReplacements(array $old, array $new): array {\n        return $this->coalesceReplacements($this->diff($old, $new));\n    }\n\n    /**\n     * @param T[] $old\n     * @param T[] $new\n     * @return array{array<int, array<int, int>>, int, int}\n     */\n    private function calculateTrace(array $old, array $new): array {\n        $n = \\count($old);\n        $m = \\count($new);\n        $max = $n + $m;\n        $v = [1 => 0];\n        $trace = [];\n        for ($d = 0; $d <= $max; $d++) {\n            $trace[] = $v;\n            for ($k = -$d; $k <= $d; $k += 2) {\n                if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) {\n                    $x = $v[$k + 1];\n                } else {\n                    $x = $v[$k - 1] + 1;\n                }\n\n                $y = $x - $k;\n                while ($x < $n && $y < $m && ($this->isEqual)($old[$x], $new[$y])) {\n                    $x++;\n                    $y++;\n                }\n\n                $v[$k] = $x;\n                if ($x >= $n && $y >= $m) {\n                    return [$trace, $x, $y];\n                }\n            }\n        }\n        throw new \\Exception('Should not happen');\n    }\n\n    /**\n     * @param array<int, array<int, int>> $trace\n     * @param T[] $old\n     * @param T[] $new\n     * @return DiffElem[]\n     */\n    private function extractDiff(array $trace, int $x, int $y, array $old, array $new): array {\n        $result = [];\n        for ($d = \\count($trace) - 1; $d >= 0; $d--) {\n            $v = $trace[$d];\n            $k = $x - $y;\n\n            if ($k === -$d || ($k !== $d && $v[$k - 1] < $v[$k + 1])) {\n                $prevK = $k + 1;\n            } else {\n                $prevK = $k - 1;\n            }\n\n            $prevX = $v[$prevK];\n            $prevY = $prevX - $prevK;\n\n            while ($x > $prevX && $y > $prevY) {\n                $result[] = new DiffElem(DiffElem::TYPE_KEEP, $old[$x - 1], $new[$y - 1]);\n                $x--;\n                $y--;\n            }\n\n            if ($d === 0) {\n                break;\n            }\n\n            while ($x > $prevX) {\n                $result[] = new DiffElem(DiffElem::TYPE_REMOVE, $old[$x - 1], null);\n                $x--;\n            }\n\n            while ($y > $prevY) {\n                $result[] = new DiffElem(DiffElem::TYPE_ADD, null, $new[$y - 1]);\n                $y--;\n            }\n        }\n        return array_reverse($result);\n    }\n\n    /**\n     * Coalesce equal-length sequences of remove+add into a replace operation.\n     *\n     * @param DiffElem[] $diff\n     * @return DiffElem[]\n     */\n    private function coalesceReplacements(array $diff): array {\n        $newDiff = [];\n        $c = \\count($diff);\n        for ($i = 0; $i < $c; $i++) {\n            $diffType = $diff[$i]->type;\n            if ($diffType !== DiffElem::TYPE_REMOVE) {\n                $newDiff[] = $diff[$i];\n                continue;\n            }\n\n            $j = $i;\n            while ($j < $c && $diff[$j]->type === DiffElem::TYPE_REMOVE) {\n                $j++;\n            }\n\n            $k = $j;\n            while ($k < $c && $diff[$k]->type === DiffElem::TYPE_ADD) {\n                $k++;\n            }\n\n            if ($j - $i === $k - $j) {\n                $len = $j - $i;\n                for ($n = 0; $n < $len; $n++) {\n                    $newDiff[] = new DiffElem(\n                        DiffElem::TYPE_REPLACE, $diff[$i + $n]->old, $diff[$j + $n]->new\n                    );\n                }\n            } else {\n                for (; $i < $k; $i++) {\n                    $newDiff[] = $diff[$i];\n                }\n            }\n            $i = $k - 1;\n        }\n        return $newDiff;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Internal/PrintableNewAnonClassNode.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Internal;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\n\n/**\n * This node is used internally by the format-preserving pretty printer to print anonymous classes.\n *\n * The normal anonymous class structure violates assumptions about the order of token offsets.\n * Namely, the constructor arguments are part of the Expr\\New_ node and follow the class node, even\n * though they are actually interleaved with them. This special node type is used temporarily to\n * restore a sane token offset order.\n *\n * @internal\n */\nclass PrintableNewAnonClassNode extends Expr {\n    /** @var Node\\AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n    /** @var int Modifiers */\n    public int $flags;\n    /** @var (Node\\Arg|Node\\VariadicPlaceholder)[] Arguments */\n    public array $args;\n    /** @var null|Node\\Name Name of extended class */\n    public ?Node\\Name $extends;\n    /** @var Node\\Name[] Names of implemented interfaces */\n    public array $implements;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n\n    /**\n     * @param Node\\AttributeGroup[] $attrGroups PHP attribute groups\n     * @param (Node\\Arg|Node\\VariadicPlaceholder)[] $args Arguments\n     * @param Node\\Name|null $extends Name of extended class\n     * @param Node\\Name[] $implements Names of implemented interfaces\n     * @param Node\\Stmt[] $stmts Statements\n     * @param array<string, mixed> $attributes Attributes\n     */\n    public function __construct(\n        array $attrGroups, int $flags, array $args, ?Node\\Name $extends, array $implements,\n        array $stmts, array $attributes\n    ) {\n        parent::__construct($attributes);\n        $this->attrGroups = $attrGroups;\n        $this->flags = $flags;\n        $this->args = $args;\n        $this->extends = $extends;\n        $this->implements = $implements;\n        $this->stmts = $stmts;\n    }\n\n    public static function fromNewNode(Expr\\New_ $newNode): self {\n        $class = $newNode->class;\n        assert($class instanceof Node\\Stmt\\Class_);\n        // We don't assert that $class->name is null here, to allow consumers to assign unique names\n        // to anonymous classes for their own purposes. We simplify ignore the name here.\n        return new self(\n            $class->attrGroups, $class->flags, $newNode->args, $class->extends, $class->implements,\n            $class->stmts, $newNode->getAttributes()\n        );\n    }\n\n    public function getType(): string {\n        return 'Expr_PrintableNewAnonClass';\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'flags', 'args', 'extends', 'implements', 'stmts'];\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Internal/TokenPolyfill.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Internal;\n\nif (\\PHP_VERSION_ID >= 80000) {\n    class TokenPolyfill extends \\PhpToken {\n    }\n    return;\n}\n\n/**\n * This is a polyfill for the PhpToken class introduced in PHP 8.0. We do not actually polyfill\n * PhpToken, because composer might end up picking a different polyfill implementation, which does\n * not meet our requirements.\n *\n * @internal\n */\nclass TokenPolyfill {\n    /** @var int The ID of the token. Either a T_* constant of a character code < 256. */\n    public int $id;\n    /** @var string The textual content of the token. */\n    public string $text;\n    /** @var int The 1-based starting line of the token (or -1 if unknown). */\n    public int $line;\n    /** @var int The 0-based starting position of the token (or -1 if unknown). */\n    public int $pos;\n\n    /** @var array<int, bool> Tokens ignored by the PHP parser. */\n    private const IGNORABLE_TOKENS = [\n        \\T_WHITESPACE => true,\n        \\T_COMMENT => true,\n        \\T_DOC_COMMENT => true,\n        \\T_OPEN_TAG => true,\n    ];\n\n    /** @var array<int, bool> Tokens that may be part of a T_NAME_* identifier. */\n    private static array $identifierTokens;\n\n    /**\n     * Create a Token with the given ID and text, as well optional line and position information.\n     */\n    final public function __construct(int $id, string $text, int $line = -1, int $pos = -1) {\n        $this->id = $id;\n        $this->text = $text;\n        $this->line = $line;\n        $this->pos = $pos;\n    }\n\n    /**\n     * Get the name of the token. For single-char tokens this will be the token character.\n     * Otherwise it will be a T_* style name, or null if the token ID is unknown.\n     */\n    public function getTokenName(): ?string {\n        if ($this->id < 256) {\n            return \\chr($this->id);\n        }\n\n        $name = token_name($this->id);\n        return $name === 'UNKNOWN' ? null : $name;\n    }\n\n    /**\n     * Check whether the token is of the given kind. The kind may be either an integer that matches\n     * the token ID, a string that matches the token text, or an array of integers/strings. In the\n     * latter case, the function returns true if any of the kinds in the array match.\n     *\n     * @param int|string|(int|string)[] $kind\n     */\n    public function is($kind): bool {\n        if (\\is_int($kind)) {\n            return $this->id === $kind;\n        }\n        if (\\is_string($kind)) {\n            return $this->text === $kind;\n        }\n        if (\\is_array($kind)) {\n            foreach ($kind as $entry) {\n                if (\\is_int($entry)) {\n                    if ($this->id === $entry) {\n                        return true;\n                    }\n                } elseif (\\is_string($entry)) {\n                    if ($this->text === $entry) {\n                        return true;\n                    }\n                } else {\n                    throw new \\TypeError(\n                        'Argument #1 ($kind) must only have elements of type string|int, ' .\n                        gettype($entry) . ' given');\n                }\n            }\n            return false;\n        }\n        throw new \\TypeError(\n            'Argument #1 ($kind) must be of type string|int|array, ' .gettype($kind) . ' given');\n    }\n\n    /**\n     * Check whether this token would be ignored by the PHP parser. Returns true for T_WHITESPACE,\n     * T_COMMENT, T_DOC_COMMENT and T_OPEN_TAG, and false for everything else.\n     */\n    public function isIgnorable(): bool {\n        return isset(self::IGNORABLE_TOKENS[$this->id]);\n    }\n\n    /**\n     * Return the textual content of the token.\n     */\n    public function __toString(): string {\n        return $this->text;\n    }\n\n    /**\n     * Tokenize the given source code and return an array of tokens.\n     *\n     * This performs certain canonicalizations to match the PHP 8.0 token format:\n     *  * Bad characters are represented using T_BAD_CHARACTER rather than omitted.\n     *  * T_COMMENT does not include trailing newlines, instead the newline is part of a following\n     *    T_WHITESPACE token.\n     *  * Namespaced names are represented using T_NAME_* tokens.\n     *\n     * @return static[]\n     */\n    public static function tokenize(string $code, int $flags = 0): array {\n        self::init();\n\n        $tokens = [];\n        $line = 1;\n        $pos = 0;\n        $origTokens = \\token_get_all($code, $flags);\n\n        $numTokens = \\count($origTokens);\n        for ($i = 0; $i < $numTokens; $i++) {\n            $token = $origTokens[$i];\n            if (\\is_string($token)) {\n                if (\\strlen($token) === 2) {\n                    // b\" and B\" are tokenized as single-char tokens, even though they aren't.\n                    $tokens[] = new static(\\ord('\"'), $token, $line, $pos);\n                    $pos += 2;\n                } else {\n                    $tokens[] = new static(\\ord($token), $token, $line, $pos);\n                    $pos++;\n                }\n            } else {\n                $id = $token[0];\n                $text = $token[1];\n\n                // Emulate PHP 8.0 comment format, which does not include trailing whitespace anymore.\n                if ($id === \\T_COMMENT && \\substr($text, 0, 2) !== '/*' &&\n                    \\preg_match('/(\\r\\n|\\n|\\r)$/D', $text, $matches)\n                ) {\n                    $trailingNewline = $matches[0];\n                    $text = \\substr($text, 0, -\\strlen($trailingNewline));\n                    $tokens[] = new static($id, $text, $line, $pos);\n                    $pos += \\strlen($text);\n\n                    if ($i + 1 < $numTokens && $origTokens[$i + 1][0] === \\T_WHITESPACE) {\n                        // Move trailing newline into following T_WHITESPACE token, if it already exists.\n                        $origTokens[$i + 1][1] = $trailingNewline . $origTokens[$i + 1][1];\n                        $origTokens[$i + 1][2]--;\n                    } else {\n                        // Otherwise, we need to create a new T_WHITESPACE token.\n                        $tokens[] = new static(\\T_WHITESPACE, $trailingNewline, $line, $pos);\n                        $line++;\n                        $pos += \\strlen($trailingNewline);\n                    }\n                    continue;\n                }\n\n                // Emulate PHP 8.0 T_NAME_* tokens, by combining sequences of T_NS_SEPARATOR and\n                // T_STRING into a single token.\n                if (($id === \\T_NS_SEPARATOR || isset(self::$identifierTokens[$id]))) {\n                    $newText = $text;\n                    $lastWasSeparator = $id === \\T_NS_SEPARATOR;\n                    for ($j = $i + 1; $j < $numTokens; $j++) {\n                        if ($lastWasSeparator) {\n                            if (!isset(self::$identifierTokens[$origTokens[$j][0]])) {\n                                break;\n                            }\n                            $lastWasSeparator = false;\n                        } else {\n                            if ($origTokens[$j][0] !== \\T_NS_SEPARATOR) {\n                                break;\n                            }\n                            $lastWasSeparator = true;\n                        }\n                        $newText .= $origTokens[$j][1];\n                    }\n                    if ($lastWasSeparator) {\n                        // Trailing separator is not part of the name.\n                        $j--;\n                        $newText = \\substr($newText, 0, -1);\n                    }\n                    if ($j > $i + 1) {\n                        if ($id === \\T_NS_SEPARATOR) {\n                            $id = \\T_NAME_FULLY_QUALIFIED;\n                        } elseif ($id === \\T_NAMESPACE) {\n                            $id = \\T_NAME_RELATIVE;\n                        } else {\n                            $id = \\T_NAME_QUALIFIED;\n                        }\n                        $tokens[] = new static($id, $newText, $line, $pos);\n                        $pos += \\strlen($newText);\n                        $i = $j - 1;\n                        continue;\n                    }\n                }\n\n                $tokens[] = new static($id, $text, $line, $pos);\n                $line += \\substr_count($text, \"\\n\");\n                $pos += \\strlen($text);\n            }\n        }\n        return $tokens;\n    }\n\n    /** Initialize private static state needed by tokenize(). */\n    private static function init(): void {\n        if (isset(self::$identifierTokens)) {\n            return;\n        }\n\n        // Based on semi_reserved production.\n        self::$identifierTokens = \\array_fill_keys([\n            \\T_STRING,\n            \\T_STATIC, \\T_ABSTRACT, \\T_FINAL, \\T_PRIVATE, \\T_PROTECTED, \\T_PUBLIC, \\T_READONLY,\n            \\T_INCLUDE, \\T_INCLUDE_ONCE, \\T_EVAL, \\T_REQUIRE, \\T_REQUIRE_ONCE, \\T_LOGICAL_OR, \\T_LOGICAL_XOR, \\T_LOGICAL_AND,\n            \\T_INSTANCEOF, \\T_NEW, \\T_CLONE, \\T_EXIT, \\T_IF, \\T_ELSEIF, \\T_ELSE, \\T_ENDIF, \\T_ECHO, \\T_DO, \\T_WHILE,\n            \\T_ENDWHILE, \\T_FOR, \\T_ENDFOR, \\T_FOREACH, \\T_ENDFOREACH, \\T_DECLARE, \\T_ENDDECLARE, \\T_AS, \\T_TRY, \\T_CATCH,\n            \\T_FINALLY, \\T_THROW, \\T_USE, \\T_INSTEADOF, \\T_GLOBAL, \\T_VAR, \\T_UNSET, \\T_ISSET, \\T_EMPTY, \\T_CONTINUE, \\T_GOTO,\n            \\T_FUNCTION, \\T_CONST, \\T_RETURN, \\T_PRINT, \\T_YIELD, \\T_LIST, \\T_SWITCH, \\T_ENDSWITCH, \\T_CASE, \\T_DEFAULT,\n            \\T_BREAK, \\T_ARRAY, \\T_CALLABLE, \\T_EXTENDS, \\T_IMPLEMENTS, \\T_NAMESPACE, \\T_TRAIT, \\T_INTERFACE, \\T_CLASS,\n            \\T_CLASS_C, \\T_TRAIT_C, \\T_FUNC_C, \\T_METHOD_C, \\T_LINE, \\T_FILE, \\T_DIR, \\T_NS_C, \\T_HALT_COMPILER, \\T_FN,\n            \\T_MATCH,\n        ], true);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Internal/TokenStream.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Internal;\n\nuse PhpParser\\Token;\n\n/**\n * Provides operations on token streams, for use by pretty printer.\n *\n * @internal\n */\nclass TokenStream {\n    /** @var Token[] Tokens (in PhpToken::tokenize() format) */\n    private array $tokens;\n    /** @var int[] Map from position to indentation */\n    private array $indentMap;\n\n    /**\n     * Create token stream instance.\n     *\n     * @param Token[] $tokens Tokens in PhpToken::tokenize() format\n     */\n    public function __construct(array $tokens, int $tabWidth) {\n        $this->tokens = $tokens;\n        $this->indentMap = $this->calcIndentMap($tabWidth);\n    }\n\n    /**\n     * Whether the given position is immediately surrounded by parenthesis.\n     *\n     * @param int $startPos Start position\n     * @param int $endPos End position\n     */\n    public function haveParens(int $startPos, int $endPos): bool {\n        return $this->haveTokenImmediatelyBefore($startPos, '(')\n            && $this->haveTokenImmediatelyAfter($endPos, ')');\n    }\n\n    /**\n     * Whether the given position is immediately surrounded by braces.\n     *\n     * @param int $startPos Start position\n     * @param int $endPos End position\n     */\n    public function haveBraces(int $startPos, int $endPos): bool {\n        return ($this->haveTokenImmediatelyBefore($startPos, '{')\n                || $this->haveTokenImmediatelyBefore($startPos, T_CURLY_OPEN))\n            && $this->haveTokenImmediatelyAfter($endPos, '}');\n    }\n\n    /**\n     * Check whether the position is directly preceded by a certain token type.\n     *\n     * During this check whitespace and comments are skipped.\n     *\n     * @param int $pos Position before which the token should occur\n     * @param int|string $expectedTokenType Token to check for\n     *\n     * @return bool Whether the expected token was found\n     */\n    public function haveTokenImmediatelyBefore(int $pos, $expectedTokenType): bool {\n        $tokens = $this->tokens;\n        $pos--;\n        for (; $pos >= 0; $pos--) {\n            $token = $tokens[$pos];\n            if ($token->is($expectedTokenType)) {\n                return true;\n            }\n            if (!$token->isIgnorable()) {\n                break;\n            }\n        }\n        return false;\n    }\n\n    /**\n     * Check whether the position is directly followed by a certain token type.\n     *\n     * During this check whitespace and comments are skipped.\n     *\n     * @param int $pos Position after which the token should occur\n     * @param int|string $expectedTokenType Token to check for\n     *\n     * @return bool Whether the expected token was found\n     */\n    public function haveTokenImmediatelyAfter(int $pos, $expectedTokenType): bool {\n        $tokens = $this->tokens;\n        $pos++;\n        for ($c = \\count($tokens); $pos < $c; $pos++) {\n            $token = $tokens[$pos];\n            if ($token->is($expectedTokenType)) {\n                return true;\n            }\n            if (!$token->isIgnorable()) {\n                break;\n            }\n        }\n        return false;\n    }\n\n    /** @param int|string|(int|string)[] $skipTokenType */\n    public function skipLeft(int $pos, $skipTokenType): int {\n        $tokens = $this->tokens;\n\n        $pos = $this->skipLeftWhitespace($pos);\n        if ($skipTokenType === \\T_WHITESPACE) {\n            return $pos;\n        }\n\n        if (!$tokens[$pos]->is($skipTokenType)) {\n            // Shouldn't happen. The skip token MUST be there\n            throw new \\Exception('Encountered unexpected token');\n        }\n        $pos--;\n\n        return $this->skipLeftWhitespace($pos);\n    }\n\n    /** @param int|string|(int|string)[] $skipTokenType */\n    public function skipRight(int $pos, $skipTokenType): int {\n        $tokens = $this->tokens;\n\n        $pos = $this->skipRightWhitespace($pos);\n        if ($skipTokenType === \\T_WHITESPACE) {\n            return $pos;\n        }\n\n        if (!$tokens[$pos]->is($skipTokenType)) {\n            // Shouldn't happen. The skip token MUST be there\n            throw new \\Exception('Encountered unexpected token');\n        }\n        $pos++;\n\n        return $this->skipRightWhitespace($pos);\n    }\n\n    /**\n     * Return first non-whitespace token position smaller or equal to passed position.\n     *\n     * @param int $pos Token position\n     * @return int Non-whitespace token position\n     */\n    public function skipLeftWhitespace(int $pos): int {\n        $tokens = $this->tokens;\n        for (; $pos >= 0; $pos--) {\n            if (!$tokens[$pos]->isIgnorable()) {\n                break;\n            }\n        }\n        return $pos;\n    }\n\n    /**\n     * Return first non-whitespace position greater or equal to passed position.\n     *\n     * @param int $pos Token position\n     * @return int Non-whitespace token position\n     */\n    public function skipRightWhitespace(int $pos): int {\n        $tokens = $this->tokens;\n        for ($count = \\count($tokens); $pos < $count; $pos++) {\n            if (!$tokens[$pos]->isIgnorable()) {\n                break;\n            }\n        }\n        return $pos;\n    }\n\n    /** @param int|string|(int|string)[] $findTokenType */\n    public function findRight(int $pos, $findTokenType): int {\n        $tokens = $this->tokens;\n        for ($count = \\count($tokens); $pos < $count; $pos++) {\n            if ($tokens[$pos]->is($findTokenType)) {\n                return $pos;\n            }\n        }\n        return -1;\n    }\n\n    /**\n     * Whether the given position range contains a certain token type.\n     *\n     * @param int $startPos Starting position (inclusive)\n     * @param int $endPos Ending position (exclusive)\n     * @param int|string $tokenType Token type to look for\n     * @return bool Whether the token occurs in the given range\n     */\n    public function haveTokenInRange(int $startPos, int $endPos, $tokenType): bool {\n        $tokens = $this->tokens;\n        for ($pos = $startPos; $pos < $endPos; $pos++) {\n            if ($tokens[$pos]->is($tokenType)) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    public function haveTagInRange(int $startPos, int $endPos): bool {\n        return $this->haveTokenInRange($startPos, $endPos, \\T_OPEN_TAG)\n            || $this->haveTokenInRange($startPos, $endPos, \\T_CLOSE_TAG);\n    }\n\n    /**\n     * Get indentation before token position.\n     *\n     * @param int $pos Token position\n     *\n     * @return int Indentation depth (in spaces)\n     */\n    public function getIndentationBefore(int $pos): int {\n        return $this->indentMap[$pos];\n    }\n\n    /**\n     * Get the code corresponding to a token offset range, optionally adjusted for indentation.\n     *\n     * @param int $from Token start position (inclusive)\n     * @param int $to Token end position (exclusive)\n     * @param int $indent By how much the code should be indented (can be negative as well)\n     *\n     * @return string Code corresponding to token range, adjusted for indentation\n     */\n    public function getTokenCode(int $from, int $to, int $indent): string {\n        $tokens = $this->tokens;\n        $result = '';\n        for ($pos = $from; $pos < $to; $pos++) {\n            $token = $tokens[$pos];\n            $id = $token->id;\n            $text = $token->text;\n            if ($id === \\T_CONSTANT_ENCAPSED_STRING || $id === \\T_ENCAPSED_AND_WHITESPACE) {\n                $result .= $text;\n            } else {\n                // TODO Handle non-space indentation\n                if ($indent < 0) {\n                    $result .= str_replace(\"\\n\" . str_repeat(\" \", -$indent), \"\\n\", $text);\n                } elseif ($indent > 0) {\n                    $result .= str_replace(\"\\n\", \"\\n\" . str_repeat(\" \", $indent), $text);\n                } else {\n                    $result .= $text;\n                }\n            }\n        }\n        return $result;\n    }\n\n    /**\n     * Precalculate the indentation at every token position.\n     *\n     * @return int[] Token position to indentation map\n     */\n    private function calcIndentMap(int $tabWidth): array {\n        $indentMap = [];\n        $indent = 0;\n        foreach ($this->tokens as $i => $token) {\n            $indentMap[] = $indent;\n\n            if ($token->id === \\T_WHITESPACE) {\n                $content = $token->text;\n                $newlinePos = \\strrpos($content, \"\\n\");\n                if (false !== $newlinePos) {\n                    $indent = $this->getIndent(\\substr($content, $newlinePos + 1), $tabWidth);\n                } elseif ($i === 1 && $this->tokens[0]->id === \\T_OPEN_TAG &&\n                          $this->tokens[0]->text[\\strlen($this->tokens[0]->text) - 1] === \"\\n\") {\n                    // Special case: Newline at the end of opening tag followed by whitespace.\n                    $indent = $this->getIndent($content, $tabWidth);\n                }\n            }\n        }\n\n        // Add a sentinel for one past end of the file\n        $indentMap[] = $indent;\n\n        return $indentMap;\n    }\n\n    private function getIndent(string $ws, int $tabWidth): int {\n        $spaces = \\substr_count($ws, \" \");\n        $tabs = \\substr_count($ws, \"\\t\");\n        assert(\\strlen($ws) === $spaces + $tabs);\n        return $spaces + $tabs * $tabWidth;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/JsonDecoder.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass JsonDecoder {\n    /** @var \\ReflectionClass<Node>[] Node type to reflection class map */\n    private array $reflectionClassCache;\n\n    /** @return mixed */\n    public function decode(string $json) {\n        $value = json_decode($json, true);\n        if (json_last_error()) {\n            throw new \\RuntimeException('JSON decoding error: ' . json_last_error_msg());\n        }\n\n        return $this->decodeRecursive($value);\n    }\n\n    /**\n     * @param mixed $value\n     * @return mixed\n     */\n    private function decodeRecursive($value) {\n        if (\\is_array($value)) {\n            if (isset($value['nodeType'])) {\n                if ($value['nodeType'] === 'Comment' || $value['nodeType'] === 'Comment_Doc') {\n                    return $this->decodeComment($value);\n                }\n                return $this->decodeNode($value);\n            }\n            return $this->decodeArray($value);\n        }\n        return $value;\n    }\n\n    private function decodeArray(array $array): array {\n        $decodedArray = [];\n        foreach ($array as $key => $value) {\n            $decodedArray[$key] = $this->decodeRecursive($value);\n        }\n        return $decodedArray;\n    }\n\n    private function decodeNode(array $value): Node {\n        $nodeType = $value['nodeType'];\n        if (!\\is_string($nodeType)) {\n            throw new \\RuntimeException('Node type must be a string');\n        }\n\n        $reflectionClass = $this->reflectionClassFromNodeType($nodeType);\n        $node = $reflectionClass->newInstanceWithoutConstructor();\n\n        if (isset($value['attributes'])) {\n            if (!\\is_array($value['attributes'])) {\n                throw new \\RuntimeException('Attributes must be an array');\n            }\n\n            $node->setAttributes($this->decodeArray($value['attributes']));\n        }\n\n        foreach ($value as $name => $subNode) {\n            if ($name === 'nodeType' || $name === 'attributes') {\n                continue;\n            }\n\n            $node->$name = $this->decodeRecursive($subNode);\n        }\n\n        return $node;\n    }\n\n    private function decodeComment(array $value): Comment {\n        $className = $value['nodeType'] === 'Comment' ? Comment::class : Comment\\Doc::class;\n        if (!isset($value['text'])) {\n            throw new \\RuntimeException('Comment must have text');\n        }\n\n        return new $className(\n            $value['text'],\n            $value['line'] ?? -1, $value['filePos'] ?? -1, $value['tokenPos'] ?? -1,\n            $value['endLine'] ?? -1, $value['endFilePos'] ?? -1, $value['endTokenPos'] ?? -1\n        );\n    }\n\n    /** @return \\ReflectionClass<Node> */\n    private function reflectionClassFromNodeType(string $nodeType): \\ReflectionClass {\n        if (!isset($this->reflectionClassCache[$nodeType])) {\n            $className = $this->classNameFromNodeType($nodeType);\n            $this->reflectionClassCache[$nodeType] = new \\ReflectionClass($className);\n        }\n        return $this->reflectionClassCache[$nodeType];\n    }\n\n    /** @return class-string<Node> */\n    private function classNameFromNodeType(string $nodeType): string {\n        $className = 'PhpParser\\\\Node\\\\' . strtr($nodeType, '_', '\\\\');\n        if (class_exists($className)) {\n            return $className;\n        }\n\n        $className .= '_';\n        if (class_exists($className)) {\n            return $className;\n        }\n\n        throw new \\RuntimeException(\"Unknown node type \\\"$nodeType\\\"\");\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/Emulative.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer;\n\nuse PhpParser\\Error;\nuse PhpParser\\ErrorHandler;\nuse PhpParser\\Lexer;\nuse PhpParser\\Lexer\\TokenEmulator\\AsymmetricVisibilityTokenEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\AttributeEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\EnumTokenEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\ExplicitOctalEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\FnTokenEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\MatchTokenEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\NullsafeTokenEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\PipeOperatorEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\PropertyTokenEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\ReadonlyFunctionTokenEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\ReadonlyTokenEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\ReverseEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\TokenEmulator;\nuse PhpParser\\Lexer\\TokenEmulator\\VoidCastEmulator;\nuse PhpParser\\PhpVersion;\nuse PhpParser\\Token;\n\nclass Emulative extends Lexer {\n    /** @var array{int, string, string}[] Patches used to reverse changes introduced in the code */\n    private array $patches = [];\n\n    /** @var list<TokenEmulator> */\n    private array $emulators = [];\n\n    private PhpVersion $targetPhpVersion;\n\n    private PhpVersion $hostPhpVersion;\n\n    /**\n     * @param PhpVersion|null $phpVersion PHP version to emulate. Defaults to newest supported.\n     */\n    public function __construct(?PhpVersion $phpVersion = null) {\n        $this->targetPhpVersion = $phpVersion ?? PhpVersion::getNewestSupported();\n        $this->hostPhpVersion = PhpVersion::getHostVersion();\n\n        $emulators = [\n            new FnTokenEmulator(),\n            new MatchTokenEmulator(),\n            new NullsafeTokenEmulator(),\n            new AttributeEmulator(),\n            new EnumTokenEmulator(),\n            new ReadonlyTokenEmulator(),\n            new ExplicitOctalEmulator(),\n            new ReadonlyFunctionTokenEmulator(),\n            new PropertyTokenEmulator(),\n            new AsymmetricVisibilityTokenEmulator(),\n            new PipeOperatorEmulator(),\n            new VoidCastEmulator(),\n        ];\n\n        // Collect emulators that are relevant for the PHP version we're running\n        // and the PHP version we're targeting for emulation.\n        foreach ($emulators as $emulator) {\n            $emulatorPhpVersion = $emulator->getPhpVersion();\n            if ($this->isForwardEmulationNeeded($emulatorPhpVersion)) {\n                $this->emulators[] = $emulator;\n            } elseif ($this->isReverseEmulationNeeded($emulatorPhpVersion)) {\n                $this->emulators[] = new ReverseEmulator($emulator);\n            }\n        }\n    }\n\n    public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array {\n        $emulators = array_filter($this->emulators, function ($emulator) use ($code) {\n            return $emulator->isEmulationNeeded($code);\n        });\n\n        if (empty($emulators)) {\n            // Nothing to emulate, yay\n            return parent::tokenize($code, $errorHandler);\n        }\n\n        if ($errorHandler === null) {\n            $errorHandler = new ErrorHandler\\Throwing();\n        }\n\n        $this->patches = [];\n        foreach ($emulators as $emulator) {\n            $code = $emulator->preprocessCode($code, $this->patches);\n        }\n\n        $collector = new ErrorHandler\\Collecting();\n        $tokens = parent::tokenize($code, $collector);\n        $this->sortPatches();\n        $tokens = $this->fixupTokens($tokens);\n\n        $errors = $collector->getErrors();\n        if (!empty($errors)) {\n            $this->fixupErrors($errors);\n            foreach ($errors as $error) {\n                $errorHandler->handleError($error);\n            }\n        }\n\n        foreach ($emulators as $emulator) {\n            $tokens = $emulator->emulate($code, $tokens);\n        }\n\n        return $tokens;\n    }\n\n    private function isForwardEmulationNeeded(PhpVersion $emulatorPhpVersion): bool {\n        return $this->hostPhpVersion->older($emulatorPhpVersion)\n            && $this->targetPhpVersion->newerOrEqual($emulatorPhpVersion);\n    }\n\n    private function isReverseEmulationNeeded(PhpVersion $emulatorPhpVersion): bool {\n        return $this->hostPhpVersion->newerOrEqual($emulatorPhpVersion)\n            && $this->targetPhpVersion->older($emulatorPhpVersion);\n    }\n\n    private function sortPatches(): void {\n        // Patches may be contributed by different emulators.\n        // Make sure they are sorted by increasing patch position.\n        usort($this->patches, function ($p1, $p2) {\n            return $p1[0] <=> $p2[0];\n        });\n    }\n\n    /**\n     * @param list<Token> $tokens\n     * @return list<Token>\n     */\n    private function fixupTokens(array $tokens): array {\n        if (\\count($this->patches) === 0) {\n            return $tokens;\n        }\n\n        // Load first patch\n        $patchIdx = 0;\n        list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx];\n\n        // We use a manual loop over the tokens, because we modify the array on the fly\n        $posDelta = 0;\n        $lineDelta = 0;\n        for ($i = 0, $c = \\count($tokens); $i < $c; $i++) {\n            $token = $tokens[$i];\n            $pos = $token->pos;\n            $token->pos += $posDelta;\n            $token->line += $lineDelta;\n            $localPosDelta = 0;\n            $len = \\strlen($token->text);\n            while ($patchPos >= $pos && $patchPos < $pos + $len) {\n                $patchTextLen = \\strlen($patchText);\n                if ($patchType === 'remove') {\n                    if ($patchPos === $pos && $patchTextLen === $len) {\n                        // Remove token entirely\n                        array_splice($tokens, $i, 1, []);\n                        $i--;\n                        $c--;\n                    } else {\n                        // Remove from token string\n                        $token->text = substr_replace(\n                            $token->text, '', $patchPos - $pos + $localPosDelta, $patchTextLen\n                        );\n                        $localPosDelta -= $patchTextLen;\n                    }\n                    $lineDelta -= \\substr_count($patchText, \"\\n\");\n                } elseif ($patchType === 'add') {\n                    // Insert into the token string\n                    $token->text = substr_replace(\n                        $token->text, $patchText, $patchPos - $pos + $localPosDelta, 0\n                    );\n                    $localPosDelta += $patchTextLen;\n                    $lineDelta += \\substr_count($patchText, \"\\n\");\n                } elseif ($patchType === 'replace') {\n                    // Replace inside the token string\n                    $token->text = substr_replace(\n                        $token->text, $patchText, $patchPos - $pos + $localPosDelta, $patchTextLen\n                    );\n                } else {\n                    assert(false);\n                }\n\n                // Fetch the next patch\n                $patchIdx++;\n                if ($patchIdx >= \\count($this->patches)) {\n                    // No more patches. However, we still need to adjust position.\n                    $patchPos = \\PHP_INT_MAX;\n                    break;\n                }\n\n                list($patchPos, $patchType, $patchText) = $this->patches[$patchIdx];\n            }\n\n            $posDelta += $localPosDelta;\n        }\n        return $tokens;\n    }\n\n    /**\n     * Fixup line and position information in errors.\n     *\n     * @param Error[] $errors\n     */\n    private function fixupErrors(array $errors): void {\n        foreach ($errors as $error) {\n            $attrs = $error->getAttributes();\n\n            $posDelta = 0;\n            $lineDelta = 0;\n            foreach ($this->patches as $patch) {\n                list($patchPos, $patchType, $patchText) = $patch;\n                if ($patchPos >= $attrs['startFilePos']) {\n                    // No longer relevant\n                    break;\n                }\n\n                if ($patchType === 'add') {\n                    $posDelta += strlen($patchText);\n                    $lineDelta += substr_count($patchText, \"\\n\");\n                } elseif ($patchType === 'remove') {\n                    $posDelta -= strlen($patchText);\n                    $lineDelta -= substr_count($patchText, \"\\n\");\n                }\n            }\n\n            $attrs['startFilePos'] += $posDelta;\n            $attrs['endFilePos'] += $posDelta;\n            $attrs['startLine'] += $lineDelta;\n            $attrs['endLine'] += $lineDelta;\n            $error->setAttributes($attrs);\n        }\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/AsymmetricVisibilityTokenEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\nuse PhpParser\\Token;\n\nfinal class AsymmetricVisibilityTokenEmulator extends TokenEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 4);\n    }\n    public function isEmulationNeeded(string $code): bool {\n        $code = strtolower($code);\n        return strpos($code, 'public(set)') !== false ||\n            strpos($code, 'protected(set)') !== false ||\n            strpos($code, 'private(set)') !== false;\n    }\n\n    public function emulate(string $code, array $tokens): array {\n        $map = [\n            \\T_PUBLIC => \\T_PUBLIC_SET,\n            \\T_PROTECTED => \\T_PROTECTED_SET,\n            \\T_PRIVATE => \\T_PRIVATE_SET,\n        ];\n        for ($i = 0, $c = count($tokens); $i < $c; ++$i) {\n            $token = $tokens[$i];\n            if (isset($map[$token->id]) && $i + 3 < $c && $tokens[$i + 1]->text === '(' &&\n                $tokens[$i + 2]->id === \\T_STRING && \\strtolower($tokens[$i + 2]->text) === 'set' &&\n                $tokens[$i + 3]->text === ')' &&\n                $this->isKeywordContext($tokens, $i)\n            ) {\n                array_splice($tokens, $i, 4, [\n                    new Token(\n                        $map[$token->id], $token->text . '(' . $tokens[$i + 2]->text . ')',\n                        $token->line, $token->pos),\n                ]);\n                $c -= 3;\n            }\n        }\n\n        return $tokens;\n    }\n\n    public function reverseEmulate(string $code, array $tokens): array {\n        $reverseMap = [\n            \\T_PUBLIC_SET => \\T_PUBLIC,\n            \\T_PROTECTED_SET => \\T_PROTECTED,\n            \\T_PRIVATE_SET => \\T_PRIVATE,\n        ];\n        for ($i = 0, $c = count($tokens); $i < $c; ++$i) {\n            $token = $tokens[$i];\n            if (isset($reverseMap[$token->id]) &&\n                \\preg_match('/(public|protected|private)\\((set)\\)/i', $token->text, $matches)\n            ) {\n                [, $modifier, $set] = $matches;\n                $modifierLen = \\strlen($modifier);\n                array_splice($tokens, $i, 1, [\n                    new Token($reverseMap[$token->id], $modifier, $token->line, $token->pos),\n                    new Token(\\ord('('), '(', $token->line, $token->pos + $modifierLen),\n                    new Token(\\T_STRING, $set, $token->line, $token->pos + $modifierLen + 1),\n                    new Token(\\ord(')'), ')', $token->line, $token->pos + $modifierLen + 4),\n                ]);\n                $i += 3;\n                $c += 3;\n            }\n        }\n\n        return $tokens;\n    }\n\n    /** @param Token[] $tokens */\n    protected function isKeywordContext(array $tokens, int $pos): bool {\n        $prevToken = $this->getPreviousNonSpaceToken($tokens, $pos);\n        if ($prevToken === null) {\n            return false;\n        }\n        return $prevToken->id !== \\T_OBJECT_OPERATOR\n            && $prevToken->id !== \\T_NULLSAFE_OBJECT_OPERATOR;\n    }\n\n    /** @param Token[] $tokens */\n    private function getPreviousNonSpaceToken(array $tokens, int $start): ?Token {\n        for ($i = $start - 1; $i >= 0; --$i) {\n            if ($tokens[$i]->id === T_WHITESPACE) {\n                continue;\n            }\n\n            return $tokens[$i];\n        }\n\n        return null;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/AttributeEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\nuse PhpParser\\Token;\n\nfinal class AttributeEmulator extends TokenEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 0);\n    }\n\n    public function isEmulationNeeded(string $code): bool {\n        return strpos($code, '#[') !== false;\n    }\n\n    public function emulate(string $code, array $tokens): array {\n        // We need to manually iterate and manage a count because we'll change\n        // the tokens array on the way.\n        for ($i = 0, $c = count($tokens); $i < $c; ++$i) {\n            $token = $tokens[$i];\n            if ($token->text === '#' && isset($tokens[$i + 1]) && $tokens[$i + 1]->text === '[') {\n                array_splice($tokens, $i, 2, [\n                    new Token(\\T_ATTRIBUTE, '#[', $token->line, $token->pos),\n                ]);\n                $c--;\n                continue;\n            }\n        }\n\n        return $tokens;\n    }\n\n    public function reverseEmulate(string $code, array $tokens): array {\n        // TODO\n        return $tokens;\n    }\n\n    public function preprocessCode(string $code, array &$patches): string {\n        $pos = 0;\n        while (false !== $pos = strpos($code, '#[', $pos)) {\n            // Replace #[ with %[\n            $code[$pos] = '%';\n            $patches[] = [$pos, 'replace', '#'];\n            $pos += 2;\n        }\n        return $code;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/EnumTokenEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\n\nfinal class EnumTokenEmulator extends KeywordEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 1);\n    }\n\n    public function getKeywordString(): string {\n        return 'enum';\n    }\n\n    public function getKeywordToken(): int {\n        return \\T_ENUM;\n    }\n\n    protected function isKeywordContext(array $tokens, int $pos): bool {\n        return parent::isKeywordContext($tokens, $pos)\n            && isset($tokens[$pos + 2])\n            && $tokens[$pos + 1]->id === \\T_WHITESPACE\n            && $tokens[$pos + 2]->id === \\T_STRING;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/ExplicitOctalEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\nuse PhpParser\\Token;\n\nclass ExplicitOctalEmulator extends TokenEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 1);\n    }\n\n    public function isEmulationNeeded(string $code): bool {\n        return strpos($code, '0o') !== false || strpos($code, '0O') !== false;\n    }\n\n    public function emulate(string $code, array $tokens): array {\n        for ($i = 0, $c = count($tokens); $i < $c; ++$i) {\n            $token = $tokens[$i];\n            if ($token->id == \\T_LNUMBER && $token->text === '0' &&\n                isset($tokens[$i + 1]) && $tokens[$i + 1]->id == \\T_STRING &&\n                preg_match('/[oO][0-7]+(?:_[0-7]+)*/', $tokens[$i + 1]->text)\n            ) {\n                $tokenKind = $this->resolveIntegerOrFloatToken($tokens[$i + 1]->text);\n                array_splice($tokens, $i, 2, [\n                    new Token($tokenKind, '0' . $tokens[$i + 1]->text, $token->line, $token->pos),\n                ]);\n                $c--;\n            }\n        }\n        return $tokens;\n    }\n\n    private function resolveIntegerOrFloatToken(string $str): int {\n        $str = substr($str, 1);\n        $str = str_replace('_', '', $str);\n        $num = octdec($str);\n        return is_float($num) ? \\T_DNUMBER : \\T_LNUMBER;\n    }\n\n    public function reverseEmulate(string $code, array $tokens): array {\n        // Explicit octals were not legal code previously, don't bother.\n        return $tokens;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/FnTokenEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\n\n// Retained for reverse emulation support only.\nfinal class FnTokenEmulator extends KeywordEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromString('7.4');\n    }\n\n    public function getKeywordString(): string {\n        return 'fn';\n    }\n\n    public function getKeywordToken(): int {\n        return \\T_FN;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/KeywordEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\Token;\n\nabstract class KeywordEmulator extends TokenEmulator {\n    abstract public function getKeywordString(): string;\n    abstract public function getKeywordToken(): int;\n\n    public function isEmulationNeeded(string $code): bool {\n        return strpos(strtolower($code), $this->getKeywordString()) !== false;\n    }\n\n    /** @param Token[] $tokens */\n    protected function isKeywordContext(array $tokens, int $pos): bool {\n        $prevToken = $this->getPreviousNonSpaceToken($tokens, $pos);\n        if ($prevToken === null) {\n            return false;\n        }\n        return $prevToken->id !== \\T_OBJECT_OPERATOR\n            && $prevToken->id !== \\T_NULLSAFE_OBJECT_OPERATOR;\n    }\n\n    public function emulate(string $code, array $tokens): array {\n        $keywordString = $this->getKeywordString();\n        foreach ($tokens as $i => $token) {\n            if ($token->id === T_STRING && strtolower($token->text) === $keywordString\n                    && $this->isKeywordContext($tokens, $i)) {\n                $token->id = $this->getKeywordToken();\n            }\n        }\n\n        return $tokens;\n    }\n\n    /** @param Token[] $tokens */\n    private function getPreviousNonSpaceToken(array $tokens, int $start): ?Token {\n        for ($i = $start - 1; $i >= 0; --$i) {\n            if ($tokens[$i]->id === T_WHITESPACE) {\n                continue;\n            }\n\n            return $tokens[$i];\n        }\n\n        return null;\n    }\n\n    public function reverseEmulate(string $code, array $tokens): array {\n        $keywordToken = $this->getKeywordToken();\n        foreach ($tokens as $token) {\n            if ($token->id === $keywordToken) {\n                $token->id = \\T_STRING;\n            }\n        }\n\n        return $tokens;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/MatchTokenEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\n\nfinal class MatchTokenEmulator extends KeywordEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 0);\n    }\n\n    public function getKeywordString(): string {\n        return 'match';\n    }\n\n    public function getKeywordToken(): int {\n        return \\T_MATCH;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/NullsafeTokenEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\nuse PhpParser\\Token;\n\nfinal class NullsafeTokenEmulator extends TokenEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 0);\n    }\n\n    public function isEmulationNeeded(string $code): bool {\n        return strpos($code, '?->') !== false;\n    }\n\n    public function emulate(string $code, array $tokens): array {\n        // We need to manually iterate and manage a count because we'll change\n        // the tokens array on the way\n        for ($i = 0, $c = count($tokens); $i < $c; ++$i) {\n            $token = $tokens[$i];\n            if ($token->text === '?' && isset($tokens[$i + 1]) && $tokens[$i + 1]->id === \\T_OBJECT_OPERATOR) {\n                array_splice($tokens, $i, 2, [\n                    new Token(\\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos),\n                ]);\n                $c--;\n                continue;\n            }\n\n            // Handle ?-> inside encapsed string.\n            if ($token->id === \\T_ENCAPSED_AND_WHITESPACE && isset($tokens[$i - 1])\n                && $tokens[$i - 1]->id === \\T_VARIABLE\n                && preg_match('/^\\?->([a-zA-Z_\\x80-\\xff][a-zA-Z0-9_\\x80-\\xff]*)/', $token->text, $matches)\n            ) {\n                $replacement = [\n                    new Token(\\T_NULLSAFE_OBJECT_OPERATOR, '?->', $token->line, $token->pos),\n                    new Token(\\T_STRING, $matches[1], $token->line, $token->pos + 3),\n                ];\n                $matchLen = \\strlen($matches[0]);\n                if ($matchLen !== \\strlen($token->text)) {\n                    $replacement[] = new Token(\n                        \\T_ENCAPSED_AND_WHITESPACE,\n                        \\substr($token->text, $matchLen),\n                        $token->line, $token->pos + $matchLen\n                    );\n                }\n                array_splice($tokens, $i, 1, $replacement);\n                $c += \\count($replacement) - 1;\n                continue;\n            }\n        }\n\n        return $tokens;\n    }\n\n    public function reverseEmulate(string $code, array $tokens): array {\n        // ?-> was not valid code previously, don't bother.\n        return $tokens;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/PipeOperatorEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\Lexer\\TokenEmulator\\TokenEmulator;\nuse PhpParser\\PhpVersion;\nuse PhpParser\\Token;\n\nclass PipeOperatorEmulator extends TokenEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 5);\n    }\n\n    public function isEmulationNeeded(string $code): bool {\n        return \\strpos($code, '|>') !== false;\n    }\n\n    public function emulate(string $code, array $tokens): array {\n        for ($i = 0, $c = count($tokens); $i < $c; ++$i) {\n            $token = $tokens[$i];\n            if ($token->text === '|' && isset($tokens[$i + 1]) && $tokens[$i + 1]->text === '>') {\n                array_splice($tokens, $i, 2, [\n                    new Token(\\T_PIPE, '|>', $token->line, $token->pos),\n                ]);\n                $c--;\n            }\n        }\n        return $tokens;\n    }\n\n    public function reverseEmulate(string $code, array $tokens): array {\n        for ($i = 0, $c = count($tokens); $i < $c; ++$i) {\n            $token = $tokens[$i];\n            if ($token->id === \\T_PIPE) {\n                array_splice($tokens, $i, 1, [\n                    new Token(\\ord('|'), '|', $token->line, $token->pos),\n                    new Token(\\ord('>'), '>', $token->line, $token->pos + 1),\n                ]);\n                $i++;\n                $c++;\n            }\n        }\n        return $tokens;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/PropertyTokenEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\n\nfinal class PropertyTokenEmulator extends KeywordEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 4);\n    }\n\n    public function getKeywordString(): string {\n        return '__property__';\n    }\n\n    public function getKeywordToken(): int {\n        return \\T_PROPERTY_C;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/ReadonlyFunctionTokenEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\n\n/*\n * In PHP 8.1, \"readonly(\" was special cased in the lexer in order to support functions with\n * name readonly. In PHP 8.2, this may conflict with readonly properties having a DNF type. For\n * this reason, PHP 8.2 instead treats this as T_READONLY and then handles it specially in the\n * parser. This emulator only exists to handle this special case, which is skipped by the\n * PHP 8.1 ReadonlyTokenEmulator.\n */\nclass ReadonlyFunctionTokenEmulator extends KeywordEmulator {\n    public function getKeywordString(): string {\n        return 'readonly';\n    }\n\n    public function getKeywordToken(): int {\n        return \\T_READONLY;\n    }\n\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 2);\n    }\n\n    public function reverseEmulate(string $code, array $tokens): array {\n        // Don't bother\n        return $tokens;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/ReadonlyTokenEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\n\nfinal class ReadonlyTokenEmulator extends KeywordEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 1);\n    }\n\n    public function getKeywordString(): string {\n        return 'readonly';\n    }\n\n    public function getKeywordToken(): int {\n        return \\T_READONLY;\n    }\n\n    protected function isKeywordContext(array $tokens, int $pos): bool {\n        if (!parent::isKeywordContext($tokens, $pos)) {\n            return false;\n        }\n        // Support \"function readonly(\"\n        return !(isset($tokens[$pos + 1]) &&\n                 ($tokens[$pos + 1]->text === '(' ||\n                  ($tokens[$pos + 1]->id === \\T_WHITESPACE &&\n                   isset($tokens[$pos + 2]) &&\n                   $tokens[$pos + 2]->text === '(')));\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/ReverseEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\n\n/**\n * Reverses emulation direction of the inner emulator.\n */\nfinal class ReverseEmulator extends TokenEmulator {\n    /** @var TokenEmulator Inner emulator */\n    private TokenEmulator $emulator;\n\n    public function __construct(TokenEmulator $emulator) {\n        $this->emulator = $emulator;\n    }\n\n    public function getPhpVersion(): PhpVersion {\n        return $this->emulator->getPhpVersion();\n    }\n\n    public function isEmulationNeeded(string $code): bool {\n        return $this->emulator->isEmulationNeeded($code);\n    }\n\n    public function emulate(string $code, array $tokens): array {\n        return $this->emulator->reverseEmulate($code, $tokens);\n    }\n\n    public function reverseEmulate(string $code, array $tokens): array {\n        return $this->emulator->emulate($code, $tokens);\n    }\n\n    public function preprocessCode(string $code, array &$patches): string {\n        return $code;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/TokenEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\nuse PhpParser\\Token;\n\n/** @internal */\nabstract class TokenEmulator {\n    abstract public function getPhpVersion(): PhpVersion;\n\n    abstract public function isEmulationNeeded(string $code): bool;\n\n    /**\n     * @param Token[] $tokens Original tokens\n     * @return Token[] Modified Tokens\n     */\n    abstract public function emulate(string $code, array $tokens): array;\n\n    /**\n     * @param Token[] $tokens Original tokens\n     * @return Token[] Modified Tokens\n     */\n    abstract public function reverseEmulate(string $code, array $tokens): array;\n\n    /** @param array{int, string, string}[] $patches */\n    public function preprocessCode(string $code, array &$patches): string {\n        return $code;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer/TokenEmulator/VoidCastEmulator.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer\\TokenEmulator;\n\nuse PhpParser\\PhpVersion;\nuse PhpParser\\Token;\n\nclass VoidCastEmulator extends TokenEmulator {\n    public function getPhpVersion(): PhpVersion {\n        return PhpVersion::fromComponents(8, 5);\n    }\n\n    public function isEmulationNeeded(string $code): bool {\n        return (bool)\\preg_match('/\\([ \\t]*void[ \\t]*\\)/i', $code);\n    }\n\n    public function emulate(string $code, array $tokens): array {\n        for ($i = 0, $c = count($tokens); $i < $c; ++$i) {\n            $token = $tokens[$i];\n            if ($token->text !== '(') {\n                continue;\n            }\n\n            $numTokens = 1;\n            $text = '(';\n            $j = $i + 1;\n            if ($j < $c && $tokens[$j]->id === \\T_WHITESPACE && preg_match('/[ \\t]+/', $tokens[$j]->text)) {\n                $text .= $tokens[$j]->text;\n                $numTokens++;\n                $j++;\n            }\n\n            if ($j >= $c || $tokens[$j]->id !== \\T_STRING || \\strtolower($tokens[$j]->text) !== 'void') {\n                continue;\n            }\n\n            $text .= $tokens[$j]->text;\n            $numTokens++;\n            $k = $j + 1;\n            if ($k < $c && $tokens[$k]->id === \\T_WHITESPACE && preg_match('/[ \\t]+/', $tokens[$k]->text)) {\n                $text .= $tokens[$k]->text;\n                $numTokens++;\n                $k++;\n            }\n\n            if ($k >= $c || $tokens[$k]->text !== ')') {\n                continue;\n            }\n\n            $text .= ')';\n            $numTokens++;\n            array_splice($tokens, $i, $numTokens, [\n                new Token(\\T_VOID_CAST, $text, $token->line, $token->pos),\n            ]);\n            $c -= $numTokens - 1;\n        }\n        return $tokens;\n    }\n\n    public function reverseEmulate(string $code, array $tokens): array {\n        for ($i = 0, $c = count($tokens); $i < $c; ++$i) {\n            $token = $tokens[$i];\n            if ($token->id !== \\T_VOID_CAST) {\n                continue;\n            }\n\n            if (!preg_match('/^\\(([ \\t]*)(void)([ \\t]*)\\)$/i', $token->text, $match)) {\n                throw new \\LogicException('Unexpected T_VOID_CAST contents');\n            }\n\n            $newTokens = [];\n            $pos = $token->pos;\n\n            $newTokens[] = new Token(\\ord('('), '(', $token->line, $pos);\n            $pos++;\n\n            if ($match[1] !== '') {\n                $newTokens[] = new Token(\\T_WHITESPACE, $match[1], $token->line, $pos);\n                $pos += \\strlen($match[1]);\n            }\n\n            $newTokens[] = new Token(\\T_STRING, $match[2], $token->line, $pos);\n            $pos += \\strlen($match[2]);\n\n            if ($match[3] !== '') {\n                $newTokens[] = new Token(\\T_WHITESPACE, $match[3], $token->line, $pos);\n                $pos += \\strlen($match[3]);\n            }\n\n            $newTokens[] = new Token(\\ord(')'), ')', $token->line, $pos);\n\n            array_splice($tokens, $i, 1, $newTokens);\n            $i += \\count($newTokens) - 1;\n            $c += \\count($newTokens) - 1;\n        }\n        return $tokens;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Lexer.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nrequire __DIR__ . '/compatibility_tokens.php';\n\nclass Lexer {\n    /**\n     * Tokenize the provided source code.\n     *\n     * The token array is in the same format as provided by the PhpToken::tokenize() method in\n     * PHP 8.0. The tokens are instances of PhpParser\\Token, to abstract over a polyfill\n     * implementation in earlier PHP version.\n     *\n     * The token array is terminated by a sentinel token with token ID 0.\n     * The token array does not discard any tokens (i.e. whitespace and comments are included).\n     * The token position attributes are against this token array.\n     *\n     * @param string $code The source code to tokenize.\n     * @param ErrorHandler|null $errorHandler Error handler to use for lexing errors. Defaults to\n     *                                        ErrorHandler\\Throwing.\n     * @return Token[] Tokens\n     */\n    public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array {\n        if (null === $errorHandler) {\n            $errorHandler = new ErrorHandler\\Throwing();\n        }\n\n        $scream = ini_set('xdebug.scream', '0');\n\n        $tokens = @Token::tokenize($code);\n        $this->postprocessTokens($tokens, $errorHandler);\n\n        if (false !== $scream) {\n            ini_set('xdebug.scream', $scream);\n        }\n\n        return $tokens;\n    }\n\n    private function handleInvalidCharacter(Token $token, ErrorHandler $errorHandler): void {\n        $chr = $token->text;\n        if ($chr === \"\\0\") {\n            // PHP cuts error message after null byte, so need special case\n            $errorMsg = 'Unexpected null byte';\n        } else {\n            $errorMsg = sprintf(\n                'Unexpected character \"%s\" (ASCII %d)', $chr, ord($chr)\n            );\n        }\n\n        $errorHandler->handleError(new Error($errorMsg, [\n            'startLine' => $token->line,\n            'endLine' => $token->line,\n            'startFilePos' => $token->pos,\n            'endFilePos' => $token->pos,\n        ]));\n    }\n\n    private function isUnterminatedComment(Token $token): bool {\n        return $token->is([\\T_COMMENT, \\T_DOC_COMMENT])\n            && substr($token->text, 0, 2) === '/*'\n            && substr($token->text, -2) !== '*/';\n    }\n\n    /**\n     * @param list<Token> $tokens\n     */\n    protected function postprocessTokens(array &$tokens, ErrorHandler $errorHandler): void {\n        // This function reports errors (bad characters and unterminated comments) in the token\n        // array, and performs certain canonicalizations:\n        //  * Use PHP 8.1 T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG and\n        //    T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG tokens used to disambiguate intersection types.\n        //  * Add a sentinel token with ID 0.\n\n        $numTokens = \\count($tokens);\n        if ($numTokens === 0) {\n            // Empty input edge case: Just add the sentinel token.\n            $tokens[] = new Token(0, \"\\0\", 1, 0);\n            return;\n        }\n\n        for ($i = 0; $i < $numTokens; $i++) {\n            $token = $tokens[$i];\n            if ($token->id === \\T_BAD_CHARACTER) {\n                $this->handleInvalidCharacter($token, $errorHandler);\n            }\n\n            if ($token->id === \\ord('&')) {\n                $next = $i + 1;\n                while (isset($tokens[$next]) && $tokens[$next]->id === \\T_WHITESPACE) {\n                    $next++;\n                }\n                $followedByVarOrVarArg = isset($tokens[$next]) &&\n                    $tokens[$next]->is([\\T_VARIABLE, \\T_ELLIPSIS]);\n                $token->id = $followedByVarOrVarArg\n                    ? \\T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG\n                    : \\T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG;\n            }\n        }\n\n        // Check for unterminated comment\n        $lastToken = $tokens[$numTokens - 1];\n        if ($this->isUnterminatedComment($lastToken)) {\n            $errorHandler->handleError(new Error('Unterminated comment', [\n                'startLine' => $lastToken->line,\n                'endLine' => $lastToken->getEndLine(),\n                'startFilePos' => $lastToken->pos,\n                'endFilePos' => $lastToken->getEndPos(),\n            ]));\n        }\n\n        // Add sentinel token.\n        $tokens[] = new Token(0, \"\\0\", $lastToken->getEndLine(), $lastToken->getEndPos());\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Modifiers.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\n/**\n * Modifiers used (as a bit mask) by various flags subnodes, for example on classes, functions,\n * properties and constants.\n */\nfinal class Modifiers {\n    public const PUBLIC    =  1;\n    public const PROTECTED =  2;\n    public const PRIVATE   =  4;\n    public const STATIC    =  8;\n    public const ABSTRACT  = 16;\n    public const FINAL     = 32;\n    public const READONLY  = 64;\n    public const PUBLIC_SET = 128;\n    public const PROTECTED_SET = 256;\n    public const PRIVATE_SET = 512;\n\n    public const VISIBILITY_MASK = self::PUBLIC | self::PROTECTED | self::PRIVATE;\n\n    public const VISIBILITY_SET_MASK = self::PUBLIC_SET | self::PROTECTED_SET | self::PRIVATE_SET;\n\n    private const TO_STRING_MAP = [\n        self::PUBLIC  => 'public',\n        self::PROTECTED => 'protected',\n        self::PRIVATE => 'private',\n        self::STATIC  => 'static',\n        self::ABSTRACT => 'abstract',\n        self::FINAL  => 'final',\n        self::READONLY  => 'readonly',\n        self::PUBLIC_SET => 'public(set)',\n        self::PROTECTED_SET => 'protected(set)',\n        self::PRIVATE_SET => 'private(set)',\n    ];\n\n    public static function toString(int $modifier): string {\n        if (!isset(self::TO_STRING_MAP[$modifier])) {\n            throw new \\InvalidArgumentException(\"Unknown modifier $modifier\");\n        }\n        return self::TO_STRING_MAP[$modifier];\n    }\n\n    private static function isValidModifier(int $modifier): bool {\n        $isPow2 = ($modifier & ($modifier - 1)) == 0 && $modifier != 0;\n        return $isPow2 && $modifier <= self::PRIVATE_SET;\n    }\n\n    /**\n     * @internal\n     */\n    public static function verifyClassModifier(int $a, int $b): void {\n        assert(self::isValidModifier($b));\n        if (($a & $b) != 0) {\n            throw new Error(\n                'Multiple ' . self::toString($b) . ' modifiers are not allowed');\n        }\n\n        if ($a & 48 && $b & 48) {\n            throw new Error('Cannot use the final modifier on an abstract class');\n        }\n    }\n\n    /**\n     * @internal\n     */\n    public static function verifyModifier(int $a, int $b): void {\n        assert(self::isValidModifier($b));\n        if (($a & Modifiers::VISIBILITY_MASK && $b & Modifiers::VISIBILITY_MASK) ||\n            ($a & Modifiers::VISIBILITY_SET_MASK && $b & Modifiers::VISIBILITY_SET_MASK)\n        ) {\n            throw new Error('Multiple access type modifiers are not allowed');\n        }\n\n        if (($a & $b) != 0) {\n            throw new Error(\n                'Multiple ' . self::toString($b) . ' modifiers are not allowed');\n        }\n\n        if ($a & 48 && $b & 48) {\n            throw new Error('Cannot use the final modifier on an abstract class member');\n        }\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NameContext.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Name\\FullyQualified;\nuse PhpParser\\Node\\Stmt;\n\nclass NameContext {\n    /** @var null|Name Current namespace */\n    protected ?Name $namespace;\n\n    /** @var Name[][] Map of format [aliasType => [aliasName => originalName]] */\n    protected array $aliases = [];\n\n    /** @var Name[][] Same as $aliases but preserving original case */\n    protected array $origAliases = [];\n\n    /** @var ErrorHandler Error handler */\n    protected ErrorHandler $errorHandler;\n\n    /**\n     * Create a name context.\n     *\n     * @param ErrorHandler $errorHandler Error handling used to report errors\n     */\n    public function __construct(ErrorHandler $errorHandler) {\n        $this->errorHandler = $errorHandler;\n    }\n\n    /**\n     * Start a new namespace.\n     *\n     * This also resets the alias table.\n     *\n     * @param Name|null $namespace Null is the global namespace\n     */\n    public function startNamespace(?Name $namespace = null): void {\n        $this->namespace = $namespace;\n        $this->origAliases = $this->aliases = [\n            Stmt\\Use_::TYPE_NORMAL   => [],\n            Stmt\\Use_::TYPE_FUNCTION => [],\n            Stmt\\Use_::TYPE_CONSTANT => [],\n        ];\n    }\n\n    /**\n     * Add an alias / import.\n     *\n     * @param Name $name Original name\n     * @param string $aliasName Aliased name\n     * @param Stmt\\Use_::TYPE_* $type One of Stmt\\Use_::TYPE_*\n     * @param array<string, mixed> $errorAttrs Attributes to use to report an error\n     */\n    public function addAlias(Name $name, string $aliasName, int $type, array $errorAttrs = []): void {\n        // Constant names are case sensitive, everything else case insensitive\n        if ($type === Stmt\\Use_::TYPE_CONSTANT) {\n            $aliasLookupName = $aliasName;\n        } else {\n            $aliasLookupName = strtolower($aliasName);\n        }\n\n        if (isset($this->aliases[$type][$aliasLookupName])) {\n            $typeStringMap = [\n                Stmt\\Use_::TYPE_NORMAL   => '',\n                Stmt\\Use_::TYPE_FUNCTION => 'function ',\n                Stmt\\Use_::TYPE_CONSTANT => 'const ',\n            ];\n\n            $this->errorHandler->handleError(new Error(\n                sprintf(\n                    'Cannot use %s%s as %s because the name is already in use',\n                    $typeStringMap[$type], $name, $aliasName\n                ),\n                $errorAttrs\n            ));\n            return;\n        }\n\n        $this->aliases[$type][$aliasLookupName] = $name;\n        $this->origAliases[$type][$aliasName] = $name;\n    }\n\n    /**\n     * Get current namespace.\n     *\n     * @return null|Name Namespace (or null if global namespace)\n     */\n    public function getNamespace(): ?Name {\n        return $this->namespace;\n    }\n\n    /**\n     * Get resolved name.\n     *\n     * @param Name $name Name to resolve\n     * @param Stmt\\Use_::TYPE_* $type One of Stmt\\Use_::TYPE_{FUNCTION|CONSTANT}\n     *\n     * @return null|Name Resolved name, or null if static resolution is not possible\n     */\n    public function getResolvedName(Name $name, int $type): ?Name {\n        // don't resolve special class names\n        if ($type === Stmt\\Use_::TYPE_NORMAL && $name->isSpecialClassName()) {\n            if (!$name->isUnqualified()) {\n                $this->errorHandler->handleError(new Error(\n                    sprintf(\"'\\\\%s' is an invalid class name\", $name->toString()),\n                    $name->getAttributes()\n                ));\n            }\n            return $name;\n        }\n\n        // fully qualified names are already resolved\n        if ($name->isFullyQualified()) {\n            return $name;\n        }\n\n        // Try to resolve aliases\n        if (null !== $resolvedName = $this->resolveAlias($name, $type)) {\n            return $resolvedName;\n        }\n\n        if ($type !== Stmt\\Use_::TYPE_NORMAL && $name->isUnqualified()) {\n            if (null === $this->namespace) {\n                // outside of a namespace unaliased unqualified is same as fully qualified\n                return new FullyQualified($name, $name->getAttributes());\n            }\n\n            // Cannot resolve statically\n            return null;\n        }\n\n        // if no alias exists prepend current namespace\n        return FullyQualified::concat($this->namespace, $name, $name->getAttributes());\n    }\n\n    /**\n     * Get resolved class name.\n     *\n     * @param Name $name Class ame to resolve\n     *\n     * @return Name Resolved name\n     */\n    public function getResolvedClassName(Name $name): Name {\n        return $this->getResolvedName($name, Stmt\\Use_::TYPE_NORMAL);\n    }\n\n    /**\n     * Get possible ways of writing a fully qualified name (e.g., by making use of aliases).\n     *\n     * @param string $name Fully-qualified name (without leading namespace separator)\n     * @param Stmt\\Use_::TYPE_* $type One of Stmt\\Use_::TYPE_*\n     *\n     * @return Name[] Possible representations of the name\n     */\n    public function getPossibleNames(string $name, int $type): array {\n        $lcName = strtolower($name);\n\n        if ($type === Stmt\\Use_::TYPE_NORMAL) {\n            // self, parent and static must always be unqualified\n            if ($lcName === \"self\" || $lcName === \"parent\" || $lcName === \"static\") {\n                return [new Name($name)];\n            }\n        }\n\n        // Collect possible ways to write this name, starting with the fully-qualified name\n        $possibleNames = [new FullyQualified($name)];\n\n        if (null !== $nsRelativeName = $this->getNamespaceRelativeName($name, $lcName, $type)) {\n            // Make sure there is no alias that makes the normally namespace-relative name\n            // into something else\n            if (null === $this->resolveAlias($nsRelativeName, $type)) {\n                $possibleNames[] = $nsRelativeName;\n            }\n        }\n\n        // Check for relevant namespace use statements\n        foreach ($this->origAliases[Stmt\\Use_::TYPE_NORMAL] as $alias => $orig) {\n            $lcOrig = $orig->toLowerString();\n            if (0 === strpos($lcName, $lcOrig . '\\\\')) {\n                $possibleNames[] = new Name($alias . substr($name, strlen($lcOrig)));\n            }\n        }\n\n        // Check for relevant type-specific use statements\n        foreach ($this->origAliases[$type] as $alias => $orig) {\n            if ($type === Stmt\\Use_::TYPE_CONSTANT) {\n                // Constants are complicated-sensitive\n                $normalizedOrig = $this->normalizeConstName($orig->toString());\n                if ($normalizedOrig === $this->normalizeConstName($name)) {\n                    $possibleNames[] = new Name($alias);\n                }\n            } else {\n                // Everything else is case-insensitive\n                if ($orig->toLowerString() === $lcName) {\n                    $possibleNames[] = new Name($alias);\n                }\n            }\n        }\n\n        return $possibleNames;\n    }\n\n    /**\n     * Get shortest representation of this fully-qualified name.\n     *\n     * @param string $name Fully-qualified name (without leading namespace separator)\n     * @param Stmt\\Use_::TYPE_* $type One of Stmt\\Use_::TYPE_*\n     *\n     * @return Name Shortest representation\n     */\n    public function getShortName(string $name, int $type): Name {\n        $possibleNames = $this->getPossibleNames($name, $type);\n\n        // Find shortest name\n        $shortestName = null;\n        $shortestLength = \\INF;\n        foreach ($possibleNames as $possibleName) {\n            $length = strlen($possibleName->toCodeString());\n            if ($length < $shortestLength) {\n                $shortestName = $possibleName;\n                $shortestLength = $length;\n            }\n        }\n\n        return $shortestName;\n    }\n\n    private function resolveAlias(Name $name, int $type): ?FullyQualified {\n        $firstPart = $name->getFirst();\n\n        if ($name->isQualified()) {\n            // resolve aliases for qualified names, always against class alias table\n            $checkName = strtolower($firstPart);\n            if (isset($this->aliases[Stmt\\Use_::TYPE_NORMAL][$checkName])) {\n                $alias = $this->aliases[Stmt\\Use_::TYPE_NORMAL][$checkName];\n                return FullyQualified::concat($alias, $name->slice(1), $name->getAttributes());\n            }\n        } elseif ($name->isUnqualified()) {\n            // constant aliases are case-sensitive, function aliases case-insensitive\n            $checkName = $type === Stmt\\Use_::TYPE_CONSTANT ? $firstPart : strtolower($firstPart);\n            if (isset($this->aliases[$type][$checkName])) {\n                // resolve unqualified aliases\n                return new FullyQualified($this->aliases[$type][$checkName], $name->getAttributes());\n            }\n        }\n\n        // No applicable aliases\n        return null;\n    }\n\n    private function getNamespaceRelativeName(string $name, string $lcName, int $type): ?Name {\n        if (null === $this->namespace) {\n            return new Name($name);\n        }\n\n        if ($type === Stmt\\Use_::TYPE_CONSTANT) {\n            // The constants true/false/null always resolve to the global symbols, even inside a\n            // namespace, so they may be used without qualification\n            if ($lcName === \"true\" || $lcName === \"false\" || $lcName === \"null\") {\n                return new Name($name);\n            }\n        }\n\n        $namespacePrefix = strtolower($this->namespace . '\\\\');\n        if (0 === strpos($lcName, $namespacePrefix)) {\n            return new Name(substr($name, strlen($namespacePrefix)));\n        }\n\n        return null;\n    }\n\n    private function normalizeConstName(string $name): string {\n        $nsSep = strrpos($name, '\\\\');\n        if (false === $nsSep) {\n            return $name;\n        }\n\n        // Constants have case-insensitive namespace and case-sensitive short-name\n        $ns = substr($name, 0, $nsSep);\n        $shortName = substr($name, $nsSep + 1);\n        return strtolower($ns) . '\\\\' . $shortName;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Arg.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\nclass Arg extends NodeAbstract {\n    /** @var Identifier|null Parameter name (for named parameters) */\n    public ?Identifier $name;\n    /** @var Expr Value to pass */\n    public Expr $value;\n    /** @var bool Whether to pass by ref */\n    public bool $byRef;\n    /** @var bool Whether to unpack the argument */\n    public bool $unpack;\n\n    /**\n     * Constructs a function call argument node.\n     *\n     * @param Expr $value Value to pass\n     * @param bool $byRef Whether to pass by ref\n     * @param bool $unpack Whether to unpack the argument\n     * @param array<string, mixed> $attributes Additional attributes\n     * @param Identifier|null $name Parameter name (for named parameters)\n     */\n    public function __construct(\n        Expr $value, bool $byRef = false, bool $unpack = false, array $attributes = [],\n        ?Identifier $name = null\n    ) {\n        $this->attributes = $attributes;\n        $this->name = $name;\n        $this->value = $value;\n        $this->byRef = $byRef;\n        $this->unpack = $unpack;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name', 'value', 'byRef', 'unpack'];\n    }\n\n    public function getType(): string {\n        return 'Arg';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/ArrayItem.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\nclass ArrayItem extends NodeAbstract {\n    /** @var null|Expr Key */\n    public ?Expr $key;\n    /** @var Expr Value */\n    public Expr $value;\n    /** @var bool Whether to assign by reference */\n    public bool $byRef;\n    /** @var bool Whether to unpack the argument */\n    public bool $unpack;\n\n    /**\n     * Constructs an array item node.\n     *\n     * @param Expr $value Value\n     * @param null|Expr $key Key\n     * @param bool $byRef Whether to assign by reference\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $value, ?Expr $key = null, bool $byRef = false, array $attributes = [], bool $unpack = false) {\n        $this->attributes = $attributes;\n        $this->key = $key;\n        $this->value = $value;\n        $this->byRef = $byRef;\n        $this->unpack = $unpack;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['key', 'value', 'byRef', 'unpack'];\n    }\n\n    public function getType(): string {\n        return 'ArrayItem';\n    }\n}\n\n// @deprecated compatibility alias\nclass_alias(ArrayItem::class, Expr\\ArrayItem::class);\n"
  },
  {
    "path": "lib/PhpParser/Node/Attribute.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeAbstract;\n\nclass Attribute extends NodeAbstract {\n    /** @var Name Attribute name */\n    public Name $name;\n\n    /** @var list<Arg> Attribute arguments */\n    public array $args;\n\n    /**\n     * @param Node\\Name $name Attribute name\n     * @param list<Arg> $args Attribute arguments\n     * @param array<string, mixed> $attributes Additional node attributes\n     */\n    public function __construct(Name $name, array $args = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = $name;\n        $this->args = $args;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name', 'args'];\n    }\n\n    public function getType(): string {\n        return 'Attribute';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/AttributeGroup.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\nclass AttributeGroup extends NodeAbstract {\n    /** @var Attribute[] Attributes */\n    public array $attrs;\n\n    /**\n     * @param Attribute[] $attrs PHP attributes\n     * @param array<string, mixed> $attributes Additional node attributes\n     */\n    public function __construct(array $attrs, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->attrs = $attrs;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrs'];\n    }\n\n    public function getType(): string {\n        return 'AttributeGroup';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/ClosureUse.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\nclass ClosureUse extends NodeAbstract {\n    /** @var Expr\\Variable Variable to use */\n    public Expr\\Variable $var;\n    /** @var bool Whether to use by reference */\n    public bool $byRef;\n\n    /**\n     * Constructs a closure use node.\n     *\n     * @param Expr\\Variable $var Variable to use\n     * @param bool $byRef Whether to use by reference\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr\\Variable $var, bool $byRef = false, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n        $this->byRef = $byRef;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var', 'byRef'];\n    }\n\n    public function getType(): string {\n        return 'ClosureUse';\n    }\n}\n\n// @deprecated compatibility alias\nclass_alias(ClosureUse::class, Expr\\ClosureUse::class);\n"
  },
  {
    "path": "lib/PhpParser/Node/ComplexType.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\n/**\n * This is a base class for complex types, including nullable types and union types.\n *\n * It does not provide any shared behavior and exists only for type-checking purposes.\n */\nabstract class ComplexType extends NodeAbstract {\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Const_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\nclass Const_ extends NodeAbstract {\n    /** @var Identifier Name */\n    public Identifier $name;\n    /** @var Expr Value */\n    public Expr $value;\n\n    /** @var Name|null Namespaced name (if using NameResolver) */\n    public ?Name $namespacedName;\n\n    /**\n     * Constructs a const node for use in class const and const statements.\n     *\n     * @param string|Identifier $name Name\n     * @param Expr $value Value\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, Expr $value, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = \\is_string($name) ? new Identifier($name) : $name;\n        $this->value = $value;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name', 'value'];\n    }\n\n    public function getType(): string {\n        return 'Const';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/DeclareItem.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeAbstract;\n\nclass DeclareItem extends NodeAbstract {\n    /** @var Node\\Identifier Key */\n    public Identifier $key;\n    /** @var Node\\Expr Value */\n    public Expr $value;\n\n    /**\n     * Constructs a declare key=>value pair node.\n     *\n     * @param string|Node\\Identifier $key Key\n     * @param Node\\Expr $value Value\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($key, Node\\Expr $value, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->key = \\is_string($key) ? new Node\\Identifier($key) : $key;\n        $this->value = $value;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['key', 'value'];\n    }\n\n    public function getType(): string {\n        return 'DeclareItem';\n    }\n}\n\n// @deprecated compatibility alias\nclass_alias(DeclareItem::class, Stmt\\DeclareDeclare::class);\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/ArrayDimFetch.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass ArrayDimFetch extends Expr {\n    /** @var Expr Variable */\n    public Expr $var;\n    /** @var null|Expr Array index / dim */\n    public ?Expr $dim;\n\n    /**\n     * Constructs an array index fetch node.\n     *\n     * @param Expr $var Variable\n     * @param null|Expr $dim Array index / dim\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, ?Expr $dim = null, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n        $this->dim = $dim;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var', 'dim'];\n    }\n\n    public function getType(): string {\n        return 'Expr_ArrayDimFetch';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/ArrayItem.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nrequire __DIR__ . '/../ArrayItem.php';\n\nif (false) {\n    /**\n     * For classmap-authoritative support.\n     *\n     * @deprecated use \\PhpParser\\Node\\ArrayItem instead.\n     */\n    class ArrayItem extends \\PhpParser\\Node\\ArrayItem {\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Array_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\ArrayItem;\nuse PhpParser\\Node\\Expr;\n\nclass Array_ extends Expr {\n    // For use in \"kind\" attribute\n    public const KIND_LONG = 1;  // array() syntax\n    public const KIND_SHORT = 2; // [] syntax\n\n    /** @var ArrayItem[] Items */\n    public array $items;\n\n    /**\n     * Constructs an array node.\n     *\n     * @param ArrayItem[] $items Items of the array\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $items = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->items = $items;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['items'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Array';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/ArrowFunction.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\FunctionLike;\n\nclass ArrowFunction extends Expr implements FunctionLike {\n    /** @var bool Whether the closure is static */\n    public bool $static;\n\n    /** @var bool Whether to return by reference */\n    public bool $byRef;\n\n    /** @var Node\\Param[] */\n    public array $params = [];\n\n    /** @var null|Node\\Identifier|Node\\Name|Node\\ComplexType */\n    public ?Node $returnType;\n\n    /** @var Expr Expression body */\n    public Expr $expr;\n    /** @var Node\\AttributeGroup[] */\n    public array $attrGroups;\n\n    /**\n     * @param array{\n     *     expr: Expr,\n     *     static?: bool,\n     *     byRef?: bool,\n     *     params?: Node\\Param[],\n     *     returnType?: null|Node\\Identifier|Node\\Name|Node\\ComplexType,\n     *     attrGroups?: Node\\AttributeGroup[]\n     * } $subNodes Array of the following subnodes:\n     *             'expr'                  : Expression body\n     *             'static'     => false   : Whether the closure is static\n     *             'byRef'      => false   : Whether to return by reference\n     *             'params'     => array() : Parameters\n     *             'returnType' => null    : Return type\n     *             'attrGroups' => array() : PHP attribute groups\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $subNodes, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->static = $subNodes['static'] ?? false;\n        $this->byRef = $subNodes['byRef'] ?? false;\n        $this->params = $subNodes['params'] ?? [];\n        $this->returnType = $subNodes['returnType'] ?? null;\n        $this->expr = $subNodes['expr'];\n        $this->attrGroups = $subNodes['attrGroups'] ?? [];\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'static', 'byRef', 'params', 'returnType', 'expr'];\n    }\n\n    public function returnsByRef(): bool {\n        return $this->byRef;\n    }\n\n    public function getParams(): array {\n        return $this->params;\n    }\n\n    public function getReturnType() {\n        return $this->returnType;\n    }\n\n    public function getAttrGroups(): array {\n        return $this->attrGroups;\n    }\n\n    /**\n     * @return Node\\Stmt\\Return_[]\n     */\n    public function getStmts(): array {\n        return [new Node\\Stmt\\Return_($this->expr)];\n    }\n\n    public function getType(): string {\n        return 'Expr_ArrowFunction';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Assign.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Assign extends Expr {\n    /** @var Expr Variable */\n    public Expr $var;\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs an assignment node.\n     *\n     * @param Expr $var Variable\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var', 'expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Assign';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/BitwiseAnd.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass BitwiseAnd extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_BitwiseAnd';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/BitwiseOr.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass BitwiseOr extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_BitwiseOr';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/BitwiseXor.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass BitwiseXor extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_BitwiseXor';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/Coalesce.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass Coalesce extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_Coalesce';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/Concat.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass Concat extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_Concat';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/Div.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass Div extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_Div';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/Minus.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass Minus extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_Minus';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/Mod.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass Mod extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_Mod';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/Mul.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass Mul extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_Mul';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/Plus.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass Plus extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_Plus';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/Pow.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass Pow extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_Pow';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/ShiftLeft.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass ShiftLeft extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_ShiftLeft';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp/ShiftRight.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\AssignOp;\n\nuse PhpParser\\Node\\Expr\\AssignOp;\n\nclass ShiftRight extends AssignOp {\n    public function getType(): string {\n        return 'Expr_AssignOp_ShiftRight';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignOp.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nabstract class AssignOp extends Expr {\n    /** @var Expr Variable */\n    public Expr $var;\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs a compound assignment operation node.\n     *\n     * @param Expr $var Variable\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var', 'expr'];\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/AssignRef.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass AssignRef extends Expr {\n    /** @var Expr Variable reference is assigned to */\n    public Expr $var;\n    /** @var Expr Variable which is referenced */\n    public Expr $expr;\n\n    /**\n     * Constructs an assignment node.\n     *\n     * @param Expr $var Variable\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var', 'expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_AssignRef';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/BitwiseAnd.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass BitwiseAnd extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '&';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_BitwiseAnd';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/BitwiseOr.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass BitwiseOr extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '|';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_BitwiseOr';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/BitwiseXor.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass BitwiseXor extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '^';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_BitwiseXor';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/BooleanAnd.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass BooleanAnd extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '&&';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_BooleanAnd';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/BooleanOr.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass BooleanOr extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '||';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_BooleanOr';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Coalesce.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Coalesce extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '??';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Coalesce';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Concat.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Concat extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '.';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Concat';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Div.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Div extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '/';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Div';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Equal.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Equal extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '==';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Equal';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Greater.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Greater extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '>';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Greater';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/GreaterOrEqual.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass GreaterOrEqual extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '>=';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_GreaterOrEqual';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Identical.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Identical extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '===';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Identical';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/LogicalAnd.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass LogicalAnd extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return 'and';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_LogicalAnd';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/LogicalOr.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass LogicalOr extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return 'or';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_LogicalOr';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/LogicalXor.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass LogicalXor extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return 'xor';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_LogicalXor';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Minus.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Minus extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '-';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Minus';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Mod.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Mod extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '%';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Mod';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Mul.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Mul extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '*';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Mul';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/NotEqual.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass NotEqual extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '!=';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_NotEqual';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/NotIdentical.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass NotIdentical extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '!==';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_NotIdentical';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Pipe.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Pipe extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '|>';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Pipe';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Plus.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Plus extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '+';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Plus';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Pow.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Pow extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '**';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Pow';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/ShiftLeft.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass ShiftLeft extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '<<';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_ShiftLeft';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/ShiftRight.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass ShiftRight extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '>>';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_ShiftRight';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Smaller.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Smaller extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '<';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Smaller';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/SmallerOrEqual.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass SmallerOrEqual extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '<=';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_SmallerOrEqual';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp/Spaceship.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\BinaryOp;\n\nuse PhpParser\\Node\\Expr\\BinaryOp;\n\nclass Spaceship extends BinaryOp {\n    public function getOperatorSigil(): string {\n        return '<=>';\n    }\n\n    public function getType(): string {\n        return 'Expr_BinaryOp_Spaceship';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BinaryOp.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nabstract class BinaryOp extends Expr {\n    /** @var Expr The left hand side expression */\n    public Expr $left;\n    /** @var Expr The right hand side expression */\n    public Expr $right;\n\n    /**\n     * Constructs a binary operator node.\n     *\n     * @param Expr $left The left hand side expression\n     * @param Expr $right The right hand side expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $left, Expr $right, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->left = $left;\n        $this->right = $right;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['left', 'right'];\n    }\n\n    /**\n     * Get the operator sigil for this binary operation.\n     *\n     * In the case there are multiple possible sigils for an operator, this method does not\n     * necessarily return the one used in the parsed code.\n     */\n    abstract public function getOperatorSigil(): string;\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BitwiseNot.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass BitwiseNot extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs a bitwise not node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_BitwiseNot';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/BooleanNot.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass BooleanNot extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs a boolean not node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_BooleanNot';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/CallLike.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\VariadicPlaceholder;\n\nabstract class CallLike extends Expr {\n    /**\n     * Return raw arguments, which may be actual Args, or VariadicPlaceholders for first-class\n     * callables.\n     *\n     * @return array<Arg|VariadicPlaceholder>\n     */\n    abstract public function getRawArgs(): array;\n\n    /**\n     * Returns whether this call expression is actually a first class callable.\n     */\n    public function isFirstClassCallable(): bool {\n        $rawArgs = $this->getRawArgs();\n        return count($rawArgs) === 1 && current($rawArgs) instanceof VariadicPlaceholder;\n    }\n\n    /**\n     * Assert that this is not a first-class callable and return only ordinary Args.\n     *\n     * @return Arg[]\n     */\n    public function getArgs(): array {\n        assert(!$this->isFirstClassCallable());\n        return $this->getRawArgs();\n    }\n\n    /**\n     * Retrieves a specific argument from the raw arguments.\n     *\n     * Returns the named argument that matches the given `$name`, or the\n     * positional (unnamed) argument that exists at the given `$position`,\n     * otherwise, returns `null` for first-class callables or if no match is found.\n     */\n    public function getArg(string $name, int $position): ?Arg {\n        if ($this->isFirstClassCallable()) {\n            return null;\n        }\n        foreach ($this->getRawArgs() as $i => $arg) {\n            if ($arg->unpack) {\n                continue;\n            }\n            if (\n                ($arg->name !== null && $arg->name->toString() === $name)\n                || ($arg->name === null && $i === $position)\n            ) {\n                return $arg;\n            }\n        }\n        return null;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Cast/Array_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\Cast;\n\nuse PhpParser\\Node\\Expr\\Cast;\n\nclass Array_ extends Cast {\n    public function getType(): string {\n        return 'Expr_Cast_Array';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Cast/Bool_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\Cast;\n\nuse PhpParser\\Node\\Expr\\Cast;\n\nclass Bool_ extends Cast {\n    // For use in \"kind\" attribute\n    public const KIND_BOOL = 1; // \"bool\" syntax\n    public const KIND_BOOLEAN = 2; // \"boolean\" syntax\n\n    public function getType(): string {\n        return 'Expr_Cast_Bool';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Cast/Double.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\Cast;\n\nuse PhpParser\\Node\\Expr\\Cast;\n\nclass Double extends Cast {\n    // For use in \"kind\" attribute\n    public const KIND_DOUBLE = 1; // \"double\" syntax\n    public const KIND_FLOAT = 2;  // \"float\" syntax\n    public const KIND_REAL = 3; // \"real\" syntax\n\n    public function getType(): string {\n        return 'Expr_Cast_Double';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Cast/Int_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\Cast;\n\nuse PhpParser\\Node\\Expr\\Cast;\n\nclass Int_ extends Cast {\n    // For use in \"kind\" attribute\n    public const KIND_INT = 1; // \"int\" syntax\n    public const KIND_INTEGER = 2; // \"integer\" syntax\n\n    public function getType(): string {\n        return 'Expr_Cast_Int';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Cast/Object_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\Cast;\n\nuse PhpParser\\Node\\Expr\\Cast;\n\nclass Object_ extends Cast {\n    public function getType(): string {\n        return 'Expr_Cast_Object';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Cast/String_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\Cast;\n\nuse PhpParser\\Node\\Expr\\Cast;\n\nclass String_ extends Cast {\n    // For use in \"kind\" attribute\n    public const KIND_STRING = 1; // \"string\" syntax\n    public const KIND_BINARY = 2; // \"binary\" syntax\n\n    public function getType(): string {\n        return 'Expr_Cast_String';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Cast/Unset_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\Cast;\n\nuse PhpParser\\Node\\Expr\\Cast;\n\nclass Unset_ extends Cast {\n    public function getType(): string {\n        return 'Expr_Cast_Unset';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Cast/Void_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr\\Cast;\n\nuse PhpParser\\Node\\Expr\\Cast;\n\nclass Void_ extends Cast {\n    public function getType(): string {\n        return 'Expr_Cast_Void';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Cast.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nabstract class Cast extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs a cast node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/ClassConstFetch.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\n\nclass ClassConstFetch extends Expr {\n    /** @var Name|Expr Class name */\n    public Node $class;\n    /** @var Identifier|Expr|Error Constant name */\n    public Node $name;\n\n    /**\n     * Constructs a class const fetch node.\n     *\n     * @param Name|Expr $class Class name\n     * @param string|Identifier|Expr|Error $name Constant name\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node $class, $name, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->class = $class;\n        $this->name = \\is_string($name) ? new Identifier($name) : $name;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['class', 'name'];\n    }\n\n    public function getType(): string {\n        return 'Expr_ClassConstFetch';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Clone_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Clone_ extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs a clone node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Clone';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Closure.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\ClosureUse;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\FunctionLike;\n\nclass Closure extends Expr implements FunctionLike {\n    /** @var bool Whether the closure is static */\n    public bool $static;\n    /** @var bool Whether to return by reference */\n    public bool $byRef;\n    /** @var Node\\Param[] Parameters */\n    public array $params;\n    /** @var ClosureUse[] use()s */\n    public array $uses;\n    /** @var null|Node\\Identifier|Node\\Name|Node\\ComplexType Return type */\n    public ?Node $returnType;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n    /** @var Node\\AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n\n    /**\n     * Constructs a lambda function node.\n     *\n     * @param array{\n     *     static?: bool,\n     *     byRef?: bool,\n     *     params?: Node\\Param[],\n     *     uses?: ClosureUse[],\n     *     returnType?: null|Node\\Identifier|Node\\Name|Node\\ComplexType,\n     *     stmts?: Node\\Stmt[],\n     *     attrGroups?: Node\\AttributeGroup[],\n     * } $subNodes Array of the following optional subnodes:\n     *             'static'     => false  : Whether the closure is static\n     *             'byRef'      => false  : Whether to return by reference\n     *             'params'     => array(): Parameters\n     *             'uses'       => array(): use()s\n     *             'returnType' => null   : Return type\n     *             'stmts'      => array(): Statements\n     *             'attrGroups' => array(): PHP attributes groups\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $subNodes = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->static = $subNodes['static'] ?? false;\n        $this->byRef = $subNodes['byRef'] ?? false;\n        $this->params = $subNodes['params'] ?? [];\n        $this->uses = $subNodes['uses'] ?? [];\n        $this->returnType = $subNodes['returnType'] ?? null;\n        $this->stmts = $subNodes['stmts'] ?? [];\n        $this->attrGroups = $subNodes['attrGroups'] ?? [];\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'static', 'byRef', 'params', 'uses', 'returnType', 'stmts'];\n    }\n\n    public function returnsByRef(): bool {\n        return $this->byRef;\n    }\n\n    public function getParams(): array {\n        return $this->params;\n    }\n\n    public function getReturnType() {\n        return $this->returnType;\n    }\n\n    /** @return Node\\Stmt[] */\n    public function getStmts(): array {\n        return $this->stmts;\n    }\n\n    public function getAttrGroups(): array {\n        return $this->attrGroups;\n    }\n\n    public function getType(): string {\n        return 'Expr_Closure';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/ClosureUse.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nrequire __DIR__ . '/../ClosureUse.php';\n\nif (false) {\n    /**\n     * For classmap-authoritative support.\n     *\n     * @deprecated use \\PhpParser\\Node\\ClosureUse instead.\n     */\n    class ClosureUse extends \\PhpParser\\Node\\ClosureUse {\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/ConstFetch.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Name;\n\nclass ConstFetch extends Expr {\n    /** @var Name Constant name */\n    public Name $name;\n\n    /**\n     * Constructs a const fetch node.\n     *\n     * @param Name $name Constant name\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Name $name, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = $name;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name'];\n    }\n\n    public function getType(): string {\n        return 'Expr_ConstFetch';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Empty_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Empty_ extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs an empty() node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Empty';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Error.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\n/**\n * Error node used during parsing with error recovery.\n *\n * An error node may be placed at a position where an expression is required, but an error occurred.\n * Error nodes will not be present if the parser is run in throwOnError mode (the default).\n */\nclass Error extends Expr {\n    /**\n     * Constructs an error node.\n     *\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $attributes = []) {\n        $this->attributes = $attributes;\n    }\n\n    public function getSubNodeNames(): array {\n        return [];\n    }\n\n    public function getType(): string {\n        return 'Expr_Error';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/ErrorSuppress.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass ErrorSuppress extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs an error suppress node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_ErrorSuppress';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Eval_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Eval_ extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs an eval() node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Eval';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Exit_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Exit_ extends Expr {\n    /* For use in \"kind\" attribute */\n    public const KIND_EXIT = 1;\n    public const KIND_DIE = 2;\n\n    /** @var null|Expr Expression */\n    public ?Expr $expr;\n\n    /**\n     * Constructs an exit() node.\n     *\n     * @param null|Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(?Expr $expr = null, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Exit';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/FuncCall.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\n\nclass FuncCall extends CallLike {\n    /** @var Node\\Name|Expr Function name */\n    public Node $name;\n    /** @var array<Node\\Arg|Node\\VariadicPlaceholder> Arguments */\n    public array $args;\n\n    /**\n     * Constructs a function call node.\n     *\n     * @param Node\\Name|Expr $name Function name\n     * @param array<Node\\Arg|Node\\VariadicPlaceholder> $args Arguments\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node $name, array $args = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = $name;\n        $this->args = $args;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name', 'args'];\n    }\n\n    public function getType(): string {\n        return 'Expr_FuncCall';\n    }\n\n    public function getRawArgs(): array {\n        return $this->args;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Include_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Include_ extends Expr {\n    public const TYPE_INCLUDE      = 1;\n    public const TYPE_INCLUDE_ONCE = 2;\n    public const TYPE_REQUIRE      = 3;\n    public const TYPE_REQUIRE_ONCE = 4;\n\n    /** @var Expr Expression */\n    public Expr $expr;\n    /** @var int Type of include */\n    public int $type;\n\n    /**\n     * Constructs an include node.\n     *\n     * @param Expr $expr Expression\n     * @param int $type Type of include\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, int $type, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n        $this->type = $type;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr', 'type'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Include';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Instanceof_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Name;\n\nclass Instanceof_ extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n    /** @var Name|Expr Class name */\n    public Node $class;\n\n    /**\n     * Constructs an instanceof check node.\n     *\n     * @param Expr $expr Expression\n     * @param Name|Expr $class Class name\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, Node $class, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n        $this->class = $class;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr', 'class'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Instanceof';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Isset_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Isset_ extends Expr {\n    /** @var Expr[] Variables */\n    public array $vars;\n\n    /**\n     * Constructs an array node.\n     *\n     * @param Expr[] $vars Variables\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $vars, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->vars = $vars;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['vars'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Isset';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/List_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\ArrayItem;\nuse PhpParser\\Node\\Expr;\n\nclass List_ extends Expr {\n    // For use in \"kind\" attribute\n    public const KIND_LIST = 1; // list() syntax\n    public const KIND_ARRAY = 2; // [] syntax\n\n    /** @var (ArrayItem|null)[] List of items to assign to */\n    public array $items;\n\n    /**\n     * Constructs a list() destructuring node.\n     *\n     * @param (ArrayItem|null)[] $items List of items to assign to\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $items, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->items = $items;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['items'];\n    }\n\n    public function getType(): string {\n        return 'Expr_List';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Match_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\MatchArm;\n\nclass Match_ extends Node\\Expr {\n    /** @var Node\\Expr Condition */\n    public Node\\Expr $cond;\n    /** @var MatchArm[] */\n    public array $arms;\n\n    /**\n     * @param Node\\Expr $cond Condition\n     * @param MatchArm[] $arms\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Expr $cond, array $arms = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->cond = $cond;\n        $this->arms = $arms;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['cond', 'arms'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Match';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/MethodCall.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\VariadicPlaceholder;\n\nclass MethodCall extends CallLike {\n    /** @var Expr Variable holding object */\n    public Expr $var;\n    /** @var Identifier|Expr Method name */\n    public Node $name;\n    /** @var array<Arg|VariadicPlaceholder> Arguments */\n    public array $args;\n\n    /**\n     * Constructs a function call node.\n     *\n     * @param Expr $var Variable holding object\n     * @param string|Identifier|Expr $name Method name\n     * @param array<Arg|VariadicPlaceholder> $args Arguments\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, $name, array $args = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n        $this->name = \\is_string($name) ? new Identifier($name) : $name;\n        $this->args = $args;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var', 'name', 'args'];\n    }\n\n    public function getType(): string {\n        return 'Expr_MethodCall';\n    }\n\n    public function getRawArgs(): array {\n        return $this->args;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/New_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\VariadicPlaceholder;\n\nclass New_ extends CallLike {\n    /** @var Node\\Name|Expr|Node\\Stmt\\Class_ Class name */\n    public Node $class;\n    /** @var array<Arg|VariadicPlaceholder> Arguments */\n    public array $args;\n\n    /**\n     * Constructs a function call node.\n     *\n     * @param Node\\Name|Expr|Node\\Stmt\\Class_ $class Class name (or class node for anonymous classes)\n     * @param array<Arg|VariadicPlaceholder> $args Arguments\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node $class, array $args = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->class = $class;\n        $this->args = $args;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['class', 'args'];\n    }\n\n    public function getType(): string {\n        return 'Expr_New';\n    }\n\n    public function getRawArgs(): array {\n        return $this->args;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/NullsafeMethodCall.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\VariadicPlaceholder;\n\nclass NullsafeMethodCall extends CallLike {\n    /** @var Expr Variable holding object */\n    public Expr $var;\n    /** @var Identifier|Expr Method name */\n    public Node $name;\n    /** @var array<Arg|VariadicPlaceholder> Arguments */\n    public array $args;\n\n    /**\n     * Constructs a nullsafe method call node.\n     *\n     * @param Expr $var Variable holding object\n     * @param string|Identifier|Expr $name Method name\n     * @param array<Arg|VariadicPlaceholder> $args Arguments\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, $name, array $args = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n        $this->name = \\is_string($name) ? new Identifier($name) : $name;\n        $this->args = $args;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var', 'name', 'args'];\n    }\n\n    public function getType(): string {\n        return 'Expr_NullsafeMethodCall';\n    }\n\n    public function getRawArgs(): array {\n        return $this->args;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/NullsafePropertyFetch.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Identifier;\n\nclass NullsafePropertyFetch extends Expr {\n    /** @var Expr Variable holding object */\n    public Expr $var;\n    /** @var Identifier|Expr Property name */\n    public Node $name;\n\n    /**\n     * Constructs a nullsafe property fetch node.\n     *\n     * @param Expr $var Variable holding object\n     * @param string|Identifier|Expr $name Property name\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, $name, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n        $this->name = \\is_string($name) ? new Identifier($name) : $name;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var', 'name'];\n    }\n\n    public function getType(): string {\n        return 'Expr_NullsafePropertyFetch';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/PostDec.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass PostDec extends Expr {\n    /** @var Expr Variable */\n    public Expr $var;\n\n    /**\n     * Constructs a post decrement node.\n     *\n     * @param Expr $var Variable\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var'];\n    }\n\n    public function getType(): string {\n        return 'Expr_PostDec';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/PostInc.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass PostInc extends Expr {\n    /** @var Expr Variable */\n    public Expr $var;\n\n    /**\n     * Constructs a post increment node.\n     *\n     * @param Expr $var Variable\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var'];\n    }\n\n    public function getType(): string {\n        return 'Expr_PostInc';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/PreDec.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass PreDec extends Expr {\n    /** @var Expr Variable */\n    public Expr $var;\n\n    /**\n     * Constructs a pre decrement node.\n     *\n     * @param Expr $var Variable\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var'];\n    }\n\n    public function getType(): string {\n        return 'Expr_PreDec';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/PreInc.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass PreInc extends Expr {\n    /** @var Expr Variable */\n    public Expr $var;\n\n    /**\n     * Constructs a pre increment node.\n     *\n     * @param Expr $var Variable\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var'];\n    }\n\n    public function getType(): string {\n        return 'Expr_PreInc';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Print_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Print_ extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs an print() node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Print';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/PropertyFetch.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Identifier;\n\nclass PropertyFetch extends Expr {\n    /** @var Expr Variable holding object */\n    public Expr $var;\n    /** @var Identifier|Expr Property name */\n    public Node $name;\n\n    /**\n     * Constructs a function call node.\n     *\n     * @param Expr $var Variable holding object\n     * @param string|Identifier|Expr $name Property name\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $var, $name, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n        $this->name = \\is_string($name) ? new Identifier($name) : $name;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var', 'name'];\n    }\n\n    public function getType(): string {\n        return 'Expr_PropertyFetch';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/ShellExec.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\InterpolatedStringPart;\n\nclass ShellExec extends Expr {\n    /** @var (Expr|InterpolatedStringPart)[] Interpolated string array */\n    public array $parts;\n\n    /**\n     * Constructs a shell exec (backtick) node.\n     *\n     * @param (Expr|InterpolatedStringPart)[] $parts Interpolated string array\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $parts, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->parts = $parts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['parts'];\n    }\n\n    public function getType(): string {\n        return 'Expr_ShellExec';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/StaticCall.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\VariadicPlaceholder;\n\nclass StaticCall extends CallLike {\n    /** @var Node\\Name|Expr Class name */\n    public Node $class;\n    /** @var Identifier|Expr Method name */\n    public Node $name;\n    /** @var array<Arg|VariadicPlaceholder> Arguments */\n    public array $args;\n\n    /**\n     * Constructs a static method call node.\n     *\n     * @param Node\\Name|Expr $class Class name\n     * @param string|Identifier|Expr $name Method name\n     * @param array<Arg|VariadicPlaceholder> $args Arguments\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node $class, $name, array $args = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->class = $class;\n        $this->name = \\is_string($name) ? new Identifier($name) : $name;\n        $this->args = $args;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['class', 'name', 'args'];\n    }\n\n    public function getType(): string {\n        return 'Expr_StaticCall';\n    }\n\n    public function getRawArgs(): array {\n        return $this->args;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/StaticPropertyFetch.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\VarLikeIdentifier;\n\nclass StaticPropertyFetch extends Expr {\n    /** @var Name|Expr Class name */\n    public Node $class;\n    /** @var VarLikeIdentifier|Expr Property name */\n    public Node $name;\n\n    /**\n     * Constructs a static property fetch node.\n     *\n     * @param Name|Expr $class Class name\n     * @param string|VarLikeIdentifier|Expr $name Property name\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node $class, $name, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->class = $class;\n        $this->name = \\is_string($name) ? new VarLikeIdentifier($name) : $name;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['class', 'name'];\n    }\n\n    public function getType(): string {\n        return 'Expr_StaticPropertyFetch';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Ternary.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Ternary extends Expr {\n    /** @var Expr Condition */\n    public Expr $cond;\n    /** @var null|Expr Expression for true */\n    public ?Expr $if;\n    /** @var Expr Expression for false */\n    public Expr $else;\n\n    /**\n     * Constructs a ternary operator node.\n     *\n     * @param Expr $cond Condition\n     * @param null|Expr $if Expression for true\n     * @param Expr $else Expression for false\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $cond, ?Expr $if, Expr $else, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->cond = $cond;\n        $this->if = $if;\n        $this->else = $else;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['cond', 'if', 'else'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Ternary';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Throw_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node;\n\nclass Throw_ extends Node\\Expr {\n    /** @var Node\\Expr Expression */\n    public Node\\Expr $expr;\n\n    /**\n     * Constructs a throw expression node.\n     *\n     * @param Node\\Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Throw';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/UnaryMinus.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass UnaryMinus extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs a unary minus node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_UnaryMinus';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/UnaryPlus.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass UnaryPlus extends Expr {\n    /** @var Expr Expression */\n    public Expr $expr;\n\n    /**\n     * Constructs a unary plus node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_UnaryPlus';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Variable.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Variable extends Expr {\n    /** @var string|Expr Name */\n    public $name;\n\n    /**\n     * Constructs a variable node.\n     *\n     * @param string|Expr $name Name\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = $name;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Variable';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/YieldFrom.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass YieldFrom extends Expr {\n    /** @var Expr Expression to yield from */\n    public Expr $expr;\n\n    /**\n     * Constructs an \"yield from\" node.\n     *\n     * @param Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Expr_YieldFrom';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr/Yield_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Expr;\n\nclass Yield_ extends Expr {\n    /** @var null|Expr Key expression */\n    public ?Expr $key;\n    /** @var null|Expr Value expression */\n    public ?Expr $value;\n\n    /**\n     * Constructs a yield expression node.\n     *\n     * @param null|Expr $value Value expression\n     * @param null|Expr $key Key expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(?Expr $value = null, ?Expr $key = null, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->key = $key;\n        $this->value = $value;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['key', 'value'];\n    }\n\n    public function getType(): string {\n        return 'Expr_Yield';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Expr.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\nabstract class Expr extends NodeAbstract {\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/FunctionLike.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Node;\n\ninterface FunctionLike extends Node {\n    /**\n     * Whether to return by reference\n     */\n    public function returnsByRef(): bool;\n\n    /**\n     * List of parameters\n     *\n     * @return Param[]\n     */\n    public function getParams(): array;\n\n    /**\n     * Get the declared return type or null\n     *\n     * @return null|Identifier|Name|ComplexType\n     */\n    public function getReturnType();\n\n    /**\n     * The function body\n     *\n     * @return Stmt[]|null\n     */\n    public function getStmts(): ?array;\n\n    /**\n     * Get PHP attribute groups.\n     *\n     * @return AttributeGroup[]\n     */\n    public function getAttrGroups(): array;\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Identifier.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\n/**\n * Represents a non-namespaced name. Namespaced names are represented using Name nodes.\n */\nclass Identifier extends NodeAbstract {\n    /**\n     * @psalm-var non-empty-string\n     * @var string Identifier as string\n     */\n    public string $name;\n\n    /** @var array<string, bool> */\n    private static array $specialClassNames = [\n        'self'   => true,\n        'parent' => true,\n        'static' => true,\n    ];\n\n    /**\n     * Constructs an identifier node.\n     *\n     * @param string $name Identifier as string\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(string $name, array $attributes = []) {\n        if ($name === '') {\n            throw new \\InvalidArgumentException('Identifier name cannot be empty');\n        }\n\n        $this->attributes = $attributes;\n        $this->name = $name;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name'];\n    }\n\n    /**\n     * Get identifier as string.\n     *\n     * @psalm-return non-empty-string\n     * @return string Identifier as string.\n     */\n    public function toString(): string {\n        return $this->name;\n    }\n\n    /**\n     * Get lowercased identifier as string.\n     *\n     * @psalm-return non-empty-string&lowercase-string\n     * @return string Lowercased identifier as string\n     */\n    public function toLowerString(): string {\n        return strtolower($this->name);\n    }\n\n    /**\n     * Checks whether the identifier is a special class name (self, parent or static).\n     *\n     * @return bool Whether identifier is a special class name\n     */\n    public function isSpecialClassName(): bool {\n        return isset(self::$specialClassNames[strtolower($this->name)]);\n    }\n\n    /**\n     * Get identifier as string.\n     *\n     * @psalm-return non-empty-string\n     * @return string Identifier as string\n     */\n    public function __toString(): string {\n        return $this->name;\n    }\n\n    public function getType(): string {\n        return 'Identifier';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/InterpolatedStringPart.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\nclass InterpolatedStringPart extends NodeAbstract {\n    /** @var string String value */\n    public string $value;\n\n    /**\n     * Constructs a node representing a string part of an interpolated string.\n     *\n     * @param string $value String value\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(string $value, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->value = $value;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['value'];\n    }\n\n    public function getType(): string {\n        return 'InterpolatedStringPart';\n    }\n}\n\n// @deprecated compatibility alias\nclass_alias(InterpolatedStringPart::class, Scalar\\EncapsedStringPart::class);\n"
  },
  {
    "path": "lib/PhpParser/Node/IntersectionType.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nclass IntersectionType extends ComplexType {\n    /** @var (Identifier|Name)[] Types */\n    public array $types;\n\n    /**\n     * Constructs an intersection type.\n     *\n     * @param (Identifier|Name)[] $types Types\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $types, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->types = $types;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['types'];\n    }\n\n    public function getType(): string {\n        return 'IntersectionType';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/MatchArm.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeAbstract;\n\nclass MatchArm extends NodeAbstract {\n    /** @var null|list<Node\\Expr> */\n    public ?array $conds;\n    public Expr $body;\n\n    /**\n     * @param null|list<Node\\Expr> $conds\n     */\n    public function __construct(?array $conds, Node\\Expr $body, array $attributes = []) {\n        $this->conds = $conds;\n        $this->body = $body;\n        $this->attributes = $attributes;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['conds', 'body'];\n    }\n\n    public function getType(): string {\n        return 'MatchArm';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Name/FullyQualified.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Name;\n\nclass FullyQualified extends \\PhpParser\\Node\\Name {\n    /**\n     * Checks whether the name is unqualified. (E.g. Name)\n     *\n     * @return bool Whether the name is unqualified\n     */\n    public function isUnqualified(): bool {\n        return false;\n    }\n\n    /**\n     * Checks whether the name is qualified. (E.g. Name\\Name)\n     *\n     * @return bool Whether the name is qualified\n     */\n    public function isQualified(): bool {\n        return false;\n    }\n\n    /**\n     * Checks whether the name is fully qualified. (E.g. \\Name)\n     *\n     * @return bool Whether the name is fully qualified\n     */\n    public function isFullyQualified(): bool {\n        return true;\n    }\n\n    /**\n     * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\\Name)\n     *\n     * @return bool Whether the name is relative\n     */\n    public function isRelative(): bool {\n        return false;\n    }\n\n    public function toCodeString(): string {\n        return '\\\\' . $this->toString();\n    }\n\n    public function getType(): string {\n        return 'Name_FullyQualified';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Name/Relative.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Name;\n\nclass Relative extends \\PhpParser\\Node\\Name {\n    /**\n     * Checks whether the name is unqualified. (E.g. Name)\n     *\n     * @return bool Whether the name is unqualified\n     */\n    public function isUnqualified(): bool {\n        return false;\n    }\n\n    /**\n     * Checks whether the name is qualified. (E.g. Name\\Name)\n     *\n     * @return bool Whether the name is qualified\n     */\n    public function isQualified(): bool {\n        return false;\n    }\n\n    /**\n     * Checks whether the name is fully qualified. (E.g. \\Name)\n     *\n     * @return bool Whether the name is fully qualified\n     */\n    public function isFullyQualified(): bool {\n        return false;\n    }\n\n    /**\n     * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\\Name)\n     *\n     * @return bool Whether the name is relative\n     */\n    public function isRelative(): bool {\n        return true;\n    }\n\n    public function toCodeString(): string {\n        return 'namespace\\\\' . $this->toString();\n    }\n\n    public function getType(): string {\n        return 'Name_Relative';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Name.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\nclass Name extends NodeAbstract {\n    /**\n     * @psalm-var non-empty-string\n     * @var string Name as string\n     */\n    public string $name;\n\n    /** @var array<string, bool> */\n    private static array $specialClassNames = [\n        'self'   => true,\n        'parent' => true,\n        'static' => true,\n    ];\n\n    /**\n     * Constructs a name node.\n     *\n     * @param string|string[]|self $name Name as string, part array or Name instance (copy ctor)\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    final public function __construct($name, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = self::prepareName($name);\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name'];\n    }\n\n    /**\n     * Get parts of name (split by the namespace separator).\n     *\n     * @psalm-return non-empty-list<string>\n     * @return string[] Parts of name\n     */\n    public function getParts(): array {\n        return \\explode('\\\\', $this->name);\n    }\n\n    /**\n     * Gets the first part of the name, i.e. everything before the first namespace separator.\n     *\n     * @return string First part of the name\n     */\n    public function getFirst(): string {\n        if (false !== $pos = \\strpos($this->name, '\\\\')) {\n            return \\substr($this->name, 0, $pos);\n        }\n        return $this->name;\n    }\n\n    /**\n     * Gets the last part of the name, i.e. everything after the last namespace separator.\n     *\n     * @return string Last part of the name\n     */\n    public function getLast(): string {\n        if (false !== $pos = \\strrpos($this->name, '\\\\')) {\n            return \\substr($this->name, $pos + 1);\n        }\n        return $this->name;\n    }\n\n    /**\n     * Checks whether the name is unqualified. (E.g. Name)\n     *\n     * @return bool Whether the name is unqualified\n     */\n    public function isUnqualified(): bool {\n        return false === \\strpos($this->name, '\\\\');\n    }\n\n    /**\n     * Checks whether the name is qualified. (E.g. Name\\Name)\n     *\n     * @return bool Whether the name is qualified\n     */\n    public function isQualified(): bool {\n        return false !== \\strpos($this->name, '\\\\');\n    }\n\n    /**\n     * Checks whether the name is fully qualified. (E.g. \\Name)\n     *\n     * @return bool Whether the name is fully qualified\n     */\n    public function isFullyQualified(): bool {\n        return false;\n    }\n\n    /**\n     * Checks whether the name is explicitly relative to the current namespace. (E.g. namespace\\Name)\n     *\n     * @return bool Whether the name is relative\n     */\n    public function isRelative(): bool {\n        return false;\n    }\n\n    /**\n     * Returns a string representation of the name itself, without taking the name type into\n     * account (e.g., not including a leading backslash for fully qualified names).\n     *\n     * @psalm-return non-empty-string\n     * @return string String representation\n     */\n    public function toString(): string {\n        return $this->name;\n    }\n\n    /**\n     * Returns a string representation of the name as it would occur in code (e.g., including\n     * leading backslash for fully qualified names.\n     *\n     * @psalm-return non-empty-string\n     * @return string String representation\n     */\n    public function toCodeString(): string {\n        return $this->toString();\n    }\n\n    /**\n     * Returns lowercased string representation of the name, without taking the name type into\n     * account (e.g., no leading backslash for fully qualified names).\n     *\n     * @psalm-return non-empty-string&lowercase-string\n     * @return string Lowercased string representation\n     */\n    public function toLowerString(): string {\n        return strtolower($this->name);\n    }\n\n    /**\n     * Checks whether the identifier is a special class name (self, parent or static).\n     *\n     * @return bool Whether identifier is a special class name\n     */\n    public function isSpecialClassName(): bool {\n        return isset(self::$specialClassNames[strtolower($this->name)]);\n    }\n\n    /**\n     * Returns a string representation of the name by imploding the namespace parts with the\n     * namespace separator.\n     *\n     * @psalm-return non-empty-string\n     * @return string String representation\n     */\n    public function __toString(): string {\n        return $this->name;\n    }\n\n    /**\n     * Gets a slice of a name (similar to array_slice).\n     *\n     * This method returns a new instance of the same type as the original and with the same\n     * attributes.\n     *\n     * If the slice is empty, null is returned. The null value will be correctly handled in\n     * concatenations using concat().\n     *\n     * Offset and length have the same meaning as in array_slice().\n     *\n     * @param int $offset Offset to start the slice at (may be negative)\n     * @param int|null $length Length of the slice (may be negative)\n     *\n     * @return static|null Sliced name\n     */\n    public function slice(int $offset, ?int $length = null) {\n        if ($offset === 1 && $length === null) {\n            // Short-circuit the common case.\n            if (false !== $pos = \\strpos($this->name, '\\\\')) {\n                return new static(\\substr($this->name, $pos + 1));\n            }\n            return null;\n        }\n\n        $parts = \\explode('\\\\', $this->name);\n        $numParts = \\count($parts);\n\n        $realOffset = $offset < 0 ? $offset + $numParts : $offset;\n        if ($realOffset < 0 || $realOffset > $numParts) {\n            throw new \\OutOfBoundsException(sprintf('Offset %d is out of bounds', $offset));\n        }\n\n        if (null === $length) {\n            $realLength = $numParts - $realOffset;\n        } else {\n            $realLength = $length < 0 ? $length + $numParts - $realOffset : $length;\n            if ($realLength < 0 || $realLength > $numParts - $realOffset) {\n                throw new \\OutOfBoundsException(sprintf('Length %d is out of bounds', $length));\n            }\n        }\n\n        if ($realLength === 0) {\n            // Empty slice is represented as null\n            return null;\n        }\n\n        return new static(array_slice($parts, $realOffset, $realLength), $this->attributes);\n    }\n\n    /**\n     * Concatenate two names, yielding a new Name instance.\n     *\n     * The type of the generated instance depends on which class this method is called on, for\n     * example Name\\FullyQualified::concat() will yield a Name\\FullyQualified instance.\n     *\n     * If one of the arguments is null, a new instance of the other name will be returned. If both\n     * arguments are null, null will be returned. As such, writing\n     *     Name::concat($namespace, $shortName)\n     * where $namespace is a Name node or null will work as expected.\n     *\n     * @param string|string[]|self|null $name1 The first name\n     * @param string|string[]|self|null $name2 The second name\n     * @param array<string, mixed> $attributes Attributes to assign to concatenated name\n     *\n     * @return static|null Concatenated name\n     */\n    public static function concat($name1, $name2, array $attributes = []) {\n        if (null === $name1 && null === $name2) {\n            return null;\n        }\n        if (null === $name1) {\n            return new static($name2, $attributes);\n        }\n        if (null === $name2) {\n            return new static($name1, $attributes);\n        } else {\n            return new static(\n                self::prepareName($name1) . '\\\\' . self::prepareName($name2), $attributes\n            );\n        }\n    }\n\n    /**\n     * Prepares a (string, array or Name node) name for use in name changing methods by converting\n     * it to a string.\n     *\n     * @param string|string[]|self $name Name to prepare\n     *\n     * @psalm-return non-empty-string\n     * @return string Prepared name\n     */\n    private static function prepareName($name): string {\n        if (\\is_string($name)) {\n            if ('' === $name) {\n                throw new \\InvalidArgumentException('Name cannot be empty');\n            }\n\n            return $name;\n        }\n        if (\\is_array($name)) {\n            if (empty($name)) {\n                throw new \\InvalidArgumentException('Name cannot be empty');\n            }\n\n            return implode('\\\\', $name);\n        }\n        if ($name instanceof self) {\n            return $name->name;\n        }\n\n        throw new \\InvalidArgumentException(\n            'Expected string, array of parts or Name instance'\n        );\n    }\n\n    public function getType(): string {\n        return 'Name';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/NullableType.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Node;\n\nclass NullableType extends ComplexType {\n    /** @var Identifier|Name Type */\n    public Node $type;\n\n    /**\n     * Constructs a nullable type (wrapping another type).\n     *\n     * @param Identifier|Name $type Type\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node $type, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->type = $type;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['type'];\n    }\n\n    public function getType(): string {\n        return 'NullableType';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Param.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\NodeAbstract;\n\nclass Param extends NodeAbstract {\n    /** @var null|Identifier|Name|ComplexType Type declaration */\n    public ?Node $type;\n    /** @var bool Whether parameter is passed by reference */\n    public bool $byRef;\n    /** @var bool Whether this is a variadic argument */\n    public bool $variadic;\n    /** @var Expr\\Variable|Expr\\Error Parameter variable */\n    public Expr $var;\n    /** @var null|Expr Default value */\n    public ?Expr $default;\n    /** @var int Optional visibility flags */\n    public int $flags;\n    /** @var AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n    /** @var PropertyHook[] Property hooks for promoted properties */\n    public array $hooks;\n\n    /**\n     * Constructs a parameter node.\n     *\n     * @param Expr\\Variable|Expr\\Error $var Parameter variable\n     * @param null|Expr $default Default value\n     * @param null|Identifier|Name|ComplexType $type Type declaration\n     * @param bool $byRef Whether is passed by reference\n     * @param bool $variadic Whether this is a variadic argument\n     * @param array<string, mixed> $attributes Additional attributes\n     * @param int $flags Optional visibility flags\n     * @param list<AttributeGroup> $attrGroups PHP attribute groups\n     * @param PropertyHook[] $hooks Property hooks for promoted properties\n     */\n    public function __construct(\n        Expr $var, ?Expr $default = null, ?Node $type = null,\n        bool $byRef = false, bool $variadic = false,\n        array $attributes = [],\n        int $flags = 0,\n        array $attrGroups = [],\n        array $hooks = []\n    ) {\n        $this->attributes = $attributes;\n        $this->type = $type;\n        $this->byRef = $byRef;\n        $this->variadic = $variadic;\n        $this->var = $var;\n        $this->default = $default;\n        $this->flags = $flags;\n        $this->attrGroups = $attrGroups;\n        $this->hooks = $hooks;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'flags', 'type', 'byRef', 'variadic', 'var', 'default', 'hooks'];\n    }\n\n    public function getType(): string {\n        return 'Param';\n    }\n\n    /**\n     * Whether this parameter uses constructor property promotion.\n     */\n    public function isPromoted(): bool {\n        return $this->flags !== 0 || $this->hooks !== [];\n    }\n\n    public function isFinal(): bool {\n        return (bool) ($this->flags & Modifiers::FINAL);\n    }\n\n    public function isPublic(): bool {\n        $public = (bool) ($this->flags & Modifiers::PUBLIC);\n        if ($public) {\n            return true;\n        }\n\n        if (!$this->isPromoted()) {\n            return false;\n        }\n\n        return ($this->flags & Modifiers::VISIBILITY_MASK) === 0;\n    }\n\n    public function isProtected(): bool {\n        return (bool) ($this->flags & Modifiers::PROTECTED);\n    }\n\n    public function isPrivate(): bool {\n        return (bool) ($this->flags & Modifiers::PRIVATE);\n    }\n\n    public function isReadonly(): bool {\n        return (bool) ($this->flags & Modifiers::READONLY);\n    }\n\n    /**\n     * Whether the promoted property has explicit public(set) visibility.\n     */\n    public function isPublicSet(): bool {\n        return (bool) ($this->flags & Modifiers::PUBLIC_SET);\n    }\n\n    /**\n     * Whether the promoted property has explicit protected(set) visibility.\n     */\n    public function isProtectedSet(): bool {\n        return (bool) ($this->flags & Modifiers::PROTECTED_SET);\n    }\n\n    /**\n     * Whether the promoted property has explicit private(set) visibility.\n     */\n    public function isPrivateSet(): bool {\n        return (bool) ($this->flags & Modifiers::PRIVATE_SET);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/PropertyHook.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node\\Expr\\Assign;\nuse PhpParser\\Node\\Expr\\PropertyFetch;\nuse PhpParser\\Node\\Expr\\Variable;\nuse PhpParser\\Node\\Stmt\\Expression;\nuse PhpParser\\Node\\Stmt\\Return_;\nuse PhpParser\\NodeAbstract;\n\nclass PropertyHook extends NodeAbstract implements FunctionLike {\n    /** @var AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n    /** @var int Modifiers */\n    public int $flags;\n    /** @var bool Whether hook returns by reference */\n    public bool $byRef;\n    /** @var Identifier Hook name */\n    public Identifier $name;\n    /** @var Param[] Parameters */\n    public array $params;\n    /** @var null|Expr|Stmt[] Hook body */\n    public $body;\n\n    /**\n     * Constructs a property hook node.\n     *\n     * @param string|Identifier $name Hook name\n     * @param null|Expr|Stmt[] $body Hook body\n     * @param array{\n     *     flags?: int,\n     *     byRef?: bool,\n     *     params?: Param[],\n     *     attrGroups?: AttributeGroup[],\n     * } $subNodes Array of the following optional subnodes:\n     *             'flags       => 0      : Flags\n     *             'byRef'      => false  : Whether hook returns by reference\n     *             'params'     => array(): Parameters\n     *             'attrGroups' => array(): PHP attribute groups\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, $body, array $subNodes = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = \\is_string($name) ? new Identifier($name) : $name;\n        $this->body = $body;\n        $this->flags = $subNodes['flags'] ?? 0;\n        $this->byRef = $subNodes['byRef'] ?? false;\n        $this->params = $subNodes['params'] ?? [];\n        $this->attrGroups = $subNodes['attrGroups'] ?? [];\n    }\n\n    public function returnsByRef(): bool {\n        return $this->byRef;\n    }\n\n    public function getParams(): array {\n        return $this->params;\n    }\n\n    public function getReturnType() {\n        return null;\n    }\n\n    /**\n     * Whether the property hook is final.\n     */\n    public function isFinal(): bool {\n        return (bool) ($this->flags & Modifiers::FINAL);\n    }\n\n    public function getStmts(): ?array {\n        if ($this->body instanceof Expr) {\n            $name = $this->name->toLowerString();\n            if ($name === 'get') {\n                return [new Return_($this->body)];\n            }\n            if ($name === 'set') {\n                if (!$this->hasAttribute('propertyName')) {\n                    throw new \\LogicException(\n                        'Can only use getStmts() on a \"set\" hook if the \"propertyName\" attribute is set');\n                }\n\n                $propName = $this->getAttribute('propertyName');\n                $prop = new PropertyFetch(new Variable('this'), (string) $propName);\n                return [new Expression(new Assign($prop, $this->body))];\n            }\n            throw new \\LogicException('Unknown property hook \"' . $name . '\"');\n        }\n        return $this->body;\n    }\n\n    public function getAttrGroups(): array {\n        return $this->attrGroups;\n    }\n\n    public function getType(): string {\n        return 'PropertyHook';\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'body'];\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/PropertyItem.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeAbstract;\n\nclass PropertyItem extends NodeAbstract {\n    /** @var Node\\VarLikeIdentifier Name */\n    public VarLikeIdentifier $name;\n    /** @var null|Node\\Expr Default */\n    public ?Expr $default;\n\n    /**\n     * Constructs a class property item node.\n     *\n     * @param string|Node\\VarLikeIdentifier $name Name\n     * @param null|Node\\Expr $default Default value\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, ?Node\\Expr $default = null, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = \\is_string($name) ? new Node\\VarLikeIdentifier($name) : $name;\n        $this->default = $default;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name', 'default'];\n    }\n\n    public function getType(): string {\n        return 'PropertyItem';\n    }\n}\n\n// @deprecated compatibility alias\nclass_alias(PropertyItem::class, Stmt\\PropertyProperty::class);\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/DNumber.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nrequire __DIR__ . '/Float_.php';\n\nif (false) {\n    /**\n     * For classmap-authoritative support.\n     *\n     * @deprecated use \\PhpParser\\Node\\Scalar\\Float_ instead.\n     */\n    class DNumber extends Float_ {\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/Encapsed.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nrequire __DIR__ . '/InterpolatedString.php';\n\nif (false) {\n    /**\n     * For classmap-authoritative support.\n     *\n     * @deprecated use \\PhpParser\\Node\\Scalar\\InterpolatedString instead.\n     */\n    class Encapsed extends InterpolatedString {\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/EncapsedStringPart.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nuse PhpParser\\Node\\InterpolatedStringPart;\n\nrequire __DIR__ . '/../InterpolatedStringPart.php';\n\nif (false) {\n    /**\n     * For classmap-authoritative support.\n     *\n     * @deprecated use \\PhpParser\\Node\\InterpolatedStringPart instead.\n     */\n    class EncapsedStringPart extends InterpolatedStringPart {\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/Float_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nuse PhpParser\\Node\\Scalar;\n\nclass Float_ extends Scalar {\n    /** @var float Number value */\n    public float $value;\n\n    /**\n     * Constructs a float number scalar node.\n     *\n     * @param float $value Value of the number\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(float $value, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->value = $value;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['value'];\n    }\n\n    /**\n     * @param mixed[] $attributes\n     */\n    public static function fromString(string $str, array $attributes = []): Float_ {\n        $attributes['rawValue'] = $str;\n        $float = self::parse($str);\n\n        return new Float_($float, $attributes);\n    }\n\n    /**\n     * @internal\n     *\n     * Parses a DNUMBER token like PHP would.\n     *\n     * @param string $str A string number\n     *\n     * @return float The parsed number\n     */\n    public static function parse(string $str): float {\n        $str = str_replace('_', '', $str);\n\n        // Check whether this is one of the special integer notations.\n        if ('0' === $str[0]) {\n            // hex\n            if ('x' === $str[1] || 'X' === $str[1]) {\n                return hexdec($str);\n            }\n\n            // bin\n            if ('b' === $str[1] || 'B' === $str[1]) {\n                return bindec($str);\n            }\n\n            // oct, but only if the string does not contain any of '.eE'.\n            if (false === strpbrk($str, '.eE')) {\n                // substr($str, 0, strcspn($str, '89')) cuts the string at the first invalid digit\n                // (8 or 9) so that only the digits before that are used.\n                return octdec(substr($str, 0, strcspn($str, '89')));\n            }\n        }\n\n        // dec\n        return (float) $str;\n    }\n\n    public function getType(): string {\n        return 'Scalar_Float';\n    }\n}\n\n// @deprecated compatibility alias\nclass_alias(Float_::class, DNumber::class);\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/Int_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nuse PhpParser\\Error;\nuse PhpParser\\Node\\Scalar;\n\nclass Int_ extends Scalar {\n    /* For use in \"kind\" attribute */\n    public const KIND_BIN = 2;\n    public const KIND_OCT = 8;\n    public const KIND_DEC = 10;\n    public const KIND_HEX = 16;\n\n    /** @var int Number value */\n    public int $value;\n\n    /**\n     * Constructs an integer number scalar node.\n     *\n     * @param int $value Value of the number\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(int $value, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->value = $value;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['value'];\n    }\n\n    /**\n     * Constructs an Int node from a string number literal.\n     *\n     * @param string $str String number literal (decimal, octal, hex or binary)\n     * @param array<string, mixed> $attributes Additional attributes\n     * @param bool $allowInvalidOctal Whether to allow invalid octal numbers (PHP 5)\n     *\n     * @return Int_ The constructed LNumber, including kind attribute\n     */\n    public static function fromString(string $str, array $attributes = [], bool $allowInvalidOctal = false): Int_ {\n        $attributes['rawValue'] = $str;\n\n        $str = str_replace('_', '', $str);\n\n        if ('0' !== $str[0] || '0' === $str) {\n            $attributes['kind'] = Int_::KIND_DEC;\n            return new Int_((int) $str, $attributes);\n        }\n\n        if ('x' === $str[1] || 'X' === $str[1]) {\n            $attributes['kind'] = Int_::KIND_HEX;\n            return new Int_(hexdec($str), $attributes);\n        }\n\n        if ('b' === $str[1] || 'B' === $str[1]) {\n            $attributes['kind'] = Int_::KIND_BIN;\n            return new Int_(bindec($str), $attributes);\n        }\n\n        if (!$allowInvalidOctal && strpbrk($str, '89')) {\n            throw new Error('Invalid numeric literal', $attributes);\n        }\n\n        // Strip optional explicit octal prefix.\n        if ('o' === $str[1] || 'O' === $str[1]) {\n            $str = substr($str, 2);\n        }\n\n        // use intval instead of octdec to get proper cutting behavior with malformed numbers\n        $attributes['kind'] = Int_::KIND_OCT;\n        return new Int_(intval($str, 8), $attributes);\n    }\n\n    public function getType(): string {\n        return 'Scalar_Int';\n    }\n}\n\n// @deprecated compatibility alias\nclass_alias(Int_::class, LNumber::class);\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/InterpolatedString.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\InterpolatedStringPart;\nuse PhpParser\\Node\\Scalar;\n\nclass InterpolatedString extends Scalar {\n    /** @var (Expr|InterpolatedStringPart)[] list of string parts */\n    public array $parts;\n\n    /**\n     * Constructs an interpolated string node.\n     *\n     * @param (Expr|InterpolatedStringPart)[] $parts Interpolated string parts\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $parts, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->parts = $parts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['parts'];\n    }\n\n    public function getType(): string {\n        return 'Scalar_InterpolatedString';\n    }\n}\n\n// @deprecated compatibility alias\nclass_alias(InterpolatedString::class, Encapsed::class);\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/LNumber.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nrequire __DIR__ . '/Int_.php';\n\nif (false) {\n    /**\n     * For classmap-authoritative support.\n     *\n     * @deprecated use \\PhpParser\\Node\\Scalar\\Int_ instead.\n     */\n    class LNumber extends Int_ {\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/MagicConst/Class_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar\\MagicConst;\n\nuse PhpParser\\Node\\Scalar\\MagicConst;\n\nclass Class_ extends MagicConst {\n    public function getName(): string {\n        return '__CLASS__';\n    }\n\n    public function getType(): string {\n        return 'Scalar_MagicConst_Class';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/MagicConst/Dir.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar\\MagicConst;\n\nuse PhpParser\\Node\\Scalar\\MagicConst;\n\nclass Dir extends MagicConst {\n    public function getName(): string {\n        return '__DIR__';\n    }\n\n    public function getType(): string {\n        return 'Scalar_MagicConst_Dir';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/MagicConst/File.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar\\MagicConst;\n\nuse PhpParser\\Node\\Scalar\\MagicConst;\n\nclass File extends MagicConst {\n    public function getName(): string {\n        return '__FILE__';\n    }\n\n    public function getType(): string {\n        return 'Scalar_MagicConst_File';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/MagicConst/Function_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar\\MagicConst;\n\nuse PhpParser\\Node\\Scalar\\MagicConst;\n\nclass Function_ extends MagicConst {\n    public function getName(): string {\n        return '__FUNCTION__';\n    }\n\n    public function getType(): string {\n        return 'Scalar_MagicConst_Function';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/MagicConst/Line.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar\\MagicConst;\n\nuse PhpParser\\Node\\Scalar\\MagicConst;\n\nclass Line extends MagicConst {\n    public function getName(): string {\n        return '__LINE__';\n    }\n\n    public function getType(): string {\n        return 'Scalar_MagicConst_Line';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/MagicConst/Method.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar\\MagicConst;\n\nuse PhpParser\\Node\\Scalar\\MagicConst;\n\nclass Method extends MagicConst {\n    public function getName(): string {\n        return '__METHOD__';\n    }\n\n    public function getType(): string {\n        return 'Scalar_MagicConst_Method';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/MagicConst/Namespace_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar\\MagicConst;\n\nuse PhpParser\\Node\\Scalar\\MagicConst;\n\nclass Namespace_ extends MagicConst {\n    public function getName(): string {\n        return '__NAMESPACE__';\n    }\n\n    public function getType(): string {\n        return 'Scalar_MagicConst_Namespace';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/MagicConst/Property.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar\\MagicConst;\n\nuse PhpParser\\Node\\Scalar\\MagicConst;\n\nclass Property extends MagicConst {\n    public function getName(): string {\n        return '__PROPERTY__';\n    }\n\n    public function getType(): string {\n        return 'Scalar_MagicConst_Property';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/MagicConst/Trait_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar\\MagicConst;\n\nuse PhpParser\\Node\\Scalar\\MagicConst;\n\nclass Trait_ extends MagicConst {\n    public function getName(): string {\n        return '__TRAIT__';\n    }\n\n    public function getType(): string {\n        return 'Scalar_MagicConst_Trait';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/MagicConst.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nuse PhpParser\\Node\\Scalar;\n\nabstract class MagicConst extends Scalar {\n    /**\n     * Constructs a magic constant node.\n     *\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $attributes = []) {\n        $this->attributes = $attributes;\n    }\n\n    public function getSubNodeNames(): array {\n        return [];\n    }\n\n    /**\n     * Get name of magic constant.\n     *\n     * @return string Name of magic constant\n     */\n    abstract public function getName(): string;\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar/String_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nuse PhpParser\\Error;\nuse PhpParser\\Node\\Scalar;\n\nclass String_ extends Scalar {\n    /* For use in \"kind\" attribute */\n    public const KIND_SINGLE_QUOTED = 1;\n    public const KIND_DOUBLE_QUOTED = 2;\n    public const KIND_HEREDOC = 3;\n    public const KIND_NOWDOC = 4;\n\n    /** @var string String value */\n    public string $value;\n\n    /** @var array<string, string> Escaped character to its decoded value */\n    protected static array $replacements = [\n        '\\\\' => '\\\\',\n        '$'  =>  '$',\n        'n'  => \"\\n\",\n        'r'  => \"\\r\",\n        't'  => \"\\t\",\n        'f'  => \"\\f\",\n        'v'  => \"\\v\",\n        'e'  => \"\\x1B\",\n    ];\n\n    /**\n     * Constructs a string scalar node.\n     *\n     * @param string $value Value of the string\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(string $value, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->value = $value;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['value'];\n    }\n\n    /**\n     * @param array<string, mixed> $attributes\n     * @param bool $parseUnicodeEscape Whether to parse PHP 7 \\u escapes\n     */\n    public static function fromString(string $str, array $attributes = [], bool $parseUnicodeEscape = true): self {\n        $attributes['kind'] = ($str[0] === \"'\" || ($str[1] === \"'\" && ($str[0] === 'b' || $str[0] === 'B')))\n            ? Scalar\\String_::KIND_SINGLE_QUOTED\n            : Scalar\\String_::KIND_DOUBLE_QUOTED;\n\n        $attributes['rawValue'] = $str;\n\n        $string = self::parse($str, $parseUnicodeEscape);\n\n        return new self($string, $attributes);\n    }\n\n    /**\n     * @internal\n     *\n     * Parses a string token.\n     *\n     * @param string $str String token content\n     * @param bool $parseUnicodeEscape Whether to parse PHP 7 \\u escapes\n     *\n     * @return string The parsed string\n     */\n    public static function parse(string $str, bool $parseUnicodeEscape = true): string {\n        $bLength = 0;\n        if ('b' === $str[0] || 'B' === $str[0]) {\n            $bLength = 1;\n        }\n\n        if ('\\'' === $str[$bLength]) {\n            return str_replace(\n                ['\\\\\\\\', '\\\\\\''],\n                ['\\\\', '\\''],\n                substr($str, $bLength + 1, -1)\n            );\n        } else {\n            return self::parseEscapeSequences(\n                substr($str, $bLength + 1, -1), '\"', $parseUnicodeEscape\n            );\n        }\n    }\n\n    /**\n     * @internal\n     *\n     * Parses escape sequences in strings (all string types apart from single quoted).\n     *\n     * @param string $str String without quotes\n     * @param null|string $quote Quote type\n     * @param bool $parseUnicodeEscape Whether to parse PHP 7 \\u escapes\n     *\n     * @return string String with escape sequences parsed\n     */\n    public static function parseEscapeSequences(string $str, ?string $quote, bool $parseUnicodeEscape = true): string {\n        if (null !== $quote) {\n            $str = str_replace('\\\\' . $quote, $quote, $str);\n        }\n\n        $extra = '';\n        if ($parseUnicodeEscape) {\n            $extra = '|u\\{([0-9a-fA-F]+)\\}';\n        }\n\n        return preg_replace_callback(\n            '~\\\\\\\\([\\\\\\\\$nrtfve]|[xX][0-9a-fA-F]{1,2}|[0-7]{1,3}' . $extra . ')~',\n            function ($matches) {\n                $str = $matches[1];\n\n                if (isset(self::$replacements[$str])) {\n                    return self::$replacements[$str];\n                }\n                if ('x' === $str[0] || 'X' === $str[0]) {\n                    return chr(hexdec(substr($str, 1)));\n                }\n                if ('u' === $str[0]) {\n                    $dec = hexdec($matches[2]);\n                    // If it overflowed to float, treat as INT_MAX, it will throw an error anyway.\n                    return self::codePointToUtf8(\\is_int($dec) ? $dec : \\PHP_INT_MAX);\n                } else {\n                    return chr(octdec($str) & 255);\n                }\n            },\n            $str\n        );\n    }\n\n    /**\n     * Converts a Unicode code point to its UTF-8 encoded representation.\n     *\n     * @param int $num Code point\n     *\n     * @return string UTF-8 representation of code point\n     */\n    private static function codePointToUtf8(int $num): string {\n        if ($num <= 0x7F) {\n            return chr($num);\n        }\n        if ($num <= 0x7FF) {\n            return chr(($num >> 6) + 0xC0) . chr(($num & 0x3F) + 0x80);\n        }\n        if ($num <= 0xFFFF) {\n            return chr(($num >> 12) + 0xE0) . chr((($num >> 6) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80);\n        }\n        if ($num <= 0x1FFFFF) {\n            return chr(($num >> 18) + 0xF0) . chr((($num >> 12) & 0x3F) + 0x80)\n                 . chr((($num >> 6) & 0x3F) + 0x80) . chr(($num & 0x3F) + 0x80);\n        }\n        throw new Error('Invalid UTF-8 codepoint escape sequence: Codepoint too large');\n    }\n\n    public function getType(): string {\n        return 'Scalar_String';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Scalar.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nabstract class Scalar extends Expr {\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/StaticVar.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeAbstract;\n\nclass StaticVar extends NodeAbstract {\n    /** @var Expr\\Variable Variable */\n    public Expr\\Variable $var;\n    /** @var null|Node\\Expr Default value */\n    public ?Expr $default;\n\n    /**\n     * Constructs a static variable node.\n     *\n     * @param Expr\\Variable $var Name\n     * @param null|Node\\Expr $default Default value\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(\n        Expr\\Variable $var, ?Node\\Expr $default = null, array $attributes = []\n    ) {\n        $this->attributes = $attributes;\n        $this->var = $var;\n        $this->default = $default;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['var', 'default'];\n    }\n\n    public function getType(): string {\n        return 'StaticVar';\n    }\n}\n\n// @deprecated compatibility alias\nclass_alias(StaticVar::class, Stmt\\StaticVar::class);\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Block.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\Stmt;\n\nclass Block extends Stmt {\n    /** @var Stmt[] Statements */\n    public array $stmts;\n\n    /**\n     * A block of statements.\n     *\n     * @param Stmt[] $stmts Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $stmts, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->stmts = $stmts;\n    }\n\n    public function getType(): string {\n        return 'Stmt_Block';\n    }\n\n    public function getSubNodeNames(): array {\n        return ['stmts'];\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Break_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Break_ extends Node\\Stmt {\n    /** @var null|Node\\Expr Number of loops to break */\n    public ?Node\\Expr $num;\n\n    /**\n     * Constructs a break node.\n     *\n     * @param null|Node\\Expr $num Number of loops to break\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(?Node\\Expr $num = null, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->num = $num;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['num'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Break';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Case_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Case_ extends Node\\Stmt {\n    /** @var null|Node\\Expr Condition (null for default) */\n    public ?Node\\Expr $cond;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n\n    /**\n     * Constructs a case node.\n     *\n     * @param null|Node\\Expr $cond Condition (null for default)\n     * @param Node\\Stmt[] $stmts Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(?Node\\Expr $cond, array $stmts = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->cond = $cond;\n        $this->stmts = $stmts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['cond', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Case';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Catch_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\n\nclass Catch_ extends Node\\Stmt {\n    /** @var Node\\Name[] Types of exceptions to catch */\n    public array $types;\n    /** @var Expr\\Variable|null Variable for exception */\n    public ?Expr\\Variable $var;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n\n    /**\n     * Constructs a catch node.\n     *\n     * @param Node\\Name[] $types Types of exceptions to catch\n     * @param Expr\\Variable|null $var Variable for exception\n     * @param Node\\Stmt[] $stmts Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(\n        array $types, ?Expr\\Variable $var = null, array $stmts = [], array $attributes = []\n    ) {\n        $this->attributes = $attributes;\n        $this->types = $types;\n        $this->var = $var;\n        $this->stmts = $stmts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['types', 'var', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Catch';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/ClassConst.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\n\nclass ClassConst extends Node\\Stmt {\n    /** @var int Modifiers */\n    public int $flags;\n    /** @var Node\\Const_[] Constant declarations */\n    public array $consts;\n    /** @var Node\\AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n    /** @var Node\\Identifier|Node\\Name|Node\\ComplexType|null Type declaration */\n    public ?Node $type;\n\n    /**\n     * Constructs a class const list node.\n     *\n     * @param Node\\Const_[] $consts Constant declarations\n     * @param int $flags Modifiers\n     * @param array<string, mixed> $attributes Additional attributes\n     * @param list<Node\\AttributeGroup> $attrGroups PHP attribute groups\n     * @param null|Node\\Identifier|Node\\Name|Node\\ComplexType $type Type declaration\n     */\n    public function __construct(\n        array $consts,\n        int $flags = 0,\n        array $attributes = [],\n        array $attrGroups = [],\n        ?Node $type = null\n    ) {\n        $this->attributes = $attributes;\n        $this->flags = $flags;\n        $this->consts = $consts;\n        $this->attrGroups = $attrGroups;\n        $this->type = $type;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'flags', 'type', 'consts'];\n    }\n\n    /**\n     * Whether constant is explicitly or implicitly public.\n     */\n    public function isPublic(): bool {\n        return ($this->flags & Modifiers::PUBLIC) !== 0\n            || ($this->flags & Modifiers::VISIBILITY_MASK) === 0;\n    }\n\n    /**\n     * Whether constant is protected.\n     */\n    public function isProtected(): bool {\n        return (bool) ($this->flags & Modifiers::PROTECTED);\n    }\n\n    /**\n     * Whether constant is private.\n     */\n    public function isPrivate(): bool {\n        return (bool) ($this->flags & Modifiers::PRIVATE);\n    }\n\n    /**\n     * Whether constant is final.\n     */\n    public function isFinal(): bool {\n        return (bool) ($this->flags & Modifiers::FINAL);\n    }\n\n    public function getType(): string {\n        return 'Stmt_ClassConst';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/ClassLike.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\PropertyItem;\n\nabstract class ClassLike extends Node\\Stmt {\n    /** @var Node\\Identifier|null Name */\n    public ?Node\\Identifier $name;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n    /** @var Node\\AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n\n    /** @var Node\\Name|null Namespaced name (if using NameResolver) */\n    public ?Node\\Name $namespacedName;\n\n    /**\n     * @return list<TraitUse>\n     */\n    public function getTraitUses(): array {\n        $traitUses = [];\n        foreach ($this->stmts as $stmt) {\n            if ($stmt instanceof TraitUse) {\n                $traitUses[] = $stmt;\n            }\n        }\n        return $traitUses;\n    }\n\n    /**\n     * @return list<ClassConst>\n     */\n    public function getConstants(): array {\n        $constants = [];\n        foreach ($this->stmts as $stmt) {\n            if ($stmt instanceof ClassConst) {\n                $constants[] = $stmt;\n            }\n        }\n        return $constants;\n    }\n\n    /**\n     * @return list<Property>\n     */\n    public function getProperties(): array {\n        $properties = [];\n        foreach ($this->stmts as $stmt) {\n            if ($stmt instanceof Property) {\n                $properties[] = $stmt;\n            }\n        }\n        return $properties;\n    }\n\n    /**\n     * Gets property with the given name defined directly in this class/interface/trait.\n     *\n     * @param string $name Name of the property\n     *\n     * @return Property|null Property node or null if the property does not exist\n     */\n    public function getProperty(string $name): ?Property {\n        foreach ($this->stmts as $stmt) {\n            if ($stmt instanceof Property) {\n                foreach ($stmt->props as $prop) {\n                    if ($prop instanceof PropertyItem && $name === $prop->name->toString()) {\n                        return $stmt;\n                    }\n                }\n            }\n        }\n        return null;\n    }\n\n    /**\n     * Gets all methods defined directly in this class/interface/trait\n     *\n     * @return list<ClassMethod>\n     */\n    public function getMethods(): array {\n        $methods = [];\n        foreach ($this->stmts as $stmt) {\n            if ($stmt instanceof ClassMethod) {\n                $methods[] = $stmt;\n            }\n        }\n        return $methods;\n    }\n\n    /**\n     * Gets method with the given name defined directly in this class/interface/trait.\n     *\n     * @param string $name Name of the method (compared case-insensitively)\n     *\n     * @return ClassMethod|null Method node or null if the method does not exist\n     */\n    public function getMethod(string $name): ?ClassMethod {\n        $lowerName = strtolower($name);\n        foreach ($this->stmts as $stmt) {\n            if ($stmt instanceof ClassMethod && $lowerName === $stmt->name->toLowerString()) {\n                return $stmt;\n            }\n        }\n        return null;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/ClassMethod.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\FunctionLike;\n\nclass ClassMethod extends Node\\Stmt implements FunctionLike {\n    /** @var int Flags */\n    public int $flags;\n    /** @var bool Whether to return by reference */\n    public bool $byRef;\n    /** @var Node\\Identifier Name */\n    public Node\\Identifier $name;\n    /** @var Node\\Param[] Parameters */\n    public array $params;\n    /** @var null|Node\\Identifier|Node\\Name|Node\\ComplexType Return type */\n    public ?Node $returnType;\n    /** @var Node\\Stmt[]|null Statements */\n    public ?array $stmts;\n    /** @var Node\\AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n\n    /** @var array<string, bool> */\n    private static array $magicNames = [\n        '__construct'   => true,\n        '__destruct'    => true,\n        '__call'        => true,\n        '__callstatic'  => true,\n        '__get'         => true,\n        '__set'         => true,\n        '__isset'       => true,\n        '__unset'       => true,\n        '__sleep'       => true,\n        '__wakeup'      => true,\n        '__tostring'    => true,\n        '__set_state'   => true,\n        '__clone'       => true,\n        '__invoke'      => true,\n        '__debuginfo'   => true,\n        '__serialize'   => true,\n        '__unserialize' => true,\n    ];\n\n    /**\n     * Constructs a class method node.\n     *\n     * @param string|Node\\Identifier $name Name\n     * @param array{\n     *     flags?: int,\n     *     byRef?: bool,\n     *     params?: Node\\Param[],\n     *     returnType?: null|Node\\Identifier|Node\\Name|Node\\ComplexType,\n     *     stmts?: Node\\Stmt[]|null,\n     *     attrGroups?: Node\\AttributeGroup[],\n     * } $subNodes Array of the following optional subnodes:\n     *             'flags       => 0              : Flags\n     *             'byRef'      => false          : Whether to return by reference\n     *             'params'     => array()        : Parameters\n     *             'returnType' => null           : Return type\n     *             'stmts'      => array()        : Statements\n     *             'attrGroups' => array()        : PHP attribute groups\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, array $subNodes = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0;\n        $this->byRef = $subNodes['byRef'] ?? false;\n        $this->name = \\is_string($name) ? new Node\\Identifier($name) : $name;\n        $this->params = $subNodes['params'] ?? [];\n        $this->returnType = $subNodes['returnType'] ?? null;\n        $this->stmts = array_key_exists('stmts', $subNodes) ? $subNodes['stmts'] : [];\n        $this->attrGroups = $subNodes['attrGroups'] ?? [];\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'flags', 'byRef', 'name', 'params', 'returnType', 'stmts'];\n    }\n\n    public function returnsByRef(): bool {\n        return $this->byRef;\n    }\n\n    public function getParams(): array {\n        return $this->params;\n    }\n\n    public function getReturnType() {\n        return $this->returnType;\n    }\n\n    public function getStmts(): ?array {\n        return $this->stmts;\n    }\n\n    public function getAttrGroups(): array {\n        return $this->attrGroups;\n    }\n\n    /**\n     * Whether the method is explicitly or implicitly public.\n     */\n    public function isPublic(): bool {\n        return ($this->flags & Modifiers::PUBLIC) !== 0\n            || ($this->flags & Modifiers::VISIBILITY_MASK) === 0;\n    }\n\n    /**\n     * Whether the method is protected.\n     */\n    public function isProtected(): bool {\n        return (bool) ($this->flags & Modifiers::PROTECTED);\n    }\n\n    /**\n     * Whether the method is private.\n     */\n    public function isPrivate(): bool {\n        return (bool) ($this->flags & Modifiers::PRIVATE);\n    }\n\n    /**\n     * Whether the method is abstract.\n     */\n    public function isAbstract(): bool {\n        return (bool) ($this->flags & Modifiers::ABSTRACT);\n    }\n\n    /**\n     * Whether the method is final.\n     */\n    public function isFinal(): bool {\n        return (bool) ($this->flags & Modifiers::FINAL);\n    }\n\n    /**\n     * Whether the method is static.\n     */\n    public function isStatic(): bool {\n        return (bool) ($this->flags & Modifiers::STATIC);\n    }\n\n    /**\n     * Whether the method is magic.\n     */\n    public function isMagic(): bool {\n        return isset(self::$magicNames[$this->name->toLowerString()]);\n    }\n\n    public function getType(): string {\n        return 'Stmt_ClassMethod';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Class_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\n\nclass Class_ extends ClassLike {\n    /** @deprecated Use Modifiers::PUBLIC instead */\n    public const MODIFIER_PUBLIC    =  1;\n    /** @deprecated Use Modifiers::PROTECTED instead */\n    public const MODIFIER_PROTECTED =  2;\n    /** @deprecated Use Modifiers::PRIVATE instead */\n    public const MODIFIER_PRIVATE   =  4;\n    /** @deprecated Use Modifiers::STATIC instead */\n    public const MODIFIER_STATIC    =  8;\n    /** @deprecated Use Modifiers::ABSTRACT instead */\n    public const MODIFIER_ABSTRACT  = 16;\n    /** @deprecated Use Modifiers::FINAL instead */\n    public const MODIFIER_FINAL     = 32;\n    /** @deprecated Use Modifiers::READONLY instead */\n    public const MODIFIER_READONLY  = 64;\n\n    /** @deprecated Use Modifiers::VISIBILITY_MASK instead */\n    public const VISIBILITY_MODIFIER_MASK = 7; // 1 | 2 | 4\n\n    /** @var int Modifiers */\n    public int $flags;\n    /** @var null|Node\\Name Name of extended class */\n    public ?Node\\Name $extends;\n    /** @var Node\\Name[] Names of implemented interfaces */\n    public array $implements;\n\n    /**\n     * Constructs a class node.\n     *\n     * @param string|Node\\Identifier|null $name Name\n     * @param array{\n     *     flags?: int,\n     *     extends?: Node\\Name|null,\n     *     implements?: Node\\Name[],\n     *     stmts?: Node\\Stmt[],\n     *     attrGroups?: Node\\AttributeGroup[],\n     * } $subNodes Array of the following optional subnodes:\n     *             'flags'       => 0      : Flags\n     *             'extends'     => null   : Name of extended class\n     *             'implements'  => array(): Names of implemented interfaces\n     *             'stmts'       => array(): Statements\n     *             'attrGroups'  => array(): PHP attribute groups\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, array $subNodes = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->flags = $subNodes['flags'] ?? $subNodes['type'] ?? 0;\n        $this->name = \\is_string($name) ? new Node\\Identifier($name) : $name;\n        $this->extends = $subNodes['extends'] ?? null;\n        $this->implements = $subNodes['implements'] ?? [];\n        $this->stmts = $subNodes['stmts'] ?? [];\n        $this->attrGroups = $subNodes['attrGroups'] ?? [];\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'flags', 'name', 'extends', 'implements', 'stmts'];\n    }\n\n    /**\n     * Whether the class is explicitly abstract.\n     */\n    public function isAbstract(): bool {\n        return (bool) ($this->flags & Modifiers::ABSTRACT);\n    }\n\n    /**\n     * Whether the class is final.\n     */\n    public function isFinal(): bool {\n        return (bool) ($this->flags & Modifiers::FINAL);\n    }\n\n    public function isReadonly(): bool {\n        return (bool) ($this->flags & Modifiers::READONLY);\n    }\n\n    /**\n     * Whether the class is anonymous.\n     */\n    public function isAnonymous(): bool {\n        return null === $this->name;\n    }\n\n    public function getType(): string {\n        return 'Stmt_Class';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Const_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Const_ extends Node\\Stmt {\n    /** @var Node\\Const_[] Constant declarations */\n    public array $consts;\n    /** @var Node\\AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n\n    /**\n     * Constructs a const list node.\n     *\n     * @param Node\\Const_[] $consts Constant declarations\n     * @param array<string, mixed> $attributes Additional attributes\n     * @param list<Node\\AttributeGroup> $attrGroups PHP attribute groups\n     */\n    public function __construct(\n        array $consts,\n        array $attributes = [],\n        array $attrGroups = []\n    ) {\n        $this->attributes = $attributes;\n        $this->attrGroups = $attrGroups;\n        $this->consts = $consts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'consts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Const';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Continue_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Continue_ extends Node\\Stmt {\n    /** @var null|Node\\Expr Number of loops to continue */\n    public ?Node\\Expr $num;\n\n    /**\n     * Constructs a continue node.\n     *\n     * @param null|Node\\Expr $num Number of loops to continue\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(?Node\\Expr $num = null, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->num = $num;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['num'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Continue';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/DeclareDeclare.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\DeclareItem;\n\nrequire __DIR__ . '/../DeclareItem.php';\n\nif (false) {\n    /**\n     * For classmap-authoritative support.\n     *\n     * @deprecated use \\PhpParser\\Node\\DeclareItem instead.\n     */\n    class DeclareDeclare extends DeclareItem {\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Declare_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\DeclareItem;\n\nclass Declare_ extends Node\\Stmt {\n    /** @var DeclareItem[] List of declares */\n    public array $declares;\n    /** @var Node\\Stmt[]|null Statements */\n    public ?array $stmts;\n\n    /**\n     * Constructs a declare node.\n     *\n     * @param DeclareItem[] $declares List of declares\n     * @param Node\\Stmt[]|null $stmts Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $declares, ?array $stmts = null, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->declares = $declares;\n        $this->stmts = $stmts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['declares', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Declare';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Do_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Do_ extends Node\\Stmt {\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n    /** @var Node\\Expr Condition */\n    public Node\\Expr $cond;\n\n    /**\n     * Constructs a do while node.\n     *\n     * @param Node\\Expr $cond Condition\n     * @param Node\\Stmt[] $stmts Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Expr $cond, array $stmts = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->cond = $cond;\n        $this->stmts = $stmts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['stmts', 'cond'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Do';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Echo_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Echo_ extends Node\\Stmt {\n    /** @var Node\\Expr[] Expressions */\n    public array $exprs;\n\n    /**\n     * Constructs an echo node.\n     *\n     * @param Node\\Expr[] $exprs Expressions\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $exprs, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->exprs = $exprs;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['exprs'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Echo';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/ElseIf_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass ElseIf_ extends Node\\Stmt {\n    /** @var Node\\Expr Condition */\n    public Node\\Expr $cond;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n\n    /**\n     * Constructs an elseif node.\n     *\n     * @param Node\\Expr $cond Condition\n     * @param Node\\Stmt[] $stmts Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Expr $cond, array $stmts = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->cond = $cond;\n        $this->stmts = $stmts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['cond', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_ElseIf';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Else_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Else_ extends Node\\Stmt {\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n\n    /**\n     * Constructs an else node.\n     *\n     * @param Node\\Stmt[] $stmts Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $stmts = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->stmts = $stmts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Else';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/EnumCase.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\AttributeGroup;\n\nclass EnumCase extends Node\\Stmt {\n    /** @var Node\\Identifier Enum case name */\n    public Node\\Identifier $name;\n    /** @var Node\\Expr|null Enum case expression */\n    public ?Node\\Expr $expr;\n    /** @var Node\\AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n\n    /**\n     * @param string|Node\\Identifier $name Enum case name\n     * @param Node\\Expr|null $expr Enum case expression\n     * @param list<AttributeGroup> $attrGroups PHP attribute groups\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, ?Node\\Expr $expr = null, array $attrGroups = [], array $attributes = []) {\n        parent::__construct($attributes);\n        $this->name = \\is_string($name) ? new Node\\Identifier($name) : $name;\n        $this->expr = $expr;\n        $this->attrGroups = $attrGroups;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'name', 'expr'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_EnumCase';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Enum_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Enum_ extends ClassLike {\n    /** @var null|Node\\Identifier Scalar Type */\n    public ?Node $scalarType;\n    /** @var Node\\Name[] Names of implemented interfaces */\n    public array $implements;\n\n    /**\n     * @param string|Node\\Identifier|null $name Name\n     * @param array{\n     *     scalarType?: Node\\Identifier|null,\n     *     implements?: Node\\Name[],\n     *     stmts?: Node\\Stmt[],\n     *     attrGroups?: Node\\AttributeGroup[],\n     * } $subNodes Array of the following optional subnodes:\n     *             'scalarType'  => null    : Scalar type\n     *             'implements'  => array() : Names of implemented interfaces\n     *             'stmts'       => array() : Statements\n     *             'attrGroups'  => array() : PHP attribute groups\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, array $subNodes = [], array $attributes = []) {\n        $this->name = \\is_string($name) ? new Node\\Identifier($name) : $name;\n        $this->scalarType = $subNodes['scalarType'] ?? null;\n        $this->implements = $subNodes['implements'] ?? [];\n        $this->stmts = $subNodes['stmts'] ?? [];\n        $this->attrGroups = $subNodes['attrGroups'] ?? [];\n\n        parent::__construct($attributes);\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'name', 'scalarType', 'implements', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Enum';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Expression.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\n/**\n * Represents statements of type \"expr;\"\n */\nclass Expression extends Node\\Stmt {\n    /** @var Node\\Expr Expression */\n    public Node\\Expr $expr;\n\n    /**\n     * Constructs an expression statement.\n     *\n     * @param Node\\Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Expr $expr, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Expression';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Finally_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Finally_ extends Node\\Stmt {\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n\n    /**\n     * Constructs a finally node.\n     *\n     * @param Node\\Stmt[] $stmts Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $stmts = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->stmts = $stmts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Finally';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/For_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass For_ extends Node\\Stmt {\n    /** @var Node\\Expr[] Init expressions */\n    public array $init;\n    /** @var Node\\Expr[] Loop conditions */\n    public array $cond;\n    /** @var Node\\Expr[] Loop expressions */\n    public array $loop;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n\n    /**\n     * Constructs a for loop node.\n     *\n     * @param array{\n     *     init?: Node\\Expr[],\n     *     cond?: Node\\Expr[],\n     *     loop?: Node\\Expr[],\n     *     stmts?: Node\\Stmt[],\n     * } $subNodes Array of the following optional subnodes:\n     *             'init'  => array(): Init expressions\n     *             'cond'  => array(): Loop conditions\n     *             'loop'  => array(): Loop expressions\n     *             'stmts' => array(): Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $subNodes = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->init = $subNodes['init'] ?? [];\n        $this->cond = $subNodes['cond'] ?? [];\n        $this->loop = $subNodes['loop'] ?? [];\n        $this->stmts = $subNodes['stmts'] ?? [];\n    }\n\n    public function getSubNodeNames(): array {\n        return ['init', 'cond', 'loop', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_For';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Foreach_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Foreach_ extends Node\\Stmt {\n    /** @var Node\\Expr Expression to iterate */\n    public Node\\Expr $expr;\n    /** @var null|Node\\Expr Variable to assign key to */\n    public ?Node\\Expr $keyVar;\n    /** @var bool Whether to assign value by reference */\n    public bool $byRef;\n    /** @var Node\\Expr Variable to assign value to */\n    public Node\\Expr $valueVar;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n\n    /**\n     * Constructs a foreach node.\n     *\n     * @param Node\\Expr $expr Expression to iterate\n     * @param Node\\Expr $valueVar Variable to assign value to\n     * @param array{\n     *     keyVar?: Node\\Expr|null,\n     *     byRef?: bool,\n     *     stmts?: Node\\Stmt[],\n     * } $subNodes Array of the following optional subnodes:\n     *             'keyVar' => null   : Variable to assign key to\n     *             'byRef'  => false  : Whether to assign value by reference\n     *             'stmts'  => array(): Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Expr $expr, Node\\Expr $valueVar, array $subNodes = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n        $this->keyVar = $subNodes['keyVar'] ?? null;\n        $this->byRef = $subNodes['byRef'] ?? false;\n        $this->valueVar = $valueVar;\n        $this->stmts = $subNodes['stmts'] ?? [];\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr', 'keyVar', 'byRef', 'valueVar', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Foreach';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Function_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\FunctionLike;\n\nclass Function_ extends Node\\Stmt implements FunctionLike {\n    /** @var bool Whether function returns by reference */\n    public bool $byRef;\n    /** @var Node\\Identifier Name */\n    public Node\\Identifier $name;\n    /** @var Node\\Param[] Parameters */\n    public array $params;\n    /** @var null|Node\\Identifier|Node\\Name|Node\\ComplexType Return type */\n    public ?Node $returnType;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n    /** @var Node\\AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n\n    /** @var Node\\Name|null Namespaced name (if using NameResolver) */\n    public ?Node\\Name $namespacedName;\n\n    /**\n     * Constructs a function node.\n     *\n     * @param string|Node\\Identifier $name Name\n     * @param array{\n     *     byRef?: bool,\n     *     params?: Node\\Param[],\n     *     returnType?: null|Node\\Identifier|Node\\Name|Node\\ComplexType,\n     *     stmts?: Node\\Stmt[],\n     *     attrGroups?: Node\\AttributeGroup[],\n     * } $subNodes Array of the following optional subnodes:\n     *             'byRef'      => false  : Whether to return by reference\n     *             'params'     => array(): Parameters\n     *             'returnType' => null   : Return type\n     *             'stmts'      => array(): Statements\n     *             'attrGroups' => array(): PHP attribute groups\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, array $subNodes = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->byRef = $subNodes['byRef'] ?? false;\n        $this->name = \\is_string($name) ? new Node\\Identifier($name) : $name;\n        $this->params = $subNodes['params'] ?? [];\n        $this->returnType = $subNodes['returnType'] ?? null;\n        $this->stmts = $subNodes['stmts'] ?? [];\n        $this->attrGroups = $subNodes['attrGroups'] ?? [];\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'byRef', 'name', 'params', 'returnType', 'stmts'];\n    }\n\n    public function returnsByRef(): bool {\n        return $this->byRef;\n    }\n\n    public function getParams(): array {\n        return $this->params;\n    }\n\n    public function getReturnType() {\n        return $this->returnType;\n    }\n\n    public function getAttrGroups(): array {\n        return $this->attrGroups;\n    }\n\n    /** @return Node\\Stmt[] */\n    public function getStmts(): array {\n        return $this->stmts;\n    }\n\n    public function getType(): string {\n        return 'Stmt_Function';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Global_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Global_ extends Node\\Stmt {\n    /** @var Node\\Expr[] Variables */\n    public array $vars;\n\n    /**\n     * Constructs a global variables list node.\n     *\n     * @param Node\\Expr[] $vars Variables to unset\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $vars, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->vars = $vars;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['vars'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Global';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Goto_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Stmt;\n\nclass Goto_ extends Stmt {\n    /** @var Identifier Name of label to jump to */\n    public Identifier $name;\n\n    /**\n     * Constructs a goto node.\n     *\n     * @param string|Identifier $name Name of label to jump to\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = \\is_string($name) ? new Identifier($name) : $name;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Goto';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/GroupUse.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\Node\\UseItem;\n\nclass GroupUse extends Stmt {\n    /**\n     * @var Use_::TYPE_* Type of group use\n     */\n    public int $type;\n    /** @var Name Prefix for uses */\n    public Name $prefix;\n    /** @var UseItem[] Uses */\n    public array $uses;\n\n    /**\n     * Constructs a group use node.\n     *\n     * @param Name $prefix Prefix for uses\n     * @param UseItem[] $uses Uses\n     * @param Use_::TYPE_* $type Type of group use\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Name $prefix, array $uses, int $type = Use_::TYPE_NORMAL, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->type = $type;\n        $this->prefix = $prefix;\n        $this->uses = $uses;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['type', 'prefix', 'uses'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_GroupUse';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/HaltCompiler.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\Stmt;\n\nclass HaltCompiler extends Stmt {\n    /** @var string Remaining text after halt compiler statement. */\n    public string $remaining;\n\n    /**\n     * Constructs a __halt_compiler node.\n     *\n     * @param string $remaining Remaining text after halt compiler statement.\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(string $remaining, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->remaining = $remaining;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['remaining'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_HaltCompiler';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/If_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass If_ extends Node\\Stmt {\n    /** @var Node\\Expr Condition expression */\n    public Node\\Expr $cond;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n    /** @var ElseIf_[] Elseif clauses */\n    public array $elseifs;\n    /** @var null|Else_ Else clause */\n    public ?Else_ $else;\n\n    /**\n     * Constructs an if node.\n     *\n     * @param Node\\Expr $cond Condition\n     * @param array{\n     *     stmts?: Node\\Stmt[],\n     *     elseifs?: ElseIf_[],\n     *     else?: Else_|null,\n     * } $subNodes Array of the following optional subnodes:\n     *             'stmts'   => array(): Statements\n     *             'elseifs' => array(): Elseif clauses\n     *             'else'    => null   : Else clause\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Expr $cond, array $subNodes = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->cond = $cond;\n        $this->stmts = $subNodes['stmts'] ?? [];\n        $this->elseifs = $subNodes['elseifs'] ?? [];\n        $this->else = $subNodes['else'] ?? null;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['cond', 'stmts', 'elseifs', 'else'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_If';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/InlineHTML.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\Stmt;\n\nclass InlineHTML extends Stmt {\n    /** @var string String */\n    public string $value;\n\n    /**\n     * Constructs an inline HTML node.\n     *\n     * @param string $value String\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(string $value, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->value = $value;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['value'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_InlineHTML';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Interface_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Interface_ extends ClassLike {\n    /** @var Node\\Name[] Extended interfaces */\n    public array $extends;\n\n    /**\n     * Constructs a class node.\n     *\n     * @param string|Node\\Identifier $name Name\n     * @param array{\n     *     extends?: Node\\Name[],\n     *     stmts?: Node\\Stmt[],\n     *     attrGroups?: Node\\AttributeGroup[],\n     * } $subNodes Array of the following optional subnodes:\n     *             'extends'    => array(): Name of extended interfaces\n     *             'stmts'      => array(): Statements\n     *             'attrGroups' => array(): PHP attribute groups\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, array $subNodes = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = \\is_string($name) ? new Node\\Identifier($name) : $name;\n        $this->extends = $subNodes['extends'] ?? [];\n        $this->stmts = $subNodes['stmts'] ?? [];\n        $this->attrGroups = $subNodes['attrGroups'] ?? [];\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'name', 'extends', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Interface';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Label.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Stmt;\n\nclass Label extends Stmt {\n    /** @var Identifier Name */\n    public Identifier $name;\n\n    /**\n     * Constructs a label node.\n     *\n     * @param string|Identifier $name Name\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = \\is_string($name) ? new Identifier($name) : $name;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Label';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Namespace_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Namespace_ extends Node\\Stmt {\n    /* For use in the \"kind\" attribute */\n    public const KIND_SEMICOLON = 1;\n    public const KIND_BRACED = 2;\n\n    /** @var null|Node\\Name Name */\n    public ?Node\\Name $name;\n    /** @var Node\\Stmt[] Statements */\n    public $stmts;\n\n    /**\n     * Constructs a namespace node.\n     *\n     * @param null|Node\\Name $name Name\n     * @param null|Node\\Stmt[] $stmts Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(?Node\\Name $name = null, ?array $stmts = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = $name;\n        $this->stmts = $stmts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['name', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Namespace';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Nop.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\n/** Nop/empty statement (;). */\nclass Nop extends Node\\Stmt {\n    public function getSubNodeNames(): array {\n        return [];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Nop';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Property.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\ComplexType;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\PropertyItem;\n\nclass Property extends Node\\Stmt {\n    /** @var int Modifiers */\n    public int $flags;\n    /** @var PropertyItem[] Properties */\n    public array $props;\n    /** @var null|Identifier|Name|ComplexType Type declaration */\n    public ?Node $type;\n    /** @var Node\\AttributeGroup[] PHP attribute groups */\n    public array $attrGroups;\n    /** @var Node\\PropertyHook[] Property hooks */\n    public array $hooks;\n\n    /**\n     * Constructs a class property list node.\n     *\n     * @param int $flags Modifiers\n     * @param PropertyItem[] $props Properties\n     * @param array<string, mixed> $attributes Additional attributes\n     * @param null|Identifier|Name|ComplexType $type Type declaration\n     * @param Node\\AttributeGroup[] $attrGroups PHP attribute groups\n     * @param Node\\PropertyHook[] $hooks Property hooks\n     */\n    public function __construct(int $flags, array $props, array $attributes = [], ?Node $type = null, array $attrGroups = [], array $hooks = []) {\n        $this->attributes = $attributes;\n        $this->flags = $flags;\n        $this->props = $props;\n        $this->type = $type;\n        $this->attrGroups = $attrGroups;\n        $this->hooks = $hooks;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'flags', 'type', 'props', 'hooks'];\n    }\n\n    /**\n     * Whether the property is explicitly or implicitly public.\n     */\n    public function isPublic(): bool {\n        return ($this->flags & Modifiers::PUBLIC) !== 0\n            || ($this->flags & Modifiers::VISIBILITY_MASK) === 0;\n    }\n\n    /**\n     * Whether the property is protected.\n     */\n    public function isProtected(): bool {\n        return (bool) ($this->flags & Modifiers::PROTECTED);\n    }\n\n    /**\n     * Whether the property is private.\n     */\n    public function isPrivate(): bool {\n        return (bool) ($this->flags & Modifiers::PRIVATE);\n    }\n\n    /**\n     * Whether the property is static.\n     */\n    public function isStatic(): bool {\n        return (bool) ($this->flags & Modifiers::STATIC);\n    }\n\n    /**\n     * Whether the property is readonly.\n     */\n    public function isReadonly(): bool {\n        return (bool) ($this->flags & Modifiers::READONLY);\n    }\n\n    /**\n     * Whether the property is abstract.\n     */\n    public function isAbstract(): bool {\n        return (bool) ($this->flags & Modifiers::ABSTRACT);\n    }\n\n    /**\n     * Whether the property is final.\n     */\n    public function isFinal(): bool {\n        return (bool) ($this->flags & Modifiers::FINAL);\n    }\n\n    /**\n     * Whether the property has explicit public(set) visibility.\n     */\n    public function isPublicSet(): bool {\n        return (bool) ($this->flags & Modifiers::PUBLIC_SET);\n    }\n\n    /**\n     * Whether the property has explicit protected(set) visibility.\n     */\n    public function isProtectedSet(): bool {\n        return (bool) ($this->flags & Modifiers::PROTECTED_SET);\n    }\n\n    /**\n     * Whether the property has explicit private(set) visibility.\n     */\n    public function isPrivateSet(): bool {\n        return (bool) ($this->flags & Modifiers::PRIVATE_SET);\n    }\n\n    public function getType(): string {\n        return 'Stmt_Property';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/PropertyProperty.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\PropertyItem;\n\nrequire __DIR__ . '/../PropertyItem.php';\n\nif (false) {\n    /**\n     * For classmap-authoritative support.\n     *\n     * @deprecated use \\PhpParser\\Node\\PropertyItem instead.\n     */\n    class PropertyProperty extends PropertyItem {\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Return_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Return_ extends Node\\Stmt {\n    /** @var null|Node\\Expr Expression */\n    public ?Node\\Expr $expr;\n\n    /**\n     * Constructs a return node.\n     *\n     * @param null|Node\\Expr $expr Expression\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(?Node\\Expr $expr = null, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->expr = $expr;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['expr'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Return';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/StaticVar.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nrequire __DIR__ . '/../StaticVar.php';\n\nif (false) {\n    /**\n     * For classmap-authoritative support.\n     *\n     * @deprecated use \\PhpParser\\Node\\StaticVar instead.\n     */\n    class StaticVar extends \\PhpParser\\Node\\StaticVar {\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Static_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\StaticVar;\nuse PhpParser\\Node\\Stmt;\n\nclass Static_ extends Stmt {\n    /** @var StaticVar[] Variable definitions */\n    public array $vars;\n\n    /**\n     * Constructs a static variables list node.\n     *\n     * @param StaticVar[] $vars Variable definitions\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $vars, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->vars = $vars;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['vars'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Static';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Switch_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Switch_ extends Node\\Stmt {\n    /** @var Node\\Expr Condition */\n    public Node\\Expr $cond;\n    /** @var Case_[] Case list */\n    public array $cases;\n\n    /**\n     * Constructs a case node.\n     *\n     * @param Node\\Expr $cond Condition\n     * @param Case_[] $cases Case list\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Expr $cond, array $cases, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->cond = $cond;\n        $this->cases = $cases;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['cond', 'cases'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Switch';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/TraitUse.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass TraitUse extends Node\\Stmt {\n    /** @var Node\\Name[] Traits */\n    public array $traits;\n    /** @var TraitUseAdaptation[] Adaptations */\n    public array $adaptations;\n\n    /**\n     * Constructs a trait use node.\n     *\n     * @param Node\\Name[] $traits Traits\n     * @param TraitUseAdaptation[] $adaptations Adaptations\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $traits, array $adaptations = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->traits = $traits;\n        $this->adaptations = $adaptations;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['traits', 'adaptations'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_TraitUse';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/TraitUseAdaptation/Alias.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt\\TraitUseAdaptation;\n\nuse PhpParser\\Node;\n\nclass Alias extends Node\\Stmt\\TraitUseAdaptation {\n    /** @var null|int New modifier */\n    public ?int $newModifier;\n    /** @var null|Node\\Identifier New name */\n    public ?Node\\Identifier $newName;\n\n    /**\n     * Constructs a trait use precedence adaptation node.\n     *\n     * @param null|Node\\Name $trait Trait name\n     * @param string|Node\\Identifier $method Method name\n     * @param null|int $newModifier New modifier\n     * @param null|string|Node\\Identifier $newName New name\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(?Node\\Name $trait, $method, ?int $newModifier, $newName, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->trait = $trait;\n        $this->method = \\is_string($method) ? new Node\\Identifier($method) : $method;\n        $this->newModifier = $newModifier;\n        $this->newName = \\is_string($newName) ? new Node\\Identifier($newName) : $newName;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['trait', 'method', 'newModifier', 'newName'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_TraitUseAdaptation_Alias';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/TraitUseAdaptation/Precedence.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt\\TraitUseAdaptation;\n\nuse PhpParser\\Node;\n\nclass Precedence extends Node\\Stmt\\TraitUseAdaptation {\n    /** @var Node\\Name[] Overwritten traits */\n    public array $insteadof;\n\n    /**\n     * Constructs a trait use precedence adaptation node.\n     *\n     * @param Node\\Name $trait Trait name\n     * @param string|Node\\Identifier $method Method name\n     * @param Node\\Name[] $insteadof Overwritten traits\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Name $trait, $method, array $insteadof, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->trait = $trait;\n        $this->method = \\is_string($method) ? new Node\\Identifier($method) : $method;\n        $this->insteadof = $insteadof;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['trait', 'method', 'insteadof'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_TraitUseAdaptation_Precedence';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/TraitUseAdaptation.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nabstract class TraitUseAdaptation extends Node\\Stmt {\n    /** @var Node\\Name|null Trait name */\n    public ?Node\\Name $trait;\n    /** @var Node\\Identifier Method name */\n    public Node\\Identifier $method;\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Trait_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Trait_ extends ClassLike {\n    /**\n     * Constructs a trait node.\n     *\n     * @param string|Node\\Identifier $name Name\n     * @param array{\n     *     stmts?: Node\\Stmt[],\n     *     attrGroups?: Node\\AttributeGroup[],\n     * } $subNodes Array of the following optional subnodes:\n     *             'stmts'      => array(): Statements\n     *             'attrGroups' => array(): PHP attribute groups\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct($name, array $subNodes = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->name = \\is_string($name) ? new Node\\Identifier($name) : $name;\n        $this->stmts = $subNodes['stmts'] ?? [];\n        $this->attrGroups = $subNodes['attrGroups'] ?? [];\n    }\n\n    public function getSubNodeNames(): array {\n        return ['attrGroups', 'name', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Trait';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/TryCatch.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass TryCatch extends Node\\Stmt {\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n    /** @var Catch_[] Catches */\n    public array $catches;\n    /** @var null|Finally_ Optional finally node */\n    public ?Finally_ $finally;\n\n    /**\n     * Constructs a try catch node.\n     *\n     * @param Node\\Stmt[] $stmts Statements\n     * @param Catch_[] $catches Catches\n     * @param null|Finally_ $finally Optional finally node\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $stmts, array $catches, ?Finally_ $finally = null, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->stmts = $stmts;\n        $this->catches = $catches;\n        $this->finally = $finally;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['stmts', 'catches', 'finally'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_TryCatch';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Unset_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass Unset_ extends Node\\Stmt {\n    /** @var Node\\Expr[] Variables to unset */\n    public array $vars;\n\n    /**\n     * Constructs an unset node.\n     *\n     * @param Node\\Expr[] $vars Variables to unset\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $vars, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->vars = $vars;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['vars'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Unset';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/UseUse.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\UseItem;\n\nrequire __DIR__ . '/../UseItem.php';\n\nif (false) {\n    /**\n     * For classmap-authoritative support.\n     *\n     * @deprecated use \\PhpParser\\Node\\UseItem instead.\n     */\n    class UseUse extends UseItem {\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/Use_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\Node\\UseItem;\n\nclass Use_ extends Stmt {\n    /**\n     * Unknown type. Both Stmt\\Use_ / Stmt\\GroupUse and Stmt\\UseUse have a $type property, one of them will always be\n     * TYPE_UNKNOWN while the other has one of the three other possible types. For normal use statements the type on the\n     * Stmt\\UseUse is unknown. It's only the other way around for mixed group use declarations.\n     */\n    public const TYPE_UNKNOWN = 0;\n    /** Class or namespace import */\n    public const TYPE_NORMAL = 1;\n    /** Function import */\n    public const TYPE_FUNCTION = 2;\n    /** Constant import */\n    public const TYPE_CONSTANT = 3;\n\n    /** @var self::TYPE_* Type of alias */\n    public int $type;\n    /** @var UseItem[] Aliases */\n    public array $uses;\n\n    /**\n     * Constructs an alias (use) list node.\n     *\n     * @param UseItem[] $uses Aliases\n     * @param Stmt\\Use_::TYPE_* $type Type of alias\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $uses, int $type = self::TYPE_NORMAL, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->type = $type;\n        $this->uses = $uses;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['type', 'uses'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_Use';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt/While_.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\n\nclass While_ extends Node\\Stmt {\n    /** @var Node\\Expr Condition */\n    public Node\\Expr $cond;\n    /** @var Node\\Stmt[] Statements */\n    public array $stmts;\n\n    /**\n     * Constructs a while node.\n     *\n     * @param Node\\Expr $cond Condition\n     * @param Node\\Stmt[] $stmts Statements\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Expr $cond, array $stmts = [], array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->cond = $cond;\n        $this->stmts = $stmts;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['cond', 'stmts'];\n    }\n\n    public function getType(): string {\n        return 'Stmt_While';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/Stmt.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\nabstract class Stmt extends NodeAbstract {\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/UnionType.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nclass UnionType extends ComplexType {\n    /** @var (Identifier|Name|IntersectionType)[] Types */\n    public array $types;\n\n    /**\n     * Constructs a union type.\n     *\n     * @param (Identifier|Name|IntersectionType)[] $types Types\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $types, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->types = $types;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['types'];\n    }\n\n    public function getType(): string {\n        return 'UnionType';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/UseItem.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeAbstract;\nuse PhpParser\\Node\\Stmt\\Use_;\n\nclass UseItem extends NodeAbstract {\n    /**\n     * @var Use_::TYPE_* One of the Stmt\\Use_::TYPE_* constants. Will only differ from TYPE_UNKNOWN for mixed group uses\n     */\n    public int $type;\n    /** @var Node\\Name Namespace, class, function or constant to alias */\n    public Name $name;\n    /** @var Identifier|null Alias */\n    public ?Identifier $alias;\n\n    /**\n     * Constructs an alias (use) item node.\n     *\n     * @param Node\\Name $name Namespace/Class to alias\n     * @param null|string|Identifier $alias Alias\n     * @param Use_::TYPE_* $type Type of the use element (for mixed group use only)\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(Node\\Name $name, $alias = null, int $type = Use_::TYPE_UNKNOWN, array $attributes = []) {\n        $this->attributes = $attributes;\n        $this->type = $type;\n        $this->name = $name;\n        $this->alias = \\is_string($alias) ? new Identifier($alias) : $alias;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['type', 'name', 'alias'];\n    }\n\n    /**\n     * Get alias. If not explicitly given this is the last component of the used name.\n     */\n    public function getAlias(): Identifier {\n        if (null !== $this->alias) {\n            return $this->alias;\n        }\n\n        return new Identifier($this->name->getLast());\n    }\n\n    public function getType(): string {\n        return 'UseItem';\n    }\n}\n\n// @deprecated compatibility alias\nclass_alias(UseItem::class, Stmt\\UseUse::class);\n"
  },
  {
    "path": "lib/PhpParser/Node/VarLikeIdentifier.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\n/**\n * Represents a name that is written in source code with a leading dollar,\n * but is not a proper variable. The leading dollar is not stored as part of the name.\n *\n * Examples: Names in property declarations are formatted as variables. Names in static property\n * lookups are also formatted as variables.\n */\nclass VarLikeIdentifier extends Identifier {\n    public function getType(): string {\n        return 'VarLikeIdentifier';\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node/VariadicPlaceholder.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\NodeAbstract;\n\n/**\n * Represents the \"...\" in \"foo(...)\" of the first-class callable syntax.\n */\nclass VariadicPlaceholder extends NodeAbstract {\n    /**\n     * Create a variadic argument placeholder (first-class callable syntax).\n     *\n     * @param array<string, mixed> $attributes Additional attributes\n     */\n    public function __construct(array $attributes = []) {\n        $this->attributes = $attributes;\n    }\n\n    public function getType(): string {\n        return 'VariadicPlaceholder';\n    }\n\n    public function getSubNodeNames(): array {\n        return [];\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Node.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\ninterface Node {\n    /**\n     * Gets the type of the node.\n     *\n     * @psalm-return non-empty-string\n     * @return string Type of the node\n     */\n    public function getType(): string;\n\n    /**\n     * Gets the names of the sub nodes.\n     *\n     * @return string[] Names of sub nodes\n     */\n    public function getSubNodeNames(): array;\n\n    /**\n     * Gets line the node started in (alias of getStartLine).\n     *\n     * @return int Start line (or -1 if not available)\n     * @phpstan-return -1|positive-int\n     *\n     * @deprecated Use getStartLine() instead\n     */\n    public function getLine(): int;\n\n    /**\n     * Gets line the node started in.\n     *\n     * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default).\n     *\n     * @return int Start line (or -1 if not available)\n     * @phpstan-return -1|positive-int\n     */\n    public function getStartLine(): int;\n\n    /**\n     * Gets the line the node ended in.\n     *\n     * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default).\n     *\n     * @return int End line (or -1 if not available)\n     * @phpstan-return -1|positive-int\n     */\n    public function getEndLine(): int;\n\n    /**\n     * Gets the token offset of the first token that is part of this node.\n     *\n     * The offset is an index into the array returned by Lexer::getTokens().\n     *\n     * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default).\n     *\n     * @return int Token start position (or -1 if not available)\n     */\n    public function getStartTokenPos(): int;\n\n    /**\n     * Gets the token offset of the last token that is part of this node.\n     *\n     * The offset is an index into the array returned by Lexer::getTokens().\n     *\n     * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default).\n     *\n     * @return int Token end position (or -1 if not available)\n     */\n    public function getEndTokenPos(): int;\n\n    /**\n     * Gets the file offset of the first character that is part of this node.\n     *\n     * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default).\n     *\n     * @return int File start position (or -1 if not available)\n     */\n    public function getStartFilePos(): int;\n\n    /**\n     * Gets the file offset of the last character that is part of this node.\n     *\n     * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default).\n     *\n     * @return int File end position (or -1 if not available)\n     */\n    public function getEndFilePos(): int;\n\n    /**\n     * Gets all comments directly preceding this node.\n     *\n     * The comments are also available through the \"comments\" attribute.\n     *\n     * @return Comment[]\n     */\n    public function getComments(): array;\n\n    /**\n     * Gets the doc comment of the node.\n     *\n     * @return null|Comment\\Doc Doc comment object or null\n     */\n    public function getDocComment(): ?Comment\\Doc;\n\n    /**\n     * Sets the doc comment of the node.\n     *\n     * This will either replace an existing doc comment or add it to the comments array.\n     *\n     * @param Comment\\Doc $docComment Doc comment to set\n     */\n    public function setDocComment(Comment\\Doc $docComment): void;\n\n    /**\n     * Sets an attribute on a node.\n     *\n     * @param mixed $value\n     */\n    public function setAttribute(string $key, $value): void;\n\n    /**\n     * Returns whether an attribute exists.\n     */\n    public function hasAttribute(string $key): bool;\n\n    /**\n     * Returns the value of an attribute.\n     *\n     * @param mixed $default\n     *\n     * @return mixed\n     */\n    public function getAttribute(string $key, $default = null);\n\n    /**\n     * Returns all the attributes of this node.\n     *\n     * @return array<string, mixed>\n     */\n    public function getAttributes(): array;\n\n    /**\n     * Replaces all the attributes of this node.\n     *\n     * @param array<string, mixed> $attributes\n     */\n    public function setAttributes(array $attributes): void;\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeAbstract.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nabstract class NodeAbstract implements Node, \\JsonSerializable {\n    /** @var array<string, mixed> Attributes */\n    protected array $attributes;\n\n    /**\n     * Creates a Node.\n     *\n     * @param array<string, mixed> $attributes Array of attributes\n     */\n    public function __construct(array $attributes = []) {\n        $this->attributes = $attributes;\n    }\n\n    /**\n     * Gets line the node started in (alias of getStartLine).\n     *\n     * @return int Start line (or -1 if not available)\n     * @phpstan-return -1|positive-int\n     */\n    public function getLine(): int {\n        return $this->attributes['startLine'] ?? -1;\n    }\n\n    /**\n     * Gets line the node started in.\n     *\n     * Requires the 'startLine' attribute to be enabled in the lexer (enabled by default).\n     *\n     * @return int Start line (or -1 if not available)\n     * @phpstan-return -1|positive-int\n     */\n    public function getStartLine(): int {\n        return $this->attributes['startLine'] ?? -1;\n    }\n\n    /**\n     * Gets the line the node ended in.\n     *\n     * Requires the 'endLine' attribute to be enabled in the lexer (enabled by default).\n     *\n     * @return int End line (or -1 if not available)\n     * @phpstan-return -1|positive-int\n     */\n    public function getEndLine(): int {\n        return $this->attributes['endLine'] ?? -1;\n    }\n\n    /**\n     * Gets the token offset of the first token that is part of this node.\n     *\n     * The offset is an index into the array returned by Lexer::getTokens().\n     *\n     * Requires the 'startTokenPos' attribute to be enabled in the lexer (DISABLED by default).\n     *\n     * @return int Token start position (or -1 if not available)\n     */\n    public function getStartTokenPos(): int {\n        return $this->attributes['startTokenPos'] ?? -1;\n    }\n\n    /**\n     * Gets the token offset of the last token that is part of this node.\n     *\n     * The offset is an index into the array returned by Lexer::getTokens().\n     *\n     * Requires the 'endTokenPos' attribute to be enabled in the lexer (DISABLED by default).\n     *\n     * @return int Token end position (or -1 if not available)\n     */\n    public function getEndTokenPos(): int {\n        return $this->attributes['endTokenPos'] ?? -1;\n    }\n\n    /**\n     * Gets the file offset of the first character that is part of this node.\n     *\n     * Requires the 'startFilePos' attribute to be enabled in the lexer (DISABLED by default).\n     *\n     * @return int File start position (or -1 if not available)\n     */\n    public function getStartFilePos(): int {\n        return $this->attributes['startFilePos'] ?? -1;\n    }\n\n    /**\n     * Gets the file offset of the last character that is part of this node.\n     *\n     * Requires the 'endFilePos' attribute to be enabled in the lexer (DISABLED by default).\n     *\n     * @return int File end position (or -1 if not available)\n     */\n    public function getEndFilePos(): int {\n        return $this->attributes['endFilePos'] ?? -1;\n    }\n\n    /**\n     * Gets all comments directly preceding this node.\n     *\n     * The comments are also available through the \"comments\" attribute.\n     *\n     * @return Comment[]\n     */\n    public function getComments(): array {\n        return $this->attributes['comments'] ?? [];\n    }\n\n    /**\n     * Gets the doc comment of the node.\n     *\n     * @return null|Comment\\Doc Doc comment object or null\n     */\n    public function getDocComment(): ?Comment\\Doc {\n        $comments = $this->getComments();\n        for ($i = count($comments) - 1; $i >= 0; $i--) {\n            $comment = $comments[$i];\n            if ($comment instanceof Comment\\Doc) {\n                return $comment;\n            }\n        }\n\n        return null;\n    }\n\n    /**\n     * Sets the doc comment of the node.\n     *\n     * This will either replace an existing doc comment or add it to the comments array.\n     *\n     * @param Comment\\Doc $docComment Doc comment to set\n     */\n    public function setDocComment(Comment\\Doc $docComment): void {\n        $comments = $this->getComments();\n        for ($i = count($comments) - 1; $i >= 0; $i--) {\n            if ($comments[$i] instanceof Comment\\Doc) {\n                // Replace existing doc comment.\n                $comments[$i] = $docComment;\n                $this->setAttribute('comments', $comments);\n                return;\n            }\n        }\n\n        // Append new doc comment.\n        $comments[] = $docComment;\n        $this->setAttribute('comments', $comments);\n    }\n\n    public function setAttribute(string $key, $value): void {\n        $this->attributes[$key] = $value;\n    }\n\n    public function hasAttribute(string $key): bool {\n        return array_key_exists($key, $this->attributes);\n    }\n\n    public function getAttribute(string $key, $default = null) {\n        if (array_key_exists($key, $this->attributes)) {\n            return $this->attributes[$key];\n        }\n\n        return $default;\n    }\n\n    public function getAttributes(): array {\n        return $this->attributes;\n    }\n\n    public function setAttributes(array $attributes): void {\n        $this->attributes = $attributes;\n    }\n\n    /**\n     * @return array<string, mixed>\n     */\n    public function jsonSerialize(): array {\n        return ['nodeType' => $this->getType()] + get_object_vars($this);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeDumper.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Expr\\Array_;\nuse PhpParser\\Node\\Expr\\Include_;\nuse PhpParser\\Node\\Expr\\List_;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Scalar\\InterpolatedString;\nuse PhpParser\\Node\\Scalar\\String_;\nuse PhpParser\\Node\\Stmt\\GroupUse;\nuse PhpParser\\Node\\Stmt\\Use_;\nuse PhpParser\\Node\\UseItem;\n\nclass NodeDumper {\n    private bool $dumpComments;\n    private bool $dumpPositions;\n    private bool $dumpOtherAttributes;\n    private ?string $code;\n    private string $res;\n    private string $nl;\n\n    private const IGNORE_ATTRIBUTES = [\n        'comments' => true,\n        'startLine' => true,\n        'endLine' => true,\n        'startFilePos' => true,\n        'endFilePos' => true,\n        'startTokenPos' => true,\n        'endTokenPos' => true,\n    ];\n\n    /**\n     * Constructs a NodeDumper.\n     *\n     * Supported options:\n     *  * bool dumpComments: Whether comments should be dumped.\n     *  * bool dumpPositions: Whether line/offset information should be dumped. To dump offset\n     *                        information, the code needs to be passed to dump().\n     *  * bool dumpOtherAttributes: Whether non-comment, non-position attributes should be dumped.\n     *\n     * @param array $options Options (see description)\n     */\n    public function __construct(array $options = []) {\n        $this->dumpComments = !empty($options['dumpComments']);\n        $this->dumpPositions = !empty($options['dumpPositions']);\n        $this->dumpOtherAttributes = !empty($options['dumpOtherAttributes']);\n    }\n\n    /**\n     * Dumps a node or array.\n     *\n     * @param array|Node $node Node or array to dump\n     * @param string|null $code Code corresponding to dumped AST. This only needs to be passed if\n     *                          the dumpPositions option is enabled and the dumping of node offsets\n     *                          is desired.\n     *\n     * @return string Dumped value\n     */\n    public function dump($node, ?string $code = null): string {\n        $this->code = $code;\n        $this->res = '';\n        $this->nl = \"\\n\";\n        $this->dumpRecursive($node, false);\n        return $this->res;\n    }\n\n    /** @param mixed $node */\n    protected function dumpRecursive($node, bool $indent = true): void {\n        if ($indent) {\n            $this->nl .= \"    \";\n        }\n        if ($node instanceof Node) {\n            $this->res .= $node->getType();\n            if ($this->dumpPositions && null !== $p = $this->dumpPosition($node)) {\n                $this->res .= $p;\n            }\n            $this->res .= '(';\n\n            foreach ($node->getSubNodeNames() as $key) {\n                $this->res .= \"$this->nl    \" . $key . ': ';\n\n                $value = $node->$key;\n                if (\\is_int($value)) {\n                    if ('flags' === $key || 'newModifier' === $key) {\n                        $this->res .= $this->dumpFlags($value);\n                        continue;\n                    }\n                    if ('type' === $key && $node instanceof Include_) {\n                        $this->res .= $this->dumpIncludeType($value);\n                        continue;\n                    }\n                    if ('type' === $key\n                            && ($node instanceof Use_ || $node instanceof UseItem || $node instanceof GroupUse)) {\n                        $this->res .= $this->dumpUseType($value);\n                        continue;\n                    }\n                }\n                $this->dumpRecursive($value);\n            }\n\n            if ($this->dumpComments && $comments = $node->getComments()) {\n                $this->res .= \"$this->nl    comments: \";\n                $this->dumpRecursive($comments);\n            }\n\n            if ($this->dumpOtherAttributes) {\n                foreach ($node->getAttributes() as $key => $value) {\n                    if (isset(self::IGNORE_ATTRIBUTES[$key])) {\n                        continue;\n                    }\n\n                    $this->res .= \"$this->nl    $key: \";\n                    if (\\is_int($value)) {\n                        if ('kind' === $key) {\n                            if ($node instanceof Int_) {\n                                $this->res .= $this->dumpIntKind($value);\n                                continue;\n                            }\n                            if ($node instanceof String_ || $node instanceof InterpolatedString) {\n                                $this->res .= $this->dumpStringKind($value);\n                                continue;\n                            }\n                            if ($node instanceof Array_) {\n                                $this->res .= $this->dumpArrayKind($value);\n                                continue;\n                            }\n                            if ($node instanceof List_) {\n                                $this->res .= $this->dumpListKind($value);\n                                continue;\n                            }\n                        }\n                    }\n                    $this->dumpRecursive($value);\n                }\n            }\n            $this->res .= \"$this->nl)\";\n        } elseif (\\is_array($node)) {\n            $this->res .= 'array(';\n            foreach ($node as $key => $value) {\n                $this->res .= \"$this->nl    \" . $key . ': ';\n                $this->dumpRecursive($value);\n            }\n            $this->res .= \"$this->nl)\";\n        } elseif ($node instanceof Comment) {\n            $this->res .= \\str_replace(\"\\n\", $this->nl, $node->getReformattedText());\n        } elseif (\\is_string($node)) {\n            $this->res .= \\str_replace(\"\\n\", $this->nl, $node);\n        } elseif (\\is_int($node) || \\is_float($node)) {\n            $this->res .= $node;\n        } elseif (null === $node) {\n            $this->res .= 'null';\n        } elseif (false === $node) {\n            $this->res .= 'false';\n        } elseif (true === $node) {\n            $this->res .= 'true';\n        } else {\n            throw new \\InvalidArgumentException('Can only dump nodes and arrays.');\n        }\n        if ($indent) {\n            $this->nl = \\substr($this->nl, 0, -4);\n        }\n    }\n\n    protected function dumpFlags(int $flags): string {\n        $strs = [];\n        if ($flags & Modifiers::PUBLIC) {\n            $strs[] = 'PUBLIC';\n        }\n        if ($flags & Modifiers::PROTECTED) {\n            $strs[] = 'PROTECTED';\n        }\n        if ($flags & Modifiers::PRIVATE) {\n            $strs[] = 'PRIVATE';\n        }\n        if ($flags & Modifiers::ABSTRACT) {\n            $strs[] = 'ABSTRACT';\n        }\n        if ($flags & Modifiers::STATIC) {\n            $strs[] = 'STATIC';\n        }\n        if ($flags & Modifiers::FINAL) {\n            $strs[] = 'FINAL';\n        }\n        if ($flags & Modifiers::READONLY) {\n            $strs[] = 'READONLY';\n        }\n        if ($flags & Modifiers::PUBLIC_SET) {\n            $strs[] = 'PUBLIC_SET';\n        }\n        if ($flags & Modifiers::PROTECTED_SET) {\n            $strs[] = 'PROTECTED_SET';\n        }\n        if ($flags & Modifiers::PRIVATE_SET) {\n            $strs[] = 'PRIVATE_SET';\n        }\n\n        if ($strs) {\n            return implode(' | ', $strs) . ' (' . $flags . ')';\n        } else {\n            return (string) $flags;\n        }\n    }\n\n    /** @param array<int, string> $map */\n    private function dumpEnum(int $value, array $map): string {\n        if (!isset($map[$value])) {\n            return (string) $value;\n        }\n        return $map[$value] . ' (' . $value . ')';\n    }\n\n    private function dumpIncludeType(int $type): string {\n        return $this->dumpEnum($type, [\n            Include_::TYPE_INCLUDE      => 'TYPE_INCLUDE',\n            Include_::TYPE_INCLUDE_ONCE => 'TYPE_INCLUDE_ONCE',\n            Include_::TYPE_REQUIRE      => 'TYPE_REQUIRE',\n            Include_::TYPE_REQUIRE_ONCE => 'TYPE_REQUIRE_ONCE',\n        ]);\n    }\n\n    private function dumpUseType(int $type): string {\n        return $this->dumpEnum($type, [\n            Use_::TYPE_UNKNOWN  => 'TYPE_UNKNOWN',\n            Use_::TYPE_NORMAL   => 'TYPE_NORMAL',\n            Use_::TYPE_FUNCTION => 'TYPE_FUNCTION',\n            Use_::TYPE_CONSTANT => 'TYPE_CONSTANT',\n        ]);\n    }\n\n    private function dumpIntKind(int $kind): string {\n        return $this->dumpEnum($kind, [\n            Int_::KIND_BIN => 'KIND_BIN',\n            Int_::KIND_OCT => 'KIND_OCT',\n            Int_::KIND_DEC => 'KIND_DEC',\n            Int_::KIND_HEX => 'KIND_HEX',\n        ]);\n    }\n\n    private function dumpStringKind(int $kind): string {\n        return $this->dumpEnum($kind, [\n            String_::KIND_SINGLE_QUOTED => 'KIND_SINGLE_QUOTED',\n            String_::KIND_DOUBLE_QUOTED => 'KIND_DOUBLE_QUOTED',\n            String_::KIND_HEREDOC => 'KIND_HEREDOC',\n            String_::KIND_NOWDOC => 'KIND_NOWDOC',\n        ]);\n    }\n\n    private function dumpArrayKind(int $kind): string {\n        return $this->dumpEnum($kind, [\n            Array_::KIND_LONG => 'KIND_LONG',\n            Array_::KIND_SHORT => 'KIND_SHORT',\n        ]);\n    }\n\n    private function dumpListKind(int $kind): string {\n        return $this->dumpEnum($kind, [\n            List_::KIND_LIST => 'KIND_LIST',\n            List_::KIND_ARRAY => 'KIND_ARRAY',\n        ]);\n    }\n\n    /**\n     * Dump node position, if possible.\n     *\n     * @param Node $node Node for which to dump position\n     *\n     * @return string|null Dump of position, or null if position information not available\n     */\n    protected function dumpPosition(Node $node): ?string {\n        if (!$node->hasAttribute('startLine') || !$node->hasAttribute('endLine')) {\n            return null;\n        }\n\n        $start = $node->getStartLine();\n        $end = $node->getEndLine();\n        if ($node->hasAttribute('startFilePos') && $node->hasAttribute('endFilePos')\n            && null !== $this->code\n        ) {\n            $start .= ':' . $this->toColumn($this->code, $node->getStartFilePos());\n            $end .= ':' . $this->toColumn($this->code, $node->getEndFilePos());\n        }\n        return \"[$start - $end]\";\n    }\n\n    // Copied from Error class\n    private function toColumn(string $code, int $pos): int {\n        if ($pos > strlen($code)) {\n            throw new \\RuntimeException('Invalid position information');\n        }\n\n        $lineStartPos = strrpos($code, \"\\n\", $pos - strlen($code));\n        if (false === $lineStartPos) {\n            $lineStartPos = -1;\n        }\n\n        return $pos - $lineStartPos;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeFinder.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\NodeVisitor\\FindingVisitor;\nuse PhpParser\\NodeVisitor\\FirstFindingVisitor;\n\nclass NodeFinder {\n    /**\n     * Find all nodes satisfying a filter callback.\n     *\n     * @param Node|Node[] $nodes Single node or array of nodes to search in\n     * @param callable $filter Filter callback: function(Node $node) : bool\n     *\n     * @return Node[] Found nodes satisfying the filter callback\n     */\n    public function find($nodes, callable $filter): array {\n        if ($nodes === []) {\n            return [];\n        }\n\n        if (!is_array($nodes)) {\n            $nodes = [$nodes];\n        }\n\n        $visitor = new FindingVisitor($filter);\n\n        $traverser = new NodeTraverser($visitor);\n        $traverser->traverse($nodes);\n\n        return $visitor->getFoundNodes();\n    }\n\n    /**\n     * Find all nodes that are instances of a certain class.\n\n     * @template TNode as Node\n     *\n     * @param Node|Node[] $nodes Single node or array of nodes to search in\n     * @param class-string<TNode> $class Class name\n     *\n     * @return TNode[] Found nodes (all instances of $class)\n     */\n    public function findInstanceOf($nodes, string $class): array {\n        return $this->find($nodes, function ($node) use ($class) {\n            return $node instanceof $class;\n        });\n    }\n\n    /**\n     * Find first node satisfying a filter callback.\n     *\n     * @param Node|Node[] $nodes Single node or array of nodes to search in\n     * @param callable $filter Filter callback: function(Node $node) : bool\n     *\n     * @return null|Node Found node (or null if none found)\n     */\n    public function findFirst($nodes, callable $filter): ?Node {\n        if ($nodes === []) {\n            return null;\n        }\n\n        if (!is_array($nodes)) {\n            $nodes = [$nodes];\n        }\n\n        $visitor = new FirstFindingVisitor($filter);\n\n        $traverser = new NodeTraverser($visitor);\n        $traverser->traverse($nodes);\n\n        return $visitor->getFoundNode();\n    }\n\n    /**\n     * Find first node that is an instance of a certain class.\n     *\n     * @template TNode as Node\n     *\n     * @param Node|Node[] $nodes Single node or array of nodes to search in\n     * @param class-string<TNode> $class Class name\n     *\n     * @return null|TNode Found node, which is an instance of $class (or null if none found)\n     */\n    public function findFirstInstanceOf($nodes, string $class): ?Node {\n        return $this->findFirst($nodes, function ($node) use ($class) {\n            return $node instanceof $class;\n        });\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeTraverser.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass NodeTraverser implements NodeTraverserInterface {\n    /**\n     * @deprecated Use NodeVisitor::DONT_TRAVERSE_CHILDREN instead.\n     */\n    public const DONT_TRAVERSE_CHILDREN = NodeVisitor::DONT_TRAVERSE_CHILDREN;\n\n    /**\n     * @deprecated Use NodeVisitor::STOP_TRAVERSAL instead.\n     */\n    public const STOP_TRAVERSAL = NodeVisitor::STOP_TRAVERSAL;\n\n    /**\n     * @deprecated Use NodeVisitor::REMOVE_NODE instead.\n     */\n    public const REMOVE_NODE = NodeVisitor::REMOVE_NODE;\n\n    /**\n     * @deprecated Use NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN instead.\n     */\n    public const DONT_TRAVERSE_CURRENT_AND_CHILDREN = NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN;\n\n    /** @var list<NodeVisitor> Visitors */\n    protected array $visitors = [];\n\n    /** @var bool Whether traversal should be stopped */\n    protected bool $stopTraversal;\n\n    /**\n     * Create a traverser with the given visitors.\n     *\n     * @param NodeVisitor ...$visitors Node visitors\n     */\n    public function __construct(NodeVisitor ...$visitors) {\n        $this->visitors = $visitors;\n    }\n\n    /**\n     * Adds a visitor.\n     *\n     * @param NodeVisitor $visitor Visitor to add\n     */\n    public function addVisitor(NodeVisitor $visitor): void {\n        $this->visitors[] = $visitor;\n    }\n\n    /**\n     * Removes an added visitor.\n     */\n    public function removeVisitor(NodeVisitor $visitor): void {\n        $index = array_search($visitor, $this->visitors);\n        if ($index !== false) {\n            array_splice($this->visitors, $index, 1, []);\n        }\n    }\n\n    /**\n     * Traverses an array of nodes using the registered visitors.\n     *\n     * @param Node[] $nodes Array of nodes\n     *\n     * @return Node[] Traversed array of nodes\n     */\n    public function traverse(array $nodes): array {\n        $this->stopTraversal = false;\n\n        foreach ($this->visitors as $visitor) {\n            if (null !== $return = $visitor->beforeTraverse($nodes)) {\n                $nodes = $return;\n            }\n        }\n\n        $nodes = $this->traverseArray($nodes);\n\n        for ($i = \\count($this->visitors) - 1; $i >= 0; --$i) {\n            $visitor = $this->visitors[$i];\n            if (null !== $return = $visitor->afterTraverse($nodes)) {\n                $nodes = $return;\n            }\n        }\n\n        return $nodes;\n    }\n\n    /**\n     * Recursively traverse a node.\n     *\n     * @param Node $node Node to traverse.\n     */\n    protected function traverseNode(Node $node): void {\n        foreach ($node->getSubNodeNames() as $name) {\n            $subNode = $node->$name;\n\n            if (\\is_array($subNode)) {\n                $node->$name = $this->traverseArray($subNode);\n                if ($this->stopTraversal) {\n                    break;\n                }\n\n                continue;\n            }\n\n            if (!$subNode instanceof Node) {\n                continue;\n            }\n\n            $traverseChildren = true;\n            $visitorIndex = -1;\n\n            foreach ($this->visitors as $visitorIndex => $visitor) {\n                $return = $visitor->enterNode($subNode);\n                if (null !== $return) {\n                    if ($return instanceof Node) {\n                        $this->ensureReplacementReasonable($subNode, $return);\n                        $subNode = $node->$name = $return;\n                    } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) {\n                        $traverseChildren = false;\n                    } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) {\n                        $traverseChildren = false;\n                        break;\n                    } elseif (NodeVisitor::STOP_TRAVERSAL === $return) {\n                        $this->stopTraversal = true;\n                        break 2;\n                    } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) {\n                        $node->$name = null;\n                        continue 2;\n                    } else {\n                        throw new \\LogicException(\n                            'enterNode() returned invalid value of type ' . gettype($return)\n                        );\n                    }\n                }\n            }\n\n            if ($traverseChildren) {\n                $this->traverseNode($subNode);\n                if ($this->stopTraversal) {\n                    break;\n                }\n            }\n\n            for (; $visitorIndex >= 0; --$visitorIndex) {\n                $visitor = $this->visitors[$visitorIndex];\n                $return = $visitor->leaveNode($subNode);\n\n                if (null !== $return) {\n                    if ($return instanceof Node) {\n                        $this->ensureReplacementReasonable($subNode, $return);\n                        $subNode = $node->$name = $return;\n                    } elseif (NodeVisitor::STOP_TRAVERSAL === $return) {\n                        $this->stopTraversal = true;\n                        break 2;\n                    } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) {\n                        $node->$name = null;\n                        break;\n                    } elseif (\\is_array($return)) {\n                        throw new \\LogicException(\n                            'leaveNode() may only return an array ' .\n                            'if the parent structure is an array'\n                        );\n                    } else {\n                        throw new \\LogicException(\n                            'leaveNode() returned invalid value of type ' . gettype($return)\n                        );\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * Recursively traverse array (usually of nodes).\n     *\n     * @param Node[] $nodes Array to traverse\n     *\n     * @return Node[] Result of traversal (may be original array or changed one)\n     */\n    protected function traverseArray(array $nodes): array {\n        $doNodes = [];\n\n        foreach ($nodes as $i => $node) {\n            if (!$node instanceof Node) {\n                if (\\is_array($node)) {\n                    throw new \\LogicException('Invalid node structure: Contains nested arrays');\n                }\n                continue;\n            }\n\n            $traverseChildren = true;\n            $visitorIndex = -1;\n\n            foreach ($this->visitors as $visitorIndex => $visitor) {\n                $return = $visitor->enterNode($node);\n                if (null !== $return) {\n                    if ($return instanceof Node) {\n                        $this->ensureReplacementReasonable($node, $return);\n                        $nodes[$i] = $node = $return;\n                    } elseif (\\is_array($return)) {\n                        $doNodes[] = [$i, $return];\n                        continue 2;\n                    } elseif (NodeVisitor::REMOVE_NODE === $return) {\n                        $doNodes[] = [$i, []];\n                        continue 2;\n                    } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) {\n                        $traverseChildren = false;\n                    } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) {\n                        $traverseChildren = false;\n                        break;\n                    } elseif (NodeVisitor::STOP_TRAVERSAL === $return) {\n                        $this->stopTraversal = true;\n                        break 2;\n                    } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) {\n                        throw new \\LogicException(\n                            'REPLACE_WITH_NULL can not be used if the parent structure is an array');\n                    } else {\n                        throw new \\LogicException(\n                            'enterNode() returned invalid value of type ' . gettype($return)\n                        );\n                    }\n                }\n            }\n\n            if ($traverseChildren) {\n                $this->traverseNode($node);\n                if ($this->stopTraversal) {\n                    break;\n                }\n            }\n\n            for (; $visitorIndex >= 0; --$visitorIndex) {\n                $visitor = $this->visitors[$visitorIndex];\n                $return = $visitor->leaveNode($node);\n\n                if (null !== $return) {\n                    if ($return instanceof Node) {\n                        $this->ensureReplacementReasonable($node, $return);\n                        $nodes[$i] = $node = $return;\n                    } elseif (\\is_array($return)) {\n                        $doNodes[] = [$i, $return];\n                        break;\n                    } elseif (NodeVisitor::REMOVE_NODE === $return) {\n                        $doNodes[] = [$i, []];\n                        break;\n                    } elseif (NodeVisitor::STOP_TRAVERSAL === $return) {\n                        $this->stopTraversal = true;\n                        break 2;\n                    } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) {\n                        throw new \\LogicException(\n                            'REPLACE_WITH_NULL can not be used if the parent structure is an array');\n                    } else {\n                        throw new \\LogicException(\n                            'leaveNode() returned invalid value of type ' . gettype($return)\n                        );\n                    }\n                }\n            }\n        }\n\n        if (!empty($doNodes)) {\n            while (list($i, $replace) = array_pop($doNodes)) {\n                array_splice($nodes, $i, 1, $replace);\n            }\n        }\n\n        return $nodes;\n    }\n\n    private function ensureReplacementReasonable(Node $old, Node $new): void {\n        if ($old instanceof Node\\Stmt && $new instanceof Node\\Expr) {\n            throw new \\LogicException(\n                \"Trying to replace statement ({$old->getType()}) \" .\n                \"with expression ({$new->getType()}). Are you missing a \" .\n                \"Stmt_Expression wrapper?\"\n            );\n        }\n\n        if ($old instanceof Node\\Expr && $new instanceof Node\\Stmt) {\n            throw new \\LogicException(\n                \"Trying to replace expression ({$old->getType()}) \" .\n                \"with statement ({$new->getType()})\"\n            );\n        }\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeTraverserInterface.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\ninterface NodeTraverserInterface {\n    /**\n     * Adds a visitor.\n     *\n     * @param NodeVisitor $visitor Visitor to add\n     */\n    public function addVisitor(NodeVisitor $visitor): void;\n\n    /**\n     * Removes an added visitor.\n     */\n    public function removeVisitor(NodeVisitor $visitor): void;\n\n    /**\n     * Traverses an array of nodes using the registered visitors.\n     *\n     * @param Node[] $nodes Array of nodes\n     *\n     * @return Node[] Traversed array of nodes\n     */\n    public function traverse(array $nodes): array;\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeVisitor/CloningVisitor.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeVisitorAbstract;\n\n/**\n * Visitor cloning all nodes and linking to the original nodes using an attribute.\n *\n * This visitor is required to perform format-preserving pretty prints.\n */\nclass CloningVisitor extends NodeVisitorAbstract {\n    public function enterNode(Node $origNode) {\n        $node = clone $origNode;\n        $node->setAttribute('origNode', $origNode);\n        return $node;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeVisitor/CommentAnnotatingVisitor.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\Comment;\nuse PhpParser\\Node;\nuse PhpParser\\NodeVisitorAbstract;\nuse PhpParser\\Token;\n\nclass CommentAnnotatingVisitor extends NodeVisitorAbstract {\n    /** @var int Last seen token start position */\n    private int $pos = 0;\n    /** @var Token[] Token array */\n    private array $tokens;\n    /** @var list<int> Token positions of comments */\n    private array $commentPositions = [];\n\n    /**\n     * Create a comment annotation visitor.\n     *\n     * @param Token[] $tokens Token array\n     */\n    public function __construct(array $tokens) {\n        $this->tokens = $tokens;\n\n        // Collect positions of comments. We use this to avoid traversing parts of the AST where\n        // there are no comments.\n        foreach ($tokens as $i => $token) {\n            if ($token->id === \\T_COMMENT || $token->id === \\T_DOC_COMMENT) {\n                $this->commentPositions[] = $i;\n            }\n        }\n    }\n\n    public function enterNode(Node $node) {\n        $nextCommentPos = current($this->commentPositions);\n        if ($nextCommentPos === false) {\n            // No more comments.\n            return self::STOP_TRAVERSAL;\n        }\n\n        $oldPos = $this->pos;\n        $this->pos = $pos = $node->getStartTokenPos();\n        if ($nextCommentPos > $oldPos && $nextCommentPos < $pos) {\n            $comments = [];\n            while (--$pos >= $oldPos) {\n                $token = $this->tokens[$pos];\n                if ($token->id === \\T_DOC_COMMENT) {\n                    $comments[] = new Comment\\Doc(\n                        $token->text, $token->line, $token->pos, $pos,\n                        $token->getEndLine(), $token->getEndPos() - 1, $pos);\n                    continue;\n                }\n                if ($token->id === \\T_COMMENT) {\n                    $comments[] = new Comment(\n                        $token->text, $token->line, $token->pos, $pos,\n                        $token->getEndLine(), $token->getEndPos() - 1, $pos);\n                    continue;\n                }\n                if ($token->id !== \\T_WHITESPACE) {\n                    break;\n                }\n            }\n            if (!empty($comments)) {\n                $node->setAttribute('comments', array_reverse($comments));\n            }\n\n            do {\n                $nextCommentPos = next($this->commentPositions);\n            } while ($nextCommentPos !== false && $nextCommentPos < $this->pos);\n        }\n\n        $endPos = $node->getEndTokenPos();\n        if ($nextCommentPos > $endPos) {\n            // Skip children if there are no comments located inside this node.\n            $this->pos = $endPos;\n            return self::DONT_TRAVERSE_CHILDREN;\n        }\n\n        return null;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeVisitor/FindingVisitor.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeVisitorAbstract;\n\n/**\n * This visitor can be used to find and collect all nodes satisfying some criterion determined by\n * a filter callback.\n */\nclass FindingVisitor extends NodeVisitorAbstract {\n    /** @var callable Filter callback */\n    protected $filterCallback;\n    /** @var list<Node> Found nodes */\n    protected array $foundNodes;\n\n    public function __construct(callable $filterCallback) {\n        $this->filterCallback = $filterCallback;\n    }\n\n    /**\n     * Get found nodes satisfying the filter callback.\n     *\n     * Nodes are returned in pre-order.\n     *\n     * @return list<Node> Found nodes\n     */\n    public function getFoundNodes(): array {\n        return $this->foundNodes;\n    }\n\n    public function beforeTraverse(array $nodes): ?array {\n        $this->foundNodes = [];\n\n        return null;\n    }\n\n    public function enterNode(Node $node) {\n        $filterCallback = $this->filterCallback;\n        if ($filterCallback($node)) {\n            $this->foundNodes[] = $node;\n        }\n\n        return null;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeVisitor/FirstFindingVisitor.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeVisitor;\nuse PhpParser\\NodeVisitorAbstract;\n\n/**\n * This visitor can be used to find the first node satisfying some criterion determined by\n * a filter callback.\n */\nclass FirstFindingVisitor extends NodeVisitorAbstract {\n    /** @var callable Filter callback */\n    protected $filterCallback;\n    /** @var null|Node Found node */\n    protected ?Node $foundNode;\n\n    public function __construct(callable $filterCallback) {\n        $this->filterCallback = $filterCallback;\n    }\n\n    /**\n     * Get found node satisfying the filter callback.\n     *\n     * Returns null if no node satisfies the filter callback.\n     *\n     * @return null|Node Found node (or null if not found)\n     */\n    public function getFoundNode(): ?Node {\n        return $this->foundNode;\n    }\n\n    public function beforeTraverse(array $nodes): ?array {\n        $this->foundNode = null;\n\n        return null;\n    }\n\n    public function enterNode(Node $node) {\n        $filterCallback = $this->filterCallback;\n        if ($filterCallback($node)) {\n            $this->foundNode = $node;\n            return NodeVisitor::STOP_TRAVERSAL;\n        }\n\n        return null;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeVisitor/NameResolver.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\ErrorHandler;\nuse PhpParser\\NameContext;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Name\\FullyQualified;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\NodeVisitorAbstract;\n\nclass NameResolver extends NodeVisitorAbstract {\n    /** @var NameContext Naming context */\n    protected NameContext $nameContext;\n\n    /** @var bool Whether to preserve original names */\n    protected bool $preserveOriginalNames;\n\n    /** @var bool Whether to replace resolved nodes in place, or to add resolvedNode attributes */\n    protected bool $replaceNodes;\n\n    /**\n     * Constructs a name resolution visitor.\n     *\n     * Options:\n     *  * preserveOriginalNames (default false): An \"originalName\" attribute will be added to\n     *    all name nodes that underwent resolution.\n     *  * replaceNodes (default true): Resolved names are replaced in-place. Otherwise, a\n     *    resolvedName attribute is added. (Names that cannot be statically resolved receive a\n     *    namespacedName attribute, as usual.)\n     *\n     * @param ErrorHandler|null $errorHandler Error handler\n     * @param array{preserveOriginalNames?: bool, replaceNodes?: bool} $options Options\n     */\n    public function __construct(?ErrorHandler $errorHandler = null, array $options = []) {\n        $this->nameContext = new NameContext($errorHandler ?? new ErrorHandler\\Throwing());\n        $this->preserveOriginalNames = $options['preserveOriginalNames'] ?? false;\n        $this->replaceNodes = $options['replaceNodes'] ?? true;\n    }\n\n    /**\n     * Get name resolution context.\n     */\n    public function getNameContext(): NameContext {\n        return $this->nameContext;\n    }\n\n    public function beforeTraverse(array $nodes): ?array {\n        $this->nameContext->startNamespace();\n        return null;\n    }\n\n    public function enterNode(Node $node) {\n        if ($node instanceof Stmt\\Namespace_) {\n            $this->nameContext->startNamespace($node->name);\n        } elseif ($node instanceof Stmt\\Use_) {\n            foreach ($node->uses as $use) {\n                $this->addAlias($use, $node->type, null);\n            }\n        } elseif ($node instanceof Stmt\\GroupUse) {\n            foreach ($node->uses as $use) {\n                $this->addAlias($use, $node->type, $node->prefix);\n            }\n        } elseif ($node instanceof Stmt\\Class_) {\n            if (null !== $node->extends) {\n                $node->extends = $this->resolveClassName($node->extends);\n            }\n\n            foreach ($node->implements as &$interface) {\n                $interface = $this->resolveClassName($interface);\n            }\n\n            $this->resolveAttrGroups($node);\n            if (null !== $node->name) {\n                $this->addNamespacedName($node);\n            } else {\n                $node->namespacedName = null;\n            }\n        } elseif ($node instanceof Stmt\\Interface_) {\n            foreach ($node->extends as &$interface) {\n                $interface = $this->resolveClassName($interface);\n            }\n\n            $this->resolveAttrGroups($node);\n            $this->addNamespacedName($node);\n        } elseif ($node instanceof Stmt\\Enum_) {\n            foreach ($node->implements as &$interface) {\n                $interface = $this->resolveClassName($interface);\n            }\n\n            $this->resolveAttrGroups($node);\n            $this->addNamespacedName($node);\n        } elseif ($node instanceof Stmt\\Trait_) {\n            $this->resolveAttrGroups($node);\n            $this->addNamespacedName($node);\n        } elseif ($node instanceof Stmt\\Function_) {\n            $this->resolveSignature($node);\n            $this->resolveAttrGroups($node);\n            $this->addNamespacedName($node);\n        } elseif ($node instanceof Stmt\\ClassMethod\n                  || $node instanceof Expr\\Closure\n                  || $node instanceof Expr\\ArrowFunction\n        ) {\n            $this->resolveSignature($node);\n            $this->resolveAttrGroups($node);\n        } elseif ($node instanceof Stmt\\Property) {\n            if (null !== $node->type) {\n                $node->type = $this->resolveType($node->type);\n            }\n            $this->resolveAttrGroups($node);\n        } elseif ($node instanceof Node\\PropertyHook) {\n            foreach ($node->params as $param) {\n                $param->type = $this->resolveType($param->type);\n                $this->resolveAttrGroups($param);\n            }\n            $this->resolveAttrGroups($node);\n        } elseif ($node instanceof Stmt\\Const_) {\n            foreach ($node->consts as $const) {\n                $this->addNamespacedName($const);\n            }\n            $this->resolveAttrGroups($node);\n        } elseif ($node instanceof Stmt\\ClassConst) {\n            if (null !== $node->type) {\n                $node->type = $this->resolveType($node->type);\n            }\n            $this->resolveAttrGroups($node);\n        } elseif ($node instanceof Stmt\\EnumCase) {\n            $this->resolveAttrGroups($node);\n        } elseif ($node instanceof Expr\\StaticCall\n                  || $node instanceof Expr\\StaticPropertyFetch\n                  || $node instanceof Expr\\ClassConstFetch\n                  || $node instanceof Expr\\New_\n                  || $node instanceof Expr\\Instanceof_\n        ) {\n            if ($node->class instanceof Name) {\n                $node->class = $this->resolveClassName($node->class);\n            }\n        } elseif ($node instanceof Stmt\\Catch_) {\n            foreach ($node->types as &$type) {\n                $type = $this->resolveClassName($type);\n            }\n        } elseif ($node instanceof Expr\\FuncCall) {\n            if ($node->name instanceof Name) {\n                $node->name = $this->resolveName($node->name, Stmt\\Use_::TYPE_FUNCTION);\n            }\n        } elseif ($node instanceof Expr\\ConstFetch) {\n            $node->name = $this->resolveName($node->name, Stmt\\Use_::TYPE_CONSTANT);\n        } elseif ($node instanceof Stmt\\TraitUse) {\n            foreach ($node->traits as &$trait) {\n                $trait = $this->resolveClassName($trait);\n            }\n\n            foreach ($node->adaptations as $adaptation) {\n                if (null !== $adaptation->trait) {\n                    $adaptation->trait = $this->resolveClassName($adaptation->trait);\n                }\n\n                if ($adaptation instanceof Stmt\\TraitUseAdaptation\\Precedence) {\n                    foreach ($adaptation->insteadof as &$insteadof) {\n                        $insteadof = $this->resolveClassName($insteadof);\n                    }\n                }\n            }\n        }\n\n        return null;\n    }\n\n    /** @param Stmt\\Use_::TYPE_* $type */\n    private function addAlias(Node\\UseItem $use, int $type, ?Name $prefix = null): void {\n        // Add prefix for group uses\n        $name = $prefix ? Name::concat($prefix, $use->name) : $use->name;\n        // Type is determined either by individual element or whole use declaration\n        $type |= $use->type;\n\n        $this->nameContext->addAlias(\n            $name, (string) $use->getAlias(), $type, $use->getAttributes()\n        );\n    }\n\n    /** @param Stmt\\Function_|Stmt\\ClassMethod|Expr\\Closure|Expr\\ArrowFunction $node */\n    private function resolveSignature($node): void {\n        foreach ($node->params as $param) {\n            $param->type = $this->resolveType($param->type);\n            $this->resolveAttrGroups($param);\n        }\n        $node->returnType = $this->resolveType($node->returnType);\n    }\n\n    /**\n     * @template T of Node\\Identifier|Name|Node\\ComplexType|null\n     * @param T $node\n     * @return T\n     */\n    private function resolveType(?Node $node): ?Node {\n        if ($node instanceof Name) {\n            return $this->resolveClassName($node);\n        }\n        if ($node instanceof Node\\NullableType) {\n            $node->type = $this->resolveType($node->type);\n            return $node;\n        }\n        if ($node instanceof Node\\UnionType || $node instanceof Node\\IntersectionType) {\n            foreach ($node->types as &$type) {\n                $type = $this->resolveType($type);\n            }\n            return $node;\n        }\n        return $node;\n    }\n\n    /**\n     * Resolve name, according to name resolver options.\n     *\n     * @param Name $name Function or constant name to resolve\n     * @param Stmt\\Use_::TYPE_* $type One of Stmt\\Use_::TYPE_*\n     *\n     * @return Name Resolved name, or original name with attribute\n     */\n    protected function resolveName(Name $name, int $type): Name {\n        if (!$this->replaceNodes) {\n            $resolvedName = $this->nameContext->getResolvedName($name, $type);\n            if (null !== $resolvedName) {\n                $name->setAttribute('resolvedName', $resolvedName);\n            } else {\n                $name->setAttribute('namespacedName', FullyQualified::concat(\n                    $this->nameContext->getNamespace(), $name, $name->getAttributes()));\n            }\n            return $name;\n        }\n\n        if ($this->preserveOriginalNames) {\n            // Save the original name\n            $originalName = $name;\n            $name = clone $originalName;\n            $name->setAttribute('originalName', $originalName);\n        }\n\n        $resolvedName = $this->nameContext->getResolvedName($name, $type);\n        if (null !== $resolvedName) {\n            return $resolvedName;\n        }\n\n        // unqualified names inside a namespace cannot be resolved at compile-time\n        // add the namespaced version of the name as an attribute\n        $name->setAttribute('namespacedName', FullyQualified::concat(\n            $this->nameContext->getNamespace(), $name, $name->getAttributes()));\n        return $name;\n    }\n\n    protected function resolveClassName(Name $name): Name {\n        return $this->resolveName($name, Stmt\\Use_::TYPE_NORMAL);\n    }\n\n    protected function addNamespacedName(Node $node): void {\n        $node->namespacedName = Name::concat(\n            $this->nameContext->getNamespace(), (string) $node->name);\n    }\n\n    protected function resolveAttrGroups(Node $node): void {\n        foreach ($node->attrGroups as $attrGroup) {\n            foreach ($attrGroup->attrs as $attr) {\n                $attr->name = $this->resolveClassName($attr->name);\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeVisitorAbstract;\n\n/**\n * Visitor that connects a child node to its parent node\n * as well as its sibling nodes.\n *\n * With <code>$weakReferences=false</code> on the child node, the parent node can be accessed through\n * <code>$node->getAttribute('parent')</code>, the previous\n * node can be accessed through <code>$node->getAttribute('previous')</code>,\n * and the next node can be accessed through <code>$node->getAttribute('next')</code>.\n *\n * With <code>$weakReferences=true</code> attribute names are prefixed by \"weak_\", e.g. \"weak_parent\".\n */\nfinal class NodeConnectingVisitor extends NodeVisitorAbstract {\n    /**\n     * @var Node[]\n     */\n    private array $stack = [];\n\n    /**\n     * @var ?Node\n     */\n    private $previous;\n\n    private bool $weakReferences;\n\n    public function __construct(bool $weakReferences = false) {\n        $this->weakReferences = $weakReferences;\n    }\n\n    public function beforeTraverse(array $nodes) {\n        $this->stack    = [];\n        $this->previous = null;\n    }\n\n    public function enterNode(Node $node) {\n        if (!empty($this->stack)) {\n            $parent = $this->stack[count($this->stack) - 1];\n            if ($this->weakReferences) {\n                $node->setAttribute('weak_parent', \\WeakReference::create($parent));\n            } else {\n                $node->setAttribute('parent', $parent);\n            }\n        }\n\n        if ($this->previous !== null) {\n            if (\n                $this->weakReferences\n            ) {\n                if ($this->previous->getAttribute('weak_parent') === $node->getAttribute('weak_parent')) {\n                    $node->setAttribute('weak_previous', \\WeakReference::create($this->previous));\n                    $this->previous->setAttribute('weak_next', \\WeakReference::create($node));\n                }\n            } elseif ($this->previous->getAttribute('parent') === $node->getAttribute('parent')) {\n                $node->setAttribute('previous', $this->previous);\n                $this->previous->setAttribute('next', $node);\n            }\n        }\n\n        $this->stack[] = $node;\n    }\n\n    public function leaveNode(Node $node) {\n        $this->previous = $node;\n\n        array_pop($this->stack);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\Node;\nuse PhpParser\\NodeVisitorAbstract;\n\nuse function array_pop;\nuse function count;\n\n/**\n * Visitor that connects a child node to its parent node.\n *\n * With <code>$weakReferences=false</code> on the child node, the parent node can be accessed through\n * <code>$node->getAttribute('parent')</code>.\n *\n * With <code>$weakReferences=true</code> the attribute name is \"weak_parent\" instead.\n */\nfinal class ParentConnectingVisitor extends NodeVisitorAbstract {\n    /**\n     * @var Node[]\n     */\n    private array $stack = [];\n\n    private bool $weakReferences;\n\n    public function __construct(bool $weakReferences = false) {\n        $this->weakReferences = $weakReferences;\n    }\n\n    public function beforeTraverse(array $nodes) {\n        $this->stack = [];\n    }\n\n    public function enterNode(Node $node) {\n        if (!empty($this->stack)) {\n            $parent = $this->stack[count($this->stack) - 1];\n            if ($this->weakReferences) {\n                $node->setAttribute('weak_parent', \\WeakReference::create($parent));\n            } else {\n                $node->setAttribute('parent', $parent);\n            }\n        }\n\n        $this->stack[] = $node;\n    }\n\n    public function leaveNode(Node $node) {\n        array_pop($this->stack);\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeVisitor.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\ninterface NodeVisitor {\n    /**\n     * If NodeVisitor::enterNode() returns DONT_TRAVERSE_CHILDREN, child nodes\n     * of the current node will not be traversed for any visitors.\n     *\n     * For subsequent visitors enterNode() will still be called on the current\n     * node and leaveNode() will also be invoked for the current node.\n     */\n    public const DONT_TRAVERSE_CHILDREN = 1;\n\n    /**\n     * If NodeVisitor::enterNode() or NodeVisitor::leaveNode() returns\n     * STOP_TRAVERSAL, traversal is aborted.\n     *\n     * The afterTraverse() method will still be invoked.\n     */\n    public const STOP_TRAVERSAL = 2;\n\n    /**\n     * If NodeVisitor::leaveNode() returns REMOVE_NODE for a node that occurs\n     * in an array, it will be removed from the array.\n     *\n     * For subsequent visitors leaveNode() will still be invoked for the\n     * removed node.\n     */\n    public const REMOVE_NODE = 3;\n\n    /**\n     * If NodeVisitor::enterNode() returns DONT_TRAVERSE_CURRENT_AND_CHILDREN, child nodes\n     * of the current node will not be traversed for any visitors.\n     *\n     * For subsequent visitors enterNode() will not be called as well.\n     * leaveNode() will be invoked for visitors that has enterNode() method invoked.\n     */\n    public const DONT_TRAVERSE_CURRENT_AND_CHILDREN = 4;\n\n    /**\n     * If NodeVisitor::enterNode() or NodeVisitor::leaveNode() returns REPLACE_WITH_NULL,\n     * the node will be replaced with null. This is not a legal return value if the node is part\n     * of an array, rather than another node.\n     */\n    public const REPLACE_WITH_NULL = 5;\n\n    /**\n     * Called once before traversal.\n     *\n     * Return value semantics:\n     *  * null:      $nodes stays as-is\n     *  * otherwise: $nodes is set to the return value\n     *\n     * @param Node[] $nodes Array of nodes\n     *\n     * @return null|Node[] Array of nodes\n     */\n    public function beforeTraverse(array $nodes);\n\n    /**\n     * Called when entering a node.\n     *\n     * Return value semantics:\n     *  * null\n     *        => $node stays as-is\n     *  * array (of Nodes)\n     *        => The return value is merged into the parent array (at the position of the $node)\n     *  * NodeVisitor::REMOVE_NODE\n     *        => $node is removed from the parent array\n     *  * NodeVisitor::REPLACE_WITH_NULL\n     *        => $node is replaced with null\n     *  * NodeVisitor::DONT_TRAVERSE_CHILDREN\n     *        => Children of $node are not traversed. $node stays as-is\n     *  * NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN\n     *        => Further visitors for the current node are skipped, and its children are not\n     *           traversed. $node stays as-is.\n     *  * NodeVisitor::STOP_TRAVERSAL\n     *        => Traversal is aborted. $node stays as-is\n     *  * otherwise\n     *        => $node is set to the return value\n     *\n     * @param Node $node Node\n     *\n     * @return null|int|Node|Node[] Replacement node (or special return value)\n     */\n    public function enterNode(Node $node);\n\n    /**\n     * Called when leaving a node.\n     *\n     * Return value semantics:\n     *  * null\n     *        => $node stays as-is\n     *  * NodeVisitor::REMOVE_NODE\n     *        => $node is removed from the parent array\n     *  * NodeVisitor::REPLACE_WITH_NULL\n     *        => $node is replaced with null\n     *  * NodeVisitor::STOP_TRAVERSAL\n     *        => Traversal is aborted. $node stays as-is\n     *  * array (of Nodes)\n     *        => The return value is merged into the parent array (at the position of the $node)\n     *  * otherwise\n     *        => $node is set to the return value\n     *\n     * @param Node $node Node\n     *\n     * @return null|int|Node|Node[] Replacement node (or special return value)\n     */\n    public function leaveNode(Node $node);\n\n    /**\n     * Called once after traversal.\n     *\n     * Return value semantics:\n     *  * null:      $nodes stays as-is\n     *  * otherwise: $nodes is set to the return value\n     *\n     * @param Node[] $nodes Array of nodes\n     *\n     * @return null|Node[] Array of nodes\n     */\n    public function afterTraverse(array $nodes);\n}\n"
  },
  {
    "path": "lib/PhpParser/NodeVisitorAbstract.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\n/**\n * @codeCoverageIgnore\n */\nabstract class NodeVisitorAbstract implements NodeVisitor {\n    public function beforeTraverse(array $nodes) {\n        return null;\n    }\n\n    public function enterNode(Node $node) {\n        return null;\n    }\n\n    public function leaveNode(Node $node) {\n        return null;\n    }\n\n    public function afterTraverse(array $nodes) {\n        return null;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Parser/Php7.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Parser;\n\nuse PhpParser\\Error;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Stmt;\n\n/* This is an automatically GENERATED file, which should not be manually edited.\n * Instead edit one of the following:\n *  * the grammar file grammar/php.y\n *  * the skeleton file grammar/parser.template\n *  * the preprocessing script grammar/rebuildParsers.php\n */\nclass Php7 extends \\PhpParser\\ParserAbstract\n{\n    public const YYERRTOK = 256;\n    public const T_VOID_CAST = 257;\n    public const T_THROW = 258;\n    public const T_INCLUDE = 259;\n    public const T_INCLUDE_ONCE = 260;\n    public const T_EVAL = 261;\n    public const T_REQUIRE = 262;\n    public const T_REQUIRE_ONCE = 263;\n    public const T_LOGICAL_OR = 264;\n    public const T_LOGICAL_XOR = 265;\n    public const T_LOGICAL_AND = 266;\n    public const T_PRINT = 267;\n    public const T_YIELD = 268;\n    public const T_DOUBLE_ARROW = 269;\n    public const T_YIELD_FROM = 270;\n    public const T_PLUS_EQUAL = 271;\n    public const T_MINUS_EQUAL = 272;\n    public const T_MUL_EQUAL = 273;\n    public const T_DIV_EQUAL = 274;\n    public const T_CONCAT_EQUAL = 275;\n    public const T_MOD_EQUAL = 276;\n    public const T_AND_EQUAL = 277;\n    public const T_OR_EQUAL = 278;\n    public const T_XOR_EQUAL = 279;\n    public const T_SL_EQUAL = 280;\n    public const T_SR_EQUAL = 281;\n    public const T_POW_EQUAL = 282;\n    public const T_COALESCE_EQUAL = 283;\n    public const T_COALESCE = 284;\n    public const T_BOOLEAN_OR = 285;\n    public const T_BOOLEAN_AND = 286;\n    public const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = 287;\n    public const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = 288;\n    public const T_IS_EQUAL = 289;\n    public const T_IS_NOT_EQUAL = 290;\n    public const T_IS_IDENTICAL = 291;\n    public const T_IS_NOT_IDENTICAL = 292;\n    public const T_SPACESHIP = 293;\n    public const T_IS_SMALLER_OR_EQUAL = 294;\n    public const T_IS_GREATER_OR_EQUAL = 295;\n    public const T_SL = 296;\n    public const T_SR = 297;\n    public const T_INSTANCEOF = 298;\n    public const T_INC = 299;\n    public const T_DEC = 300;\n    public const T_INT_CAST = 301;\n    public const T_DOUBLE_CAST = 302;\n    public const T_STRING_CAST = 303;\n    public const T_ARRAY_CAST = 304;\n    public const T_OBJECT_CAST = 305;\n    public const T_BOOL_CAST = 306;\n    public const T_UNSET_CAST = 307;\n    public const T_POW = 308;\n    public const T_NEW = 309;\n    public const T_CLONE = 310;\n    public const T_EXIT = 311;\n    public const T_IF = 312;\n    public const T_ELSEIF = 313;\n    public const T_ELSE = 314;\n    public const T_ENDIF = 315;\n    public const T_LNUMBER = 316;\n    public const T_DNUMBER = 317;\n    public const T_STRING = 318;\n    public const T_STRING_VARNAME = 319;\n    public const T_VARIABLE = 320;\n    public const T_NUM_STRING = 321;\n    public const T_INLINE_HTML = 322;\n    public const T_ENCAPSED_AND_WHITESPACE = 323;\n    public const T_CONSTANT_ENCAPSED_STRING = 324;\n    public const T_ECHO = 325;\n    public const T_DO = 326;\n    public const T_WHILE = 327;\n    public const T_ENDWHILE = 328;\n    public const T_FOR = 329;\n    public const T_ENDFOR = 330;\n    public const T_FOREACH = 331;\n    public const T_ENDFOREACH = 332;\n    public const T_DECLARE = 333;\n    public const T_ENDDECLARE = 334;\n    public const T_AS = 335;\n    public const T_SWITCH = 336;\n    public const T_MATCH = 337;\n    public const T_ENDSWITCH = 338;\n    public const T_CASE = 339;\n    public const T_DEFAULT = 340;\n    public const T_BREAK = 341;\n    public const T_CONTINUE = 342;\n    public const T_GOTO = 343;\n    public const T_FUNCTION = 344;\n    public const T_FN = 345;\n    public const T_CONST = 346;\n    public const T_RETURN = 347;\n    public const T_TRY = 348;\n    public const T_CATCH = 349;\n    public const T_FINALLY = 350;\n    public const T_USE = 351;\n    public const T_INSTEADOF = 352;\n    public const T_GLOBAL = 353;\n    public const T_STATIC = 354;\n    public const T_ABSTRACT = 355;\n    public const T_FINAL = 356;\n    public const T_PRIVATE = 357;\n    public const T_PROTECTED = 358;\n    public const T_PUBLIC = 359;\n    public const T_READONLY = 360;\n    public const T_PUBLIC_SET = 361;\n    public const T_PROTECTED_SET = 362;\n    public const T_PRIVATE_SET = 363;\n    public const T_VAR = 364;\n    public const T_UNSET = 365;\n    public const T_ISSET = 366;\n    public const T_EMPTY = 367;\n    public const T_HALT_COMPILER = 368;\n    public const T_CLASS = 369;\n    public const T_TRAIT = 370;\n    public const T_INTERFACE = 371;\n    public const T_ENUM = 372;\n    public const T_EXTENDS = 373;\n    public const T_IMPLEMENTS = 374;\n    public const T_OBJECT_OPERATOR = 375;\n    public const T_NULLSAFE_OBJECT_OPERATOR = 376;\n    public const T_LIST = 377;\n    public const T_ARRAY = 378;\n    public const T_CALLABLE = 379;\n    public const T_CLASS_C = 380;\n    public const T_TRAIT_C = 381;\n    public const T_METHOD_C = 382;\n    public const T_FUNC_C = 383;\n    public const T_PROPERTY_C = 384;\n    public const T_LINE = 385;\n    public const T_FILE = 386;\n    public const T_START_HEREDOC = 387;\n    public const T_END_HEREDOC = 388;\n    public const T_DOLLAR_OPEN_CURLY_BRACES = 389;\n    public const T_CURLY_OPEN = 390;\n    public const T_PAAMAYIM_NEKUDOTAYIM = 391;\n    public const T_NAMESPACE = 392;\n    public const T_NS_C = 393;\n    public const T_DIR = 394;\n    public const T_NS_SEPARATOR = 395;\n    public const T_ELLIPSIS = 396;\n    public const T_NAME_FULLY_QUALIFIED = 397;\n    public const T_NAME_QUALIFIED = 398;\n    public const T_NAME_RELATIVE = 399;\n    public const T_ATTRIBUTE = 400;\n\n    protected int $tokenToSymbolMapSize = 401;\n    protected int $actionTableSize = 1578;\n    protected int $gotoTableSize = 698;\n\n    protected int $invalidSymbol = 173;\n    protected int $errorSymbol = 1;\n    protected int $defaultAction = -32766;\n    protected int $unexpectedTokenRule = 32767;\n\n    protected int $YY2TBLSTATE = 445;\n    protected int $numNonLeafStates = 754;\n\n    protected array $symbolToName = array(\n        \"EOF\",\n        \"error\",\n        \"T_VOID_CAST\",\n        \"T_THROW\",\n        \"T_INCLUDE\",\n        \"T_INCLUDE_ONCE\",\n        \"T_EVAL\",\n        \"T_REQUIRE\",\n        \"T_REQUIRE_ONCE\",\n        \"','\",\n        \"T_LOGICAL_OR\",\n        \"T_LOGICAL_XOR\",\n        \"T_LOGICAL_AND\",\n        \"T_PRINT\",\n        \"T_YIELD\",\n        \"T_DOUBLE_ARROW\",\n        \"T_YIELD_FROM\",\n        \"'='\",\n        \"T_PLUS_EQUAL\",\n        \"T_MINUS_EQUAL\",\n        \"T_MUL_EQUAL\",\n        \"T_DIV_EQUAL\",\n        \"T_CONCAT_EQUAL\",\n        \"T_MOD_EQUAL\",\n        \"T_AND_EQUAL\",\n        \"T_OR_EQUAL\",\n        \"T_XOR_EQUAL\",\n        \"T_SL_EQUAL\",\n        \"T_SR_EQUAL\",\n        \"T_POW_EQUAL\",\n        \"T_COALESCE_EQUAL\",\n        \"'?'\",\n        \"':'\",\n        \"T_COALESCE\",\n        \"T_BOOLEAN_OR\",\n        \"T_BOOLEAN_AND\",\n        \"'|'\",\n        \"'^'\",\n        \"T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG\",\n        \"T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG\",\n        \"T_IS_EQUAL\",\n        \"T_IS_NOT_EQUAL\",\n        \"T_IS_IDENTICAL\",\n        \"T_IS_NOT_IDENTICAL\",\n        \"T_SPACESHIP\",\n        \"'<'\",\n        \"T_IS_SMALLER_OR_EQUAL\",\n        \"'>'\",\n        \"T_IS_GREATER_OR_EQUAL\",\n        \"T_SL\",\n        \"T_SR\",\n        \"'+'\",\n        \"'-'\",\n        \"'.'\",\n        \"'*'\",\n        \"'/'\",\n        \"'%'\",\n        \"'!'\",\n        \"T_INSTANCEOF\",\n        \"'~'\",\n        \"T_INC\",\n        \"T_DEC\",\n        \"T_INT_CAST\",\n        \"T_DOUBLE_CAST\",\n        \"T_STRING_CAST\",\n        \"T_ARRAY_CAST\",\n        \"T_OBJECT_CAST\",\n        \"T_BOOL_CAST\",\n        \"T_UNSET_CAST\",\n        \"'@'\",\n        \"T_POW\",\n        \"'['\",\n        \"T_NEW\",\n        \"T_CLONE\",\n        \"T_EXIT\",\n        \"T_IF\",\n        \"T_ELSEIF\",\n        \"T_ELSE\",\n        \"T_ENDIF\",\n        \"T_LNUMBER\",\n        \"T_DNUMBER\",\n        \"T_STRING\",\n        \"T_STRING_VARNAME\",\n        \"T_VARIABLE\",\n        \"T_NUM_STRING\",\n        \"T_INLINE_HTML\",\n        \"T_ENCAPSED_AND_WHITESPACE\",\n        \"T_CONSTANT_ENCAPSED_STRING\",\n        \"T_ECHO\",\n        \"T_DO\",\n        \"T_WHILE\",\n        \"T_ENDWHILE\",\n        \"T_FOR\",\n        \"T_ENDFOR\",\n        \"T_FOREACH\",\n        \"T_ENDFOREACH\",\n        \"T_DECLARE\",\n        \"T_ENDDECLARE\",\n        \"T_AS\",\n        \"T_SWITCH\",\n        \"T_MATCH\",\n        \"T_ENDSWITCH\",\n        \"T_CASE\",\n        \"T_DEFAULT\",\n        \"T_BREAK\",\n        \"T_CONTINUE\",\n        \"T_GOTO\",\n        \"T_FUNCTION\",\n        \"T_FN\",\n        \"T_CONST\",\n        \"T_RETURN\",\n        \"T_TRY\",\n        \"T_CATCH\",\n        \"T_FINALLY\",\n        \"T_USE\",\n        \"T_INSTEADOF\",\n        \"T_GLOBAL\",\n        \"T_STATIC\",\n        \"T_ABSTRACT\",\n        \"T_FINAL\",\n        \"T_PRIVATE\",\n        \"T_PROTECTED\",\n        \"T_PUBLIC\",\n        \"T_READONLY\",\n        \"T_PUBLIC_SET\",\n        \"T_PROTECTED_SET\",\n        \"T_PRIVATE_SET\",\n        \"T_VAR\",\n        \"T_UNSET\",\n        \"T_ISSET\",\n        \"T_EMPTY\",\n        \"T_HALT_COMPILER\",\n        \"T_CLASS\",\n        \"T_TRAIT\",\n        \"T_INTERFACE\",\n        \"T_ENUM\",\n        \"T_EXTENDS\",\n        \"T_IMPLEMENTS\",\n        \"T_OBJECT_OPERATOR\",\n        \"T_NULLSAFE_OBJECT_OPERATOR\",\n        \"T_LIST\",\n        \"T_ARRAY\",\n        \"T_CALLABLE\",\n        \"T_CLASS_C\",\n        \"T_TRAIT_C\",\n        \"T_METHOD_C\",\n        \"T_FUNC_C\",\n        \"T_PROPERTY_C\",\n        \"T_LINE\",\n        \"T_FILE\",\n        \"T_START_HEREDOC\",\n        \"T_END_HEREDOC\",\n        \"T_DOLLAR_OPEN_CURLY_BRACES\",\n        \"T_CURLY_OPEN\",\n        \"T_PAAMAYIM_NEKUDOTAYIM\",\n        \"T_NAMESPACE\",\n        \"T_NS_C\",\n        \"T_DIR\",\n        \"T_NS_SEPARATOR\",\n        \"T_ELLIPSIS\",\n        \"T_NAME_FULLY_QUALIFIED\",\n        \"T_NAME_QUALIFIED\",\n        \"T_NAME_RELATIVE\",\n        \"T_ATTRIBUTE\",\n        \"';'\",\n        \"']'\",\n        \"'('\",\n        \"')'\",\n        \"'{'\",\n        \"'}'\",\n        \"'`'\",\n        \"'\\\"'\",\n        \"'$'\"\n    );\n\n    protected array $tokenToSymbol = array(\n            0,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,   57,  171,  173,  172,   56,  173,  173,\n          166,  167,   54,   51,    9,   52,   53,   55,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,   32,  164,\n           45,   17,   47,   31,   69,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,   71,  173,  165,   37,  173,  170,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  168,   36,  169,   59,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,  173,  173,  173,  173,\n          173,  173,  173,  173,  173,  173,    1,    2,    3,    4,\n            5,    6,    7,    8,   10,   11,   12,   13,   14,   15,\n           16,   18,   19,   20,   21,   22,   23,   24,   25,   26,\n           27,   28,   29,   30,   33,   34,   35,   38,   39,   40,\n           41,   42,   43,   44,   46,   48,   49,   50,   58,   60,\n           61,   62,   63,   64,   65,   66,   67,   68,   70,   72,\n           73,   74,   75,   76,   77,   78,   79,   80,   81,   82,\n           83,   84,   85,   86,   87,   88,   89,   90,   91,   92,\n           93,   94,   95,   96,   97,   98,   99,  100,  101,  102,\n          103,  104,  105,  106,  107,  108,  109,  110,  111,  112,\n          113,  114,  115,  116,  117,  118,  119,  120,  121,  122,\n          123,  124,  125,  126,  127,  128,  129,  130,  131,  132,\n          133,  134,  135,  136,  137,  138,  139,  140,  141,  142,\n          143,  144,  145,  146,  147,  148,  149,  150,  151,  152,\n          153,  154,  155,  156,  157,  158,  159,  160,  161,  162,\n          163\n    );\n\n    protected array $action = array(\n          133,  134,  135,  575,  136,  137, 1049,  766,  767,  768,\n          138,   41,  850, -341,  495, 1390,-32766,-32766,-32766, 1008,\n          841, 1145, 1146, 1147, 1141, 1140, 1139, 1148, 1142, 1143,\n         1144,-32766,-32766,-32766, -195,  760,  759,-32766, -194,-32766,\n        -32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,-32767,-32767,\n        -32767,    0,-32766,    3,    4,  769, 1145, 1146, 1147, 1141,\n         1140, 1139, 1148, 1142, 1143, 1144,  388,  389,  448,  272,\n           53,  391,  773,  774,  775,  776,  433,    5,  434,  571,\n          337,   39,  254,   29,  298,  830,  777,  778,  779,  780,\n          781,  782,  783,  784,  785,  786,  806,  576,  807,  808,\n          809,  810,  798,  799,  353,  354,  801,  802,  787,  788,\n          789,  791,  792,  793,  364,  833,  834,  835,  836,  837,\n          577, -382,  306, -382,  794,  795,  578,  579,  244,  818,\n          816,  817,  829,  813,  814, 1313,   38,  580,  581,  812,\n          582,  583,  584,  585, 1325,  586,  587,  481,  482, -628,\n          496, 1009,  815,  588,  589,  140,  139, -628,  133,  134,\n          135,  575,  136,  137, 1085,  766,  767,  768,  138,   41,\n        -32766, -341, 1046, 1041, 1040, 1039, 1045, 1042, 1043, 1044,\n        -32766,-32766,-32766,-32767,-32767,-32767,-32767,  106,  107,  108,\n          109,  110, -195,  760,  759, 1058, -194,-32766,-32766,-32766,\n          149,-32766,  852,-32766,-32766,-32766,-32766,-32766,-32766,-32766,\n          936,  303,  257,  769,-32766,-32766,-32766,  850,-32766,  297,\n        -32766,-32766,-32766,-32766,-32766, 1371, 1355,  272,   53,  391,\n          773,  774,  775,  776, -625,-32766,  434,-32766,-32766,-32766,\n        -32766,  730, -625,  830,  777,  778,  779,  780,  781,  782,\n          783,  784,  785,  786,  806,  576,  807,  808,  809,  810,\n          798,  799,  353,  354,  801,  802,  787,  788,  789,  791,\n          792,  793,  364,  833,  834,  835,  836,  837,  577, -579,\n         -275,  317,  794,  795,  578,  579, -577,  818,  816,  817,\n          829,  813,  814,  957,  926,  580,  581,  812,  582,  583,\n          584,  585,  144,  586,  587,  841,  336,-32766,-32766,-32766,\n          815,  588,  589, -628,  139, -628,  133,  134,  135,  575,\n          136,  137, 1082,  766,  767,  768,  138,   41,-32766, 1375,\n        -32766,-32766,-32766,-32766,-32766,-32766,-32766, 1374,  629,  388,\n          389,-32766,-32766,-32766,-32766,-32766, -579, -579, 1081,  433,\n          321,  760,  759, -577, -577,-32766, 1293,-32766,-32766,  111,\n          112,  113, -579,  282,  843,  851,  623, 1400,  936, -577,\n         1401,  769,  333,  938, -585,  114, -579,  725,  294,  298,\n         1119, -584,  349, -577,  752,  272,   53,  391,  773,  774,\n          775,  776,  145,   86,  434,  306,  336,  336, -625,  731,\n         -625,  830,  777,  778,  779,  780,  781,  782,  783,  784,\n          785,  786,  806,  576,  807,  808,  809,  810,  798,  799,\n          353,  354,  801,  802,  787,  788,  789,  791,  792,  793,\n          364,  833,  834,  835,  836,  837,  577, -576,  850, -578,\n          794,  795,  578,  579,  845,  818,  816,  817,  829,  813,\n          814,  727,  926,  580,  581,  812,  582,  583,  584,  585,\n          740,  586,  587,  243, 1055,-32766,-32766,  -85,  815,  588,\n          589,  878,  152,  879,  133,  134,  135,  575,  136,  137,\n         1087,  766,  767,  768,  138,   41,  350,  961,  960, 1058,\n         1058, 1058,-32766,-32766,-32766,  841,-32766,  131,  977,  978,\n          400, 1055,   10,  979, -576, -576, -578, -578,  378,  760,\n          759,  936,  973,  290,  297,  297,-32766,  846,  936,  154,\n         -576,   79, -578,  382,  849,  936, 1058,  336,  878,  769,\n          879,  938, -583,  -85, -576,  725, -578,  959,  108,  109,\n          110, 1058,  732,  272,   53,  391,  773,  774,  775,  776,\n          290,  155,  434,  470,  471,  472,  735,  760,  759,  830,\n          777,  778,  779,  780,  781,  782,  783,  784,  785,  786,\n          806,  576,  807,  808,  809,  810,  798,  799,  353,  354,\n          801,  802,  787,  788,  789,  791,  792,  793,  364,  833,\n          834,  835,  836,  837,  577,  926,  434,  847,  794,  795,\n          578,  579,  926,  818,  816,  817,  829,  813,  814,  926,\n          398,  580,  581,  812,  582,  583,  584,  585,  452,  586,\n          587,  157,   87,   88,   89,  453,  815,  588,  589,  454,\n          152,  790,  761,  762,  763,  764,  765,  158,  766,  767,\n          768,  803,  804,   40,   27,   90,   91,   92,   93,   94,\n           95,   96,   97,   98,   99,  100,  101,  102,  103,  104,\n          105,  106,  107,  108,  109,  110,  111,  112,  113, 1134,\n          282, 1055,  455,-32766,  994, 1288, 1287, 1289,  725,  390,\n          389,  938,  114,  856, 1120,  725,  769,  159,  938,  433,\n          672,   23,  725, 1118,  691,  692, 1058,-32766,  153,  416,\n          770,  771,  772,  773,  774,  775,  776,  -78, -619,  839,\n         -619, -581,  386,  387,  392,  393,  830,  777,  778,  779,\n          780,  781,  782,  783,  784,  785,  786,  806,  828,  807,\n          808,  809,  810,  798,  799,  800,  827,  801,  802,  787,\n          788,  789,  791,  792,  793,  832,  833,  834,  835,  836,\n          837,  838,  161,  663,  664,  794,  795,  796,  797,   36,\n          818,  816,  817,  829,  813,  814,  -58,  -57,  805,  811,\n          812,  819,  820,  822,  821,  -87,  823,  824, -581, -581,\n          128,  129,  141,  815,  826,  825,   54,   55,   56,   57,\n          527,   58,   59,  142, -110,  148,  162,   60,   61, -110,\n           62, -110,  936,  163,  164,  165,  313,  166, -581, -110,\n         -110, -110, -110, -110, -110, -110, -110, -110, -110, -110,\n         1293,  -84,  953,  -78,  -73,  -72,  -71,  -70,  -69,  -68,\n          -67,  -66,  -65,  742,  -46,   63,   64,  -18, -575, 1286,\n          146,   65,   51,   66,  251,  252,   67,   68,   69,   70,\n           71,   72,   73,   74,  281,   31,  273,   47,  450,  528,\n          291, -357,  741, 1319, 1320,  529,  744,  850,  935,  151,\n          295, 1317,   45,   22,  530, 1284,  531, -309,  532, -305,\n          533,  286,  936,  534,  535,  287,  926,  292,   48,   49,\n          456,  385,  384,  293,   50,  536,  342,  296,  282, 1057,\n          376,  348,  850,  299,  300, -575, -575, 1279,  114,  307,\n          308,  701,  538,  539,  540,  150,  841,-32766, 1288, 1287,\n         1289, -575,  850,  294,  542,  543, 1402, 1305, 1306, 1307,\n         1308, 1310, 1302, 1303,  305, -575,  716, -110, -110,  130,\n         1309, 1304, -110,  593, 1288, 1287, 1289,  306,   13,  673,\n           75, -110, 1152,  678,  331,  332,  336, -154, -154, -154,\n        -32766,  718,  694,   -4,  936,  938,  926,  314,  478,  725,\n          506, 1324, -154,  705, -154,  679, -154,  695, -154,  974,\n         1326, -541,  306,  312,  311,   79,  849,  661,  383,   43,\n          320,  336,   37, 1252,    0,    0,   52,    0,    0,  977,\n          978,    0,  760,  759,  537,-32766,    0,    0,    0,  706,\n            0,    0,  912,  973, -110, -110, -110,   35,  115,  116,\n          117,  118,  119,  120,  121,  122,  123,  124,  125,  126,\n          127, -531,   11,  707,  708,   31,  274,   30,  380,  955,\n          599, -613,  306,  627,    0,  938,    0,  850,  926,  725,\n         -154, 1317, 1288, 1287, 1289,   44, -612,  749,  290,  750,\n         1194, 1196,  869,  309,  310,  917, 1018,  995, 1002,  992,\n          383, -575,  446, 1003,  915,  990, 1123,  304, 1126,  381,\n         1127,  977,  978, 1124, 1125, 1131,  537, 1279, 1314,  861,\n          330,  760,  759,  132,  541,  973, -110, -110, -110, 1341,\n         1359, 1393, 1293,  666,  542,  543, -611, 1305, 1306, 1307,\n         1308, 1310, 1302, 1303, -585, -584, -583, -582,   21, -525,\n         1309, 1304,    1,   32,  760,  759,   33,  938,-32766, -278,\n           77,  725,   -4,  -16, 1286,  332,  336,   42, -575, -575,\n           46,-32766,-32766,-32766,   76,-32766,   80,-32766,   81,-32766,\n           82,   83,-32766,   84, -575,   85,  147,-32766,-32766,-32766,\n          156,-32766,  160,-32766,-32766,  249,  379, 1286, -575,-32766,\n          430,   31,  273,  338,-32766,-32766,-32766,  365,-32766,  366,\n        -32766,-32766,-32766,  850,  850,-32766,  367, 1317,  368,  369,\n        -32766,-32766,-32766,  370,  371,  372,-32766,-32766,  373,  374,\n          375,  377,-32766,  430,  447,  570,   31,  274, -276, -275,\n           15,   16,   78,   17,-32766,   18,   20,  414,  850, -110,\n         -110,  497, 1317, 1279, -110,  498,  505,  508,  509,  510,\n          511,  515,  516, -110,  517,  525,  604,  711, 1088, 1084,\n         1234,  543,-32766, 1305, 1306, 1307, 1308, 1310, 1302, 1303,\n         1315, 1086, 1083,  -50, 1064, 1274, 1309, 1304, 1279, 1060,\n         -280, -102,   14,   19,  306,   24,   77,   79,  415,  303,\n          413,  332,  336,  336,  618,  624,  543,  652, 1305, 1306,\n         1307, 1308, 1310, 1302, 1303,  717,  143, 1238, 1292, 1235,\n         1372, 1309, 1304,  726,  729,  733,-32766,  734,  736,  737,\n          738,   77, 1286,  419,  739,  743,  332,  336,  728,-32766,\n        -32766,-32766,  746,-32766,  913,-32766, 1397,-32766, 1399,  872,\n        -32766,  871,  967, 1010, 1398,-32766,-32766,-32766,  966,-32766,\n          964,-32766,-32766,  965,  968, 1286, 1267,-32766,  430,  946,\n          956,  944,-32766,-32766,-32766, 1000,-32766, 1001,-32766,-32766,\n        -32766,  650, 1396,-32766, 1353, 1342, 1360, 1369,-32766,-32766,\n        -32766, 1318,-32766,  336,-32766,-32766,  936,    0, 1286,    0,\n        -32766,  430,    0,    0,    0,-32766,-32766,-32766,    0,-32766,\n            0,-32766,-32766,-32766,    0,    0,-32766,    0,    0,  936,\n            0,-32766,-32766,-32766,    0,-32766,    0,-32766,-32766,    0,\n            0, 1286,    0,-32766,  430,    0,    0,    0,-32766,-32766,\n        -32766,    0,-32766,    0,-32766,-32766,-32766,    0,    0,-32766,\n            0,    0,    0,  501,-32766,-32766,-32766,    0,-32766,    0,\n        -32766,-32766,    0,    0, 1286,  606,-32766,  430,    0,    0,\n            0,-32766,-32766,-32766,    0,-32766,    0,-32766,-32766,-32766,\n          926,    0,-32766,    2,    0,    0,    0,-32766,-32766,-32766,\n            0,    0,    0,-32766,-32766,    0, -253, -253, -253,-32766,\n          430,    0,  383,  926,    0,    0,    0,    0,    0,    0,\n            0,-32766,    0,  977,  978,    0,    0,    0,  537, -252,\n         -252, -252,    0,    0,    0,  383,  912,  973, -110, -110,\n         -110,    0,    0,    0,    0,    0,  977,  978,    0,    0,\n            0,  537,    0,    0,    0,    0,    0,    0,    0,  912,\n          973, -110, -110, -110,-32766,    0,    0,    0,    0,  938,\n         1286,    0,    0,  725, -253,    0,    0,-32766,-32766,-32766,\n            0,-32766,    0,-32766,    0,-32766,    0,    0,-32766,    0,\n            0,    0,  938,-32766,-32766,-32766,  725, -252,    0,-32766,\n        -32766,    0,    0,    0,    0,-32766,  430,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,-32766\n    );\n\n    protected array $actionCheck = array(\n            3,    4,    5,    6,    7,    8,    1,   10,   11,   12,\n           13,   14,   83,    9,   32,   86,   10,   11,   12,   32,\n           81,  117,  118,  119,  120,  121,  122,  123,  124,  125,\n          126,   10,   11,   12,    9,   38,   39,   31,    9,   33,\n           34,   35,   36,   37,   38,   39,   40,   41,   42,   43,\n           44,    0,   31,    9,    9,   58,  117,  118,  119,  120,\n          121,  122,  123,  124,  125,  126,  107,  108,  109,   72,\n           73,   74,   75,   76,   77,   78,  117,    9,   81,   86,\n           71,  152,  153,    9,   31,   88,   89,   90,   91,   92,\n           93,   94,   95,   96,   97,   98,   99,  100,  101,  102,\n          103,  104,  105,  106,  107,  108,  109,  110,  111,  112,\n          113,  114,  115,  116,  117,  118,  119,  120,  121,  122,\n          123,  107,  163,  109,  127,  128,  129,  130,   15,  132,\n          133,  134,  135,  136,  137,    1,    9,  140,  141,  142,\n          143,  144,  145,  146,  151,  148,  149,  138,  139,    1,\n          168,  164,  155,  156,  157,    9,  159,    9,    3,    4,\n            5,    6,    7,    8,  167,   10,   11,   12,   13,   14,\n          117,  167,  119,  120,  121,  122,  123,  124,  125,  126,\n           10,   11,   12,   45,   46,   47,   48,   49,   50,   51,\n           52,   53,  167,   38,   39,  142,  167,   10,   11,   12,\n            9,   31,    1,   33,   34,   35,   36,   37,   38,   39,\n            1,  167,    9,   58,   10,   11,   12,   83,   31,  166,\n           33,   34,   35,   36,   37,    1,    1,   72,   73,   74,\n           75,   76,   77,   78,    1,   31,   81,   33,   34,   35,\n           36,   32,    9,   88,   89,   90,   91,   92,   93,   94,\n           95,   96,   97,   98,   99,  100,  101,  102,  103,  104,\n          105,  106,  107,  108,  109,  110,  111,  112,  113,  114,\n          115,  116,  117,  118,  119,  120,  121,  122,  123,   71,\n          167,    9,  127,  128,  129,  130,   71,  132,  133,  134,\n          135,  136,  137,    1,   85,  140,  141,  142,  143,  144,\n          145,  146,  168,  148,  149,   81,  172,   10,   11,   12,\n          155,  156,  157,  165,  159,  167,    3,    4,    5,    6,\n            7,    8,  167,   10,   11,   12,   13,   14,   31,    1,\n           33,   34,   35,   10,   10,   11,   12,    9,   52,  107,\n          108,   10,   11,   12,   10,   11,  138,  139,    1,  117,\n            9,   38,   39,  138,  139,   31,    1,   33,   34,   54,\n           55,   56,  154,   58,   81,  164,    1,   81,    1,  154,\n           84,   58,    9,  164,  166,   70,  168,  168,   31,   31,\n          164,  166,    9,  168,  168,   72,   73,   74,   75,   76,\n           77,   78,  168,  168,   81,  163,  172,  172,  165,   32,\n          167,   88,   89,   90,   91,   92,   93,   94,   95,   96,\n           97,   98,   99,  100,  101,  102,  103,  104,  105,  106,\n          107,  108,  109,  110,  111,  112,  113,  114,  115,  116,\n          117,  118,  119,  120,  121,  122,  123,   71,   83,   71,\n          127,  128,  129,  130,  161,  132,  133,  134,  135,  136,\n          137,  168,   85,  140,  141,  142,  143,  144,  145,  146,\n          168,  148,  149,   98,  117,  117,  117,   32,  155,  156,\n          157,  107,  159,  109,    3,    4,    5,    6,    7,    8,\n          167,   10,   11,   12,   13,   14,    9,   73,   74,  142,\n          142,  142,   10,   11,   12,   81,  141,   15,  118,  119,\n          107,  117,  109,  123,  138,  139,  138,  139,    9,   38,\n           39,    1,  132,  166,  166,  166,  117,   81,    1,   15,\n          154,  166,  154,    9,  160,    1,  142,  172,  107,   58,\n          109,  164,  166,   98,  168,  168,  168,  123,   51,   52,\n           53,  142,   32,   72,   73,   74,   75,   76,   77,   78,\n          166,   15,   81,  133,  134,  135,   32,   38,   39,   88,\n           89,   90,   91,   92,   93,   94,   95,   96,   97,   98,\n           99,  100,  101,  102,  103,  104,  105,  106,  107,  108,\n          109,  110,  111,  112,  113,  114,  115,  116,  117,  118,\n          119,  120,  121,  122,  123,   85,   81,  161,  127,  128,\n          129,  130,   85,  132,  133,  134,  135,  136,  137,   85,\n            9,  140,  141,  142,  143,  144,  145,  146,    9,  148,\n          149,   15,   10,   11,   12,    9,  155,  156,  157,    9,\n          159,    3,    4,    5,    6,    7,    8,   15,   10,   11,\n           12,   13,   14,   31,  102,   33,   34,   35,   36,   37,\n           38,   39,   40,   41,   42,   43,   44,   45,   46,   47,\n           48,   49,   50,   51,   52,   53,   54,   55,   56,  127,\n           58,  117,    9,  117,  164,  160,  161,  162,  168,  107,\n          108,  164,   70,    9,  169,  168,   58,   15,  164,  117,\n           76,   77,  168,    1,   76,   77,  142,  141,  102,  103,\n           72,   73,   74,   75,   76,   77,   78,   17,  165,   81,\n          167,   71,  107,  108,  107,  108,   88,   89,   90,   91,\n           92,   93,   94,   95,   96,   97,   98,   99,  100,  101,\n          102,  103,  104,  105,  106,  107,  108,  109,  110,  111,\n          112,  113,  114,  115,  116,  117,  118,  119,  120,  121,\n          122,  123,   15,  112,  113,  127,  128,  129,  130,   15,\n          132,  133,  134,  135,  136,  137,   17,   17,  140,  141,\n          142,  143,  144,  145,  146,   32,  148,  149,  138,  139,\n           17,   17,   17,  155,  156,  157,    2,    3,    4,    5,\n            6,    7,    8,   17,  102,   17,   17,   13,   14,  107,\n           16,  109,    1,   17,   17,   17,  114,   17,  168,  117,\n          118,  119,  120,  121,  122,  123,  124,  125,  126,  127,\n            1,   32,   39,   32,   32,   32,   32,   32,   32,   32,\n           32,   32,   32,   32,   32,   51,   52,   32,   71,   81,\n           32,   57,   71,   59,   60,   61,   62,   63,   64,   65,\n           66,   67,   68,   69,   32,   71,   72,   73,   74,   75,\n           32,  169,   32,   79,   80,   81,   32,   83,   32,   32,\n           38,   87,   88,   89,   90,  117,   92,   36,   94,   36,\n           96,   36,    1,   99,  100,   36,   85,   36,  104,  105,\n          106,  107,  108,   36,  110,  111,   36,   38,   58,  141,\n          116,  117,   83,   38,   38,  138,  139,  123,   70,  138,\n          139,   78,  128,  129,  130,   71,   81,   86,  160,  161,\n          162,  154,   83,   31,  140,  141,   84,  143,  144,  145,\n          146,  147,  148,  149,  150,  168,   81,  118,  119,  168,\n          156,  157,  123,   90,  160,  161,  162,  163,   98,   91,\n          166,  132,   83,   97,  170,  171,  172,   76,   77,   78,\n          141,   93,   95,    0,    1,  164,   85,  115,   98,  168,\n           98,  151,   91,   81,   93,  101,   95,  101,   97,  132,\n          151,  154,  163,  137,  136,  166,  160,  114,  107,  164,\n          136,  172,  168,  170,   -1,   -1,   71,   -1,   -1,  118,\n          119,   -1,   38,   39,  123,  141,   -1,   -1,   -1,  117,\n           -1,   -1,  131,  132,  133,  134,  135,   17,   18,   19,\n           20,   21,   22,   23,   24,   25,   26,   27,   28,   29,\n           30,  154,  154,  141,  142,   71,   72,  154,  154,  159,\n          158,  166,  163,  158,   -1,  164,   -1,   83,   85,  168,\n          169,   87,  160,  161,  162,  164,  166,  164,  166,  164,\n           60,   61,  164,  138,  139,  164,  164,  164,  164,  164,\n          107,   71,  109,  164,  164,  164,  164,  114,  164,  154,\n          164,  118,  119,  164,  164,  164,  123,  123,  165,  165,\n          168,   38,   39,  168,  131,  132,  133,  134,  135,  165,\n          165,  165,    1,  165,  140,  141,  166,  143,  144,  145,\n          146,  147,  148,  149,  166,  166,  166,  166,  155,  166,\n          156,  157,  166,  166,   38,   39,  166,  164,   75,  167,\n          166,  168,  169,   32,   81,  171,  172,  166,  138,  139,\n          166,   88,   89,   90,  166,   92,  166,   94,  166,   96,\n          166,  166,   99,  166,  154,  166,  166,  104,  105,  106,\n          166,   75,  166,  110,  111,  166,  168,   81,  168,  116,\n          117,   71,   72,  166,   88,   89,   90,  166,   92,  166,\n           94,  128,   96,   83,   83,   99,  166,   87,  166,  166,\n          104,  105,  106,  166,  166,  166,  110,  111,  166,  166,\n          166,  166,  116,  117,  166,  166,   71,   72,  167,  167,\n          167,  167,  159,  167,  128,  167,  167,  167,   83,  118,\n          119,  167,   87,  123,  123,  167,  167,  167,  167,  167,\n          167,  167,  167,  132,  167,  167,  167,  167,  167,  167,\n          167,  141,  141,  143,  144,  145,  146,  147,  148,  149,\n          167,  167,  167,   32,  167,  167,  156,  157,  123,  167,\n          167,  167,  167,  167,  163,  167,  166,  166,  169,  167,\n          167,  171,  172,  172,  167,  167,  141,  167,  143,  144,\n          145,  146,  147,  148,  149,  167,   32,  167,  167,  167,\n          167,  156,  157,  168,  168,  168,   75,  168,  168,  168,\n          168,  166,   81,  169,  168,  168,  171,  172,  168,   88,\n           89,   90,  169,   92,  169,   94,  169,   96,  169,  169,\n           99,  169,  169,  169,  169,  104,  105,  106,  169,   75,\n          169,  110,  111,  169,  169,   81,  169,  116,  117,  169,\n          169,  169,   88,   89,   90,  169,   92,  169,   94,  128,\n           96,  169,  169,   99,  169,  169,  169,  169,  104,  105,\n          106,  171,   75,  172,  110,  111,    1,   -1,   81,   -1,\n          116,  117,   -1,   -1,   -1,   88,   89,   90,   -1,   92,\n           -1,   94,  128,   96,   -1,   -1,   99,   -1,   -1,    1,\n           -1,  104,  105,  106,   -1,   75,   -1,  110,  111,   -1,\n           -1,   81,   -1,  116,  117,   -1,   -1,   -1,   88,   89,\n           90,   -1,   92,   -1,   94,  128,   96,   -1,   -1,   99,\n           -1,   -1,   -1,  103,  104,  105,  106,   -1,   75,   -1,\n          110,  111,   -1,   -1,   81,   82,  116,  117,   -1,   -1,\n           -1,   88,   89,   90,   -1,   92,   -1,   94,  128,   96,\n           85,   -1,   99,  166,   -1,   -1,   -1,  104,  105,  106,\n           -1,   -1,   -1,  110,  111,   -1,  101,  102,  103,  116,\n          117,   -1,  107,   85,   -1,   -1,   -1,   -1,   -1,   -1,\n           -1,  128,   -1,  118,  119,   -1,   -1,   -1,  123,  101,\n          102,  103,   -1,   -1,   -1,  107,  131,  132,  133,  134,\n          135,   -1,   -1,   -1,   -1,   -1,  118,  119,   -1,   -1,\n           -1,  123,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  131,\n          132,  133,  134,  135,   75,   -1,   -1,   -1,   -1,  164,\n           81,   -1,   -1,  168,  169,   -1,   -1,   88,   89,   90,\n           -1,   92,   -1,   94,   -1,   96,   -1,   -1,   99,   -1,\n           -1,   -1,  164,  104,  105,  106,  168,  169,   -1,  110,\n          111,   -1,   -1,   -1,   -1,  116,  117,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,   -1,   -1,  128\n    );\n\n    protected array $actionBase = array(\n            0,  155,   -3,  313,  471,  471,  881,  963, 1365, 1388,\n          892,  134,  515,  -61,  367,  524,  524,  801,  524,  209,\n          510,  283,  517,  517,  517,  920,  855,  628,  628,  855,\n          628, 1053, 1053, 1053, 1053, 1086, 1086, 1320, 1320, 1353,\n         1254, 1221, 1449, 1449, 1449, 1449, 1449, 1287, 1449, 1449,\n         1449, 1449, 1449, 1287, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449, 1449,\n         1449, 1449, 1449, 1449, 1449, 1449, 1449,  201,  -13,   44,\n          365,  744, 1102, 1120, 1107, 1121, 1096, 1095, 1103, 1108,\n         1122, 1183, 1185,  837, 1186, 1187, 1182, 1188, 1110,  938,\n         1098, 1118,  612,  612,  612,  612,  612,  612,  612,  612,\n          612,  612,  612,  612,  612,  612,  612,  612,  612,  612,\n          612,  612,  612,  612,  612,  612,  612,  612,  612,  612,\n          323,  482,  334,  331,  331,  331,  331,  331,  331,  331,\n          331,  331,  331,  331,  331,  331,  331,  331,  331,  331,\n          331,  331,  331,  964,  964,   21,   21,   21,  324, 1135,\n         1100, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135,  297,\n          204, 1000,  187,  170,  170,    6,    6,    6,    6,    6,\n          692,   53, 1101,  819,  819,  138,  138,  138,  138,  542,\n           14,  347,  355,  -41,  348,  232,  384,  384,  487,  487,\n          554,  554,  349,  349,  554,  554,  554,  399,  399,  399,\n          399,  208,  215,  366,  364,   -7,  864,  224,  224,  224,\n          224,  864,  864,  864,  864,  829, 1190,  864, 1011, 1027,\n          864,  864,  368,  767,  767,  925,  305,  305,  305,  767,\n          421,  -71,  -71,  421,  380,  -71,  225,  286,  556,  847,\n          572,  543,  556,  640,  771,  233,  148,  826,  605,  826,\n         1094,  831,  831,  802,  792,  921, 1140, 1123,  874, 1176,\n          876, 1178,  420,    9,  791, 1093, 1093, 1093, 1093, 1093,\n         1093, 1093, 1093, 1093, 1093, 1093, 1191,  519, 1094,  436,\n         1191, 1191, 1191,  519,  519,  519,  519,  519,  519,  519,\n          519,  805,  519,  519,  641,  436,  614,  618,  436,  860,\n          519,  877,  201,  201,  201,  201,  201,  201,  201,  201,\n          201,  201,  201,  -18,  201,  201,  -13,  292,  292,  201,\n          216,    5,  292,  292,  292,  292,  201,  201,  201,  201,\n          605,  840,  882,  607,  435,  885,   29,  840,  840,  840,\n            4,  113,   25,  841,  843,  393,  835,  835,  835,  869,\n          956,  956,  835,  839,  835,  869,  835,  835,  956,  956,\n          879,  956,  146,  609,  373,  514,  616,  956,  272,  835,\n          835,  835,  835,  854,  956,   45,   68,  620,  835,  203,\n          191,  835,  835,  854,  848,  828,  846,  956,  956,  956,\n          854,  499,  846,  846,  846,  893,  895,  873,  822,  363,\n          341,  674,  127,  783,  822,  822,  835,  601,  873,  822,\n          873,  822,  880,  822,  822,  822,  873,  822,  839,  477,\n          822,  779,  786,  663,   74,  822,   51,  978,  980,  743,\n          982,  971,  984, 1038,  985,  987, 1125,  953,  999,  974,\n          989, 1039,  960,  957,  836,  763,  764,  878,  827,  951,\n          838,  838,  838,  948,  949,  838,  838,  838,  838,  838,\n          838,  838,  838,  763,  923,  884,  853, 1013,  765,  776,\n         1069,  820, 1145,  823, 1011,  978,  987,  789,  974,  989,\n          960,  957,  800,  799,  797,  798,  796,  795,  793,  794,\n          808, 1071, 1072,  990,  825,  778, 1049, 1020, 1143,  922,\n         1022, 1023, 1050, 1073,  898, 1083, 1147,  844, 1149, 1150,\n          924, 1028, 1126,  838,  940,  875,  934, 1027,  950,  763,\n          935, 1084, 1085, 1043,  824, 1054, 1058,  998,  870,  842,\n          936, 1152, 1029, 1032, 1033, 1127, 1129,  891, 1044,  962,\n         1059,  872, 1099, 1060, 1061, 1062, 1063, 1130, 1153, 1131,\n          890, 1132,  901,  858, 1041,  856, 1154,  504,  851,  857,\n          866, 1035,  536, 1007, 1136, 1134, 1155, 1064, 1065, 1067,\n         1159, 1161,  994,  902, 1046,  867, 1048, 1042,  903,  904,\n          606,  865, 1087,  845,  849,  859,  622,  672, 1164, 1165,\n         1167,  996,  830,  833,  905,  909, 1088,  832, 1092, 1170,\n          737,  910, 1171, 1070,  787,  788,  690,  750,  749,  790,\n          868, 1137,  883,  852,  850, 1034,  788,  834,  911, 1172,\n          912,  914,  916, 1068,  919,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  628,  628,  628,  628,  784,  784,\n          784,  784,  784,  784,  784,  628,  784,  784,  784,  628,\n          628,    0,    0,  628,    0,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  784,  784,  784,  784,  784,  784,  784,  784,  784,\n          784,  612,  612,  612,  612,  612,  612,  612,  612,  612,\n          612,  612,  612,  612,  612,  612,  612,  612,  612,  612,\n          612,  612,  612,  612,  612,  612,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,  612,  612,  612,  612,  612,  612,\n          612,  612,  612,  612,  612,  612,  612,  612,  612,  612,\n          612,  612,  612,  612,  612,  612,  612,  758,  758,  612,\n          612,  612,  612,  758,  758,  758,  758,  758,  758,  758,\n          758,  758,  758,  612,  612,    0,  612,  612,  612,  612,\n          612,  612,  612,  612,  879,  758,  758,  758,  758,  305,\n          305,  305,  305,  -96,  -96,  758,  758,  380,  758,  380,\n          758,  758,  305,  305,  758,  758,  758,  758,  758,  758,\n          758,  758,  758,  758,  758,    0,    0,    0,  436,  -71,\n          758,  839,  839,  839,  839,  758,  758,  758,  758,  -71,\n          -71,  758,  414,  414,  758,  758,    0,    0,    0,    0,\n            0,    0,    0,    0,  436,    0,    0,  436,    0,    0,\n          839,  839,  758,  380,  879,  328,  758,    0,    0,    0,\n            0,  436,  839,  436,  519,  -71,  -71,  519,  519,  292,\n          201,  328,  596,  596,  596,  596,    0,    0,  605,  879,\n          879,  879,  879,  879,  879,  879,  879,  879,  879,  879,\n          839,    0,  879,    0,  839,  839,  839,    0,    0,    0,\n            0,    0,    0,    0,    0,  956,    0,    0,    0,    0,\n            0,    0,    0,  839,    0,  956,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,  839,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,  838,  870,    0,    0,  870,\n            0,  838,  838,  838,    0,    0,    0,  865,  832\n    );\n\n    protected array $actionDefault = array(\n            3,32767,32767,32767,  102,  102,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,  100,\n        32767,  631,  631,  631,  631,32767,32767,  257,  102,32767,\n        32767,  500,  415,  415,  415,32767,32767,32767,  573,  573,\n          573,  573,  573,   17,32767,32767,32767,32767,32767,32767,\n        32767,  500,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,   36,    7,    8,   10,   11,   49,  338,\n          100,32767,32767,32767,32767,32767,32767,32767,32767,  102,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,  624,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,  403,  494,  504,  482,  483,  485,  486,  414,\n          574,  630,  344,  627,  342,  413,  146,  354,  343,  245,\n          261,  505,  262,  506,  509,  510,  218,  400,  150,  151,\n          446,  501,  448,  499,  503,  447,  420,  427,  428,  429,\n          430,  431,  432,  433,  434,  435,  436,  437,  438,  439,\n          418,  419,  502,32767,32767,  479,  478,  477,  444,32767,\n        32767,32767,32767,32767,32767,32767,32767,  102,32767,  445,\n          449,  417,  452,  450,  451,  468,  469,  466,  467,  470,\n        32767,  323,32767,32767,32767,  471,  472,  473,  474,  381,\n          379,32767,32767,  111,  323,  111,32767,32767,  459,  460,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,  517,  567,  476,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,  102,32767,32767,\n        32767,  100,  569,  441,  443,  537,  454,  455,  453,  421,\n        32767,  542,32767,  102,32767,  544,32767,32767,32767,32767,\n        32767,32767,32767,  568,32767,  575,  575,32767,  530,  100,\n          196,32767,  543,  196,  196,32767,32767,32767,32767,32767,\n        32767,32767,32767,  638,  530,  110,  110,  110,  110,  110,\n          110,  110,  110,  110,  110,  110,32767,  196,  110,32767,\n        32767,32767,  100,  196,  196,  196,  196,  196,  196,  196,\n          196,  545,  196,  196,  191,32767,  271,  273,  102,  592,\n          196,  547,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n          530,  464,  139,32767,  532,  139,  575,  456,  457,  458,\n          575,  575,  575,  319,  296,32767,32767,32767,32767,32767,\n          545,  545,  100,  100,  100,  100,32767,32767,32767,32767,\n          111,  516,   99,   99,   99,   99,   99,  103,  101,32767,\n        32767,32767,32767,  226,32767,  101,  101,   99,32767,  101,\n          101,32767,32767,  226,  228,  215,  230,32767,  596,  597,\n          226,  101,  230,  230,  230,  250,  250,  519,  325,  101,\n           99,  101,  101,  198,  325,  325,32767,  101,  519,  325,\n          519,  325,  200,  325,  325,  325,  519,  325,32767,  101,\n          325,  217,  403,   99,   99,  325,32767,32767,32767,  532,\n        32767,32767,32767,32767,32767,32767,32767,  225,32767,32767,\n        32767,32767,32767,32767,32767,32767,  562,32767,  580,  594,\n          462,  463,  465,  579,  577,  487,  488,  489,  490,  491,\n          492,  493,  496,  626,32767,  536,32767,32767,32767,  353,\n        32767,  636,32767,32767,32767,    9,   74,  525,   42,   43,\n           51,   57,  551,  552,  553,  554,  548,  549,  555,  550,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,  637,32767,  575,32767,\n        32767,32767,32767,  461,  557,  602,32767,32767,  576,  629,\n        32767,32767,32767,32767,32767,32767,32767,32767,  139,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,  562,\n        32767,  137,32767,32767,32767,32767,32767,32767,32767,32767,\n          558,32767,32767,32767,  575,32767,32767,32767,32767,  321,\n          318,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,  575,32767,32767,\n        32767,32767,32767,  298,32767,  315,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,  399,  532,  301,  303,  304,32767,\n        32767,32767,32767,  375,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,  153,  153,    3,    3,  356,\n          153,  153,  153,  356,  356,  153,  356,  356,  356,  153,\n          153,  153,  153,  153,  153,  283,  186,  265,  268,  250,\n          250,  153,  367,  153\n    );\n\n    protected array $goto = array(\n          202,  169,  202,  202,  202, 1056,  842,  712,  359,  670,\n          671,  598,  688,  689,  690,  748,  653,  655,  591,  929,\n          675,  930, 1090,  721,  699,  702, 1028,  710,  719, 1024,\n          171,  171,  171,  171,  226,  203,  199,  199,  181,  183,\n          221,  199,  199,  199,  199,  199, 1180,  200,  200,  200,\n          200,  200, 1180,  193,  194,  195,  196,  197,  198,  223,\n          221,  224,  550,  551,  431,  552,  555,  556,  557,  558,\n          559,  560,  561,  562,  172,  173,  174,  201,  175,  176,\n          177,  170,  178,  179,  180,  182,  220,  222,  225,  245,\n          248,  259,  260,  262,  263,  264,  265,  266,  267,  268,\n          269,  275,  276,  277,  278,  288,  289,  326,  327,  328,\n          437,  438,  439,  613,  227,  228,  229,  230,  231,  232,\n          233,  234,  235,  236,  237,  238,  239,  240,  241,  184,\n          242,  185,  194,  195,  196,  197,  198,  223,  204,  205,\n          206,  207,  246,  186,  187,  208,  188,  209,  205,  189,\n          247,  204,  168,  210,  211,  190,  212,  213,  214,  191,\n          215,  216,  192,  217,  218,  219,  285,  283,  285,  285,\n          870, 1089, 1091, 1094,  615,  255,  255,  255,  255,  255,\n          441,  677,  614, 1130,  884,  867,  436,  329,  323,  324,\n          345,  608,  440,  346,  442,  654,  724,  492,  521,  715,\n          896, 1128,  993,  883,  494,  253,  253,  253,  253,  250,\n          256,  489, 1361, 1362, 1386, 1386,  925,  920,  921,  934,\n          876,  922,  873,  923,  924,  874,  877,  363,  928,  881,\n          480,  480,  868,  880, 1386,  848,  474,  363,  363,  480,\n         1117, 1112, 1113, 1114, 1229,  351,  362,  362,  362,  362,\n         1389, 1389,  429,  363,  363, 1017,  902,  363,  989, 1403,\n          747,  360,  361,  566, 1026, 1021, 1056, 1285, 1285, 1285,\n          569,  352,  351,  363,  363,  605, 1056, 1285,  848, 1056,\n          848, 1056, 1056, 1137, 1138, 1056, 1056, 1056, 1056, 1056,\n         1056, 1056, 1056, 1056, 1056, 1056,  357, 1261,  962,  637,\n          674, 1285, 1262, 1265,  963, 1266, 1285, 1285, 1285, 1285,\n         1376,  435, 1285,  628,  402, 1285, 1285, 1368, 1368, 1368,\n         1368, 1347,  574,  567, 1062, 1061, 1059, 1059,  958,  958,\n          697,  970, 1014,  942, 1051, 1067, 1068,  943,  565,  565,\n          565,  603,  513,  522,  514,  863,  676,  863,  565,  709,\n          520, 1176,  318,  567,  574,  600,  601,  319,  611,  617,\n          844,  633,  634, 1080,    8,  709,    9,  449,  709,   28,\n         1065, 1066,  467,  335,  316,  569,  698,  987,  987,  987,\n          987, 1363, 1364,  467,  639,  639,  981,  988,  609,  631,\n         1316, 1316, 1316, 1316, 1316, 1316, 1316, 1316, 1316, 1316,\n         1335, 1335,  863,  469,  682,  469, 1335, 1335, 1335, 1335,\n         1335, 1335, 1335, 1335, 1335, 1335,  347,  258,  258,  626,\n          640,  643,  644,  645,  646,  667,  668,  669,  723,  632,\n          460,  860,  460,  460,  460, 1358, 1358, 1358,  553,  553,\n         1278,  985,  420,  720,  553, 1358,  553,  553,  553,  553,\n          553,  553,  553,  553,  451,  889,  568,  595,  568,  647,\n          649,  651,  568,  976,  595,  411,  405,  473,  886, 1276,\n         1370, 1370, 1370, 1370,  909,  866,  909,  909, 1036,  483,\n          612,  484,  485,  751,  563,  563,  563,  563,  894,  619,\n         1101, 1394, 1395,  412, 1332, 1332,  898,  490, 1151, 1354,\n         1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,\n          279, 1105,  334,  334,  334,  998,  892,    0, 1280, 1047,\n            0,    0,  863,    0,    0,  460,  460,  460,  460,  460,\n          460,  460,  460,  460,  460,  460,    0,    0,  460, 1103,\n          554,  554,    0, 1356, 1356, 1103,  554,  554,  554,  554,\n          554,  554,  554,  554,  554,  554,  621,  622,  417,  418,\n          947, 1166,    0,  686,    0,  687,    0,  422,  423,  424,\n            0,  700, 1033,    0,  425, 1281, 1282,    0, 1268,  355,\n          888,    0,  680, 1012,  858,    0,    0,    0,  882,  443,\n            0, 1268,    0,  897,  885, 1100, 1104,    0,    0,    0,\n         1275,    0,  443,    0, 1283, 1344, 1345,  996,    0,    0,\n         1063, 1063,    0,    0,    0,  681, 1074, 1070, 1071,  404,\n          407,  616,  620,    0,    0,    0,    0,    0,    0,    0,\n          986,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0, 1149,  901,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0, 1031, 1031\n    );\n\n    protected array $gotoCheck = array(\n           42,   42,   42,   42,   42,   73,    6,   73,   97,   86,\n           86,   48,   86,   86,   86,   48,   48,   48,  127,   65,\n           48,   65,  131,    9,   48,   48,   48,   48,   48,   48,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   23,   23,   23,   23,\n           15,  130,  130,  130,  134,    5,    5,    5,    5,    5,\n           66,   66,    8,    8,   35,   26,   66,   66,   66,   66,\n           66,   66,   66,   66,   66,   66,    8,   84,    8,    8,\n           35,    8,   49,   35,   84,    5,    5,    5,    5,    5,\n            5,  185,  185,  185,  191,  191,   15,   15,   15,   15,\n           15,   15,   15,   15,   15,   15,   15,   14,   15,   15,\n          157,  157,   27,   15,  191,   12,  159,   14,   14,  157,\n           15,   15,   15,   15,  159,  177,   24,   24,   24,   24,\n          191,  191,   43,   14,   14,   50,   45,   14,   50,   14,\n           50,   97,   97,   50,   50,   50,   73,   73,   73,   73,\n           14,  177,  177,   14,   14,  181,   73,   73,   12,   73,\n           12,   73,   73,  148,  148,   73,   73,   73,   73,   73,\n           73,   73,   73,   73,   73,   73,  188,   79,   79,   56,\n           56,   73,   79,   79,   79,   79,   73,   73,   73,   73,\n          190,   13,   73,   13,   62,   73,   73,    9,    9,    9,\n            9,   14,   76,   76,  119,  119,   89,   89,    9,    9,\n           89,   89,  103,   73,   89,   89,   89,   73,   19,   19,\n           19,  104,  163,   14,  163,   22,   64,   22,   19,    7,\n          163,  158,   76,   76,   76,   76,   76,   76,   76,   76,\n            7,   76,   76,  115,   46,    7,   46,  113,    7,   76,\n          120,  120,   19,  178,  178,   14,  117,   19,   19,   19,\n           19,  187,  187,   19,  108,  108,   19,   19,    2,    2,\n          108,  108,  108,  108,  108,  108,  108,  108,  108,  108,\n          179,  179,   22,   83,  121,   83,  179,  179,  179,  179,\n          179,  179,  179,  179,  179,  179,   29,    5,    5,   81,\n           81,   81,   81,   81,   81,   81,   81,   81,   81,   80,\n           23,   18,   23,   23,   23,  134,  134,  134,  165,  165,\n           14,   93,   93,   93,  165,  134,  165,  165,  165,  165,\n          165,  165,  165,  165,   83,   39,    9,    9,    9,   85,\n           85,   85,    9,   92,    9,   28,    9,    9,   37,  169,\n          134,  134,  134,  134,   25,   25,   25,   25,  110,    9,\n            9,    9,    9,   99,  107,  107,  107,  107,    9,  107,\n          133,    9,    9,   31,  180,  180,   41,  160,  151,  134,\n          180,  180,  180,  180,  180,  180,  180,  180,  180,  180,\n           24,  136,   24,   24,   24,   96,    9,   -1,   20,  114,\n           -1,   -1,   22,   -1,   -1,   23,   23,   23,   23,   23,\n           23,   23,   23,   23,   23,   23,   -1,   -1,   23,  134,\n          182,  182,   -1,  134,  134,  134,  182,  182,  182,  182,\n          182,  182,  182,  182,  182,  182,   17,   17,   82,   82,\n           17,   17,   -1,   82,   -1,   82,   -1,   82,   82,   82,\n           -1,   82,   17,   -1,   82,   20,   20,   -1,   20,   82,\n           17,   -1,   17,   17,   20,   -1,   -1,   -1,   17,  118,\n           -1,   20,   -1,   16,   16,   16,   16,   -1,   -1,   -1,\n           17,   -1,  118,   -1,   20,   20,   20,   16,   -1,   -1,\n          118,  118,   -1,   -1,   -1,  118,  118,  118,  118,   59,\n           59,   59,   59,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n           16,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n           -1,   -1,   -1,   16,   16,   -1,   -1,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,   -1,  107,  107\n    );\n\n    protected array $gotoBase = array(\n            0,    0, -339,    0,    0,  174,   -7,  339,  171,   10,\n            0,    0,  -69,  -36,  -78, -186,  130,   81,  114,   66,\n          117,    0,   62,  160,  240,  468,  178,  225,  118,  112,\n            0,   45,    0,    0,    0, -195,    0,  119,    0,  122,\n            0,   44,   -1,  226,    0,  227, -387,    0, -715,  182,\n          241,    0,    0,    0,    0,    0,  256,    0,    0,  570,\n            0,    0,  269,    0,  102,    3,  -63,    0,    0,    0,\n            0,    0,    0,   -5,    0,    0,  -31,    0,    0, -120,\n          110,   53,   54,  120, -286,  -33, -724,    0,    0,   40,\n            0,    0,  124,  129,    0,    0,   61, -488,    0,   67,\n            0,    0,    0,  294,  295,    0,    0,  453,  141,    0,\n          100,    0,    0,   83,   -3,   82,    0,   86,  318,   38,\n           78,  107,    0,    0,    0,    0,    0,   16,    0,    0,\n          168,   20,    0,  108,  163,    0,   58,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    4,    0,\n            0,   43,    0,    0,    0,    0,    0,  193,  101,  -38,\n           46,    0,    0, -166,    0,  195,    0,    0,    0,   92,\n            0,    0,    0,    0,    0,    0,    0,  -60,   42,  157,\n          251,  243,  297,    0,    0,  -97,    0,    1,  263,    0,\n          276, -101,    0,    0\n    );\n\n    protected array $gotoDefault = array(\n        -32768,  526,  755,    7,  756,  951,  831,  840,  590,  544,\n          722,  356,  641,  432, 1352,  927, 1165,  610,  859, 1294,\n         1300,  468,  862,  340,  745,  939,  910,  911,  408,  395,\n          875,  406,  665,  642,  507,  895,  464,  887,  499,  890,\n          463,  899,  167,  428,  524,  903,    6,  906,  572,  937,\n          991,  396,  914,  397,  693,  916,  594,  918,  919,  403,\n          409,  410, 1170,  602,  638,  931,  261,  596,  932,  394,\n          933,  941,  399,  401,  703,  479,  518,  512,  421, 1132,\n          597,  625,  662,  457,  486,  636,  648,  635,  493,  444,\n          426,  339,  975,  983,  500,  477,  997,  358, 1005,  753,\n         1178,  656,  502, 1013,  657, 1020, 1023,  545,  546,  491,\n         1035,  271, 1038,  503, 1048,   26,  683, 1053, 1054,  684,\n          658, 1076,  659,  685,  660, 1078,  476,  592, 1179,  475,\n         1093, 1099,  465, 1102, 1340,  466, 1106,  270, 1109,  284,\n          427,  445, 1115, 1116,   12, 1122,  713,  714,   25,  280,\n          523, 1150,  704,-32768,-32768,-32768,-32768,  462, 1177,  461,\n         1249, 1251,  573,  504, 1269,  301, 1272,  696,  519, 1277,\n          458, 1343,  459,  547,  487,  325,  548, 1387,  315,  343,\n          322,  564,  302,  344,  549,  488, 1349, 1357,  341,   34,\n         1377, 1388,  607,  630\n    );\n\n    protected array $ruleToNonTerminal = array(\n            0,    1,    3,    3,    2,    5,    5,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    7,    7,    7,\n            7,    7,    7,    7,    7,    8,    8,    9,   10,   11,\n           11,   11,   12,   12,   13,   13,   14,   15,   15,   16,\n           16,   17,   17,   18,   18,   21,   21,   22,   23,   23,\n           24,   24,    4,    4,    4,    4,    4,    4,    4,    4,\n            4,    4,    4,    4,   29,   29,   30,   30,   32,   34,\n           34,   28,   36,   36,   33,   38,   38,   35,   35,   37,\n           37,   39,   39,   31,   40,   40,   41,   43,   44,   44,\n           45,   45,   46,   46,   48,   47,   47,   47,   47,   49,\n           49,   49,   49,   49,   49,   49,   49,   49,   49,   49,\n           49,   49,   49,   49,   49,   49,   49,   49,   49,   49,\n           49,   49,   49,   25,   25,   50,   69,   69,   72,   72,\n           71,   70,   70,   63,   75,   75,   76,   76,   77,   77,\n           78,   78,   79,   79,   80,   80,   80,   80,   26,   26,\n           27,   27,   27,   27,   27,   88,   88,   90,   90,   83,\n           83,   91,   91,   92,   92,   92,   84,   84,   87,   87,\n           85,   85,   93,   94,   94,   57,   57,   65,   65,   68,\n           68,   68,   67,   95,   95,   96,   58,   58,   58,   58,\n           97,   97,   98,   98,   99,   99,  100,  101,  101,  102,\n          102,  103,  103,   55,   55,   51,   51,  105,   53,   53,\n          106,   52,   52,   54,   54,   64,   64,   64,   64,   81,\n           81,  109,  109,  111,  111,  112,  112,  112,  112,  112,\n          112,  112,  112,  110,  110,  110,  115,  115,  115,  115,\n           89,   89,  118,  118,  118,  119,  119,  116,  116,  120,\n          120,  122,  122,  123,  123,  117,  124,  124,  121,  125,\n          125,  125,  125,  113,  113,   82,   82,   82,   20,   20,\n           20,  128,  128,  128,  128,  129,  129,  129,  127,  126,\n          126,  131,  131,  131,  130,  130,   60,  132,  132,  133,\n           61,  135,  135,  136,  136,  137,  137,   86,  138,  138,\n          138,  138,  138,  138,  138,  143,  143,  144,  144,  145,\n          145,  145,  145,  145,  146,  147,  147,  142,  142,  139,\n          139,  141,  141,  149,  149,  148,  148,  148,  148,  148,\n          148,  148,  148,  148,  148,  140,  150,  150,  152,  151,\n          151,  153,  153,  114,  154,  154,  156,  156,  156,  155,\n          155,   62,  104,  157,  157,   56,   56,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,  164,  165,  165,  166,  158,  158,  163,\n          163,  167,  168,  168,  169,  170,  171,  171,  171,  171,\n           19,   19,   73,   73,   73,   73,  159,  159,  159,  159,\n          173,  173,  162,  162,  162,  160,  160,  179,  179,  179,\n          179,  179,  179,  179,  179,  179,  179,  180,  180,  180,\n          108,  182,  182,  182,  182,  161,  161,  161,  161,  161,\n          161,  161,  161,   59,   59,  176,  176,  176,  176,  176,\n          183,  183,  172,  172,  172,  172,  184,  184,  184,  184,\n          184,  184,   74,   74,   66,   66,   66,   66,  134,  134,\n          134,  134,  187,  186,  175,  175,  175,  175,  175,  175,\n          175,  174,  174,  174,  185,  185,  185,  185,  107,  181,\n          189,  189,  188,  188,  190,  190,  190,  190,  190,  190,\n          190,  190,  178,  178,  178,  178,  177,  192,  191,  191,\n          191,  191,  191,  191,  191,  191,  193,  193,  193,  193\n    );\n\n    protected array $ruleToLength = array(\n            1,    1,    2,    0,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    0,\n            1,    0,    1,    1,    2,    1,    3,    4,    1,    2,\n            0,    1,    1,    1,    1,    4,    3,    5,    4,    3,\n            4,    1,    3,    4,    1,    1,    8,    7,    2,    3,\n            1,    2,    3,    1,    2,    3,    1,    1,    3,    1,\n            3,    1,    2,    2,    3,    1,    3,    2,    3,    1,\n            3,    3,    2,    0,    1,    1,    1,    1,    1,    3,\n            7,   10,    5,    7,    9,    5,    3,    3,    3,    3,\n            3,    3,    1,    2,    5,    7,    9,    6,    5,    6,\n            3,    2,    1,    1,    1,    1,    0,    2,    1,    3,\n            8,    0,    4,    2,    1,    3,    0,    1,    0,    1,\n            0,    1,    3,    1,    1,    1,    1,    1,    8,    9,\n            7,    8,    7,    6,    8,    0,    2,    0,    2,    1,\n            2,    1,    2,    1,    1,    1,    0,    2,    0,    2,\n            0,    2,    2,    1,    3,    1,    4,    1,    4,    1,\n            1,    4,    2,    1,    3,    3,    3,    4,    4,    5,\n            0,    2,    4,    3,    1,    1,    7,    0,    2,    1,\n            3,    3,    4,    1,    4,    0,    2,    5,    0,    2,\n            6,    0,    2,    0,    3,    1,    2,    1,    1,    2,\n            0,    1,    3,    0,    2,    1,    1,    1,    1,    1,\n            1,    1,    1,    7,    9,    6,    1,    2,    1,    1,\n            1,    1,    1,    1,    1,    1,    3,    3,    3,    1,\n            3,    3,    3,    3,    3,    1,    3,    3,    1,    1,\n            2,    1,    1,    0,    1,    0,    2,    2,    2,    4,\n            3,    2,    4,    4,    3,    3,    1,    3,    1,    1,\n            3,    2,    2,    3,    1,    1,    2,    3,    1,    1,\n            2,    3,    1,    1,    3,    2,    0,    1,    5,    5,\n            6,   10,    3,    5,    1,    1,    3,    0,    2,    4,\n            5,    4,    4,    4,    3,    1,    1,    1,    1,    1,\n            1,    0,    1,    1,    2,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    2,    1,    3,    1,    1,\n            3,    0,    2,    0,    5,    8,    1,    3,    3,    0,\n            2,    2,    2,    3,    1,    0,    1,    1,    3,    3,\n            3,    4,    4,    1,    1,    2,    2,    3,    3,    3,\n            3,    3,    3,    3,    3,    3,    3,    3,    3,    3,\n            2,    2,    2,    2,    3,    3,    3,    3,    3,    3,\n            3,    3,    3,    3,    3,    3,    3,    3,    3,    3,\n            3,    3,    2,    2,    2,    2,    3,    3,    3,    3,\n            3,    3,    3,    3,    3,    3,    3,    5,    4,    3,\n            4,    4,    2,    2,    4,    2,    2,    2,    2,    2,\n            2,    2,    2,    2,    2,    2,    2,    1,    3,    2,\n            1,    2,    4,    2,    2,    8,    9,    8,    9,    9,\n           10,    9,   10,    8,    3,    2,    2,    1,    1,    0,\n            4,    2,    1,    3,    2,    1,    2,    2,    2,    4,\n            1,    1,    1,    1,    1,    1,    1,    1,    3,    1,\n            1,    1,    0,    1,    1,    0,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    3,    5,    3,\n            3,    4,    1,    1,    3,    1,    1,    1,    1,    1,\n            3,    2,    3,    0,    1,    1,    3,    1,    1,    1,\n            1,    1,    1,    3,    1,    1,    1,    4,    4,    1,\n            4,    4,    0,    1,    1,    1,    3,    3,    1,    4,\n            2,    2,    1,    3,    1,    4,    4,    3,    3,    3,\n            3,    1,    3,    1,    1,    3,    1,    1,    4,    1,\n            1,    1,    3,    1,    1,    2,    1,    3,    4,    3,\n            2,    0,    2,    2,    1,    2,    1,    1,    1,    4,\n            3,    3,    3,    3,    6,    3,    1,    1,    2,    1\n    );\n\n    protected function initReduceCallbacks(): void {\n        $this->reduceCallbacks = [\n            0 => null,\n            1 => static function ($self, $stackPos) {\n                 $self->semValue = $self->handleNamespaces($self->semStack[$stackPos-(1-1)]);\n            },\n            2 => static function ($self, $stackPos) {\n                 if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; } $self->semValue = $self->semStack[$stackPos-(2-1)];;\n            },\n            3 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            4 => static function ($self, $stackPos) {\n                 $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);;\n            if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            5 => null,\n            6 => null,\n            7 => null,\n            8 => null,\n            9 => null,\n            10 => null,\n            11 => null,\n            12 => null,\n            13 => null,\n            14 => null,\n            15 => null,\n            16 => null,\n            17 => null,\n            18 => null,\n            19 => null,\n            20 => null,\n            21 => null,\n            22 => null,\n            23 => null,\n            24 => null,\n            25 => null,\n            26 => null,\n            27 => null,\n            28 => null,\n            29 => null,\n            30 => null,\n            31 => null,\n            32 => null,\n            33 => null,\n            34 => null,\n            35 => null,\n            36 => null,\n            37 => null,\n            38 => null,\n            39 => null,\n            40 => null,\n            41 => null,\n            42 => null,\n            43 => null,\n            44 => null,\n            45 => null,\n            46 => null,\n            47 => null,\n            48 => null,\n            49 => null,\n            50 => null,\n            51 => null,\n            52 => null,\n            53 => null,\n            54 => null,\n            55 => null,\n            56 => null,\n            57 => null,\n            58 => null,\n            59 => null,\n            60 => null,\n            61 => null,\n            62 => null,\n            63 => null,\n            64 => null,\n            65 => null,\n            66 => null,\n            67 => null,\n            68 => null,\n            69 => null,\n            70 => null,\n            71 => null,\n            72 => null,\n            73 => null,\n            74 => null,\n            75 => null,\n            76 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)]; if ($self->semValue === \"<?=\") $self->emitError(new Error('Cannot use \"<?=\" as an identifier', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])));\n            },\n            77 => null,\n            78 => null,\n            79 => null,\n            80 => null,\n            81 => null,\n            82 => null,\n            83 => null,\n            84 => null,\n            85 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            86 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            87 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            88 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            89 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            90 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            91 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            92 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            93 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            94 => null,\n            95 => static function ($self, $stackPos) {\n                 $self->semValue = new Name(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            96 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            97 => static function ($self, $stackPos) {\n                 /* nothing */\n            },\n            98 => static function ($self, $stackPos) {\n                 /* nothing */\n            },\n            99 => static function ($self, $stackPos) {\n                 /* nothing */\n            },\n            100 => static function ($self, $stackPos) {\n                 $self->emitError(new Error('A trailing comma is not allowed here', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])));\n            },\n            101 => null,\n            102 => null,\n            103 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Attribute($self->semStack[$stackPos-(1-1)], [], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            104 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Attribute($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            105 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            106 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            107 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\AttributeGroup($self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            108 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            109 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            110 => static function ($self, $stackPos) {\n                 $self->semValue = [];\n            },\n            111 => null,\n            112 => null,\n            113 => null,\n            114 => null,\n            115 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\HaltCompiler($self->handleHaltCompiler(), $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            116 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Namespace_($self->semStack[$stackPos-(3-2)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            $self->semValue->setAttribute('kind', Stmt\\Namespace_::KIND_SEMICOLON);\n            $self->checkNamespace($self->semValue);\n            },\n            117 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Namespace_($self->semStack[$stackPos-(5-2)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            $self->semValue->setAttribute('kind', Stmt\\Namespace_::KIND_BRACED);\n            $self->checkNamespace($self->semValue);\n            },\n            118 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Namespace_(null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            $self->semValue->setAttribute('kind', Stmt\\Namespace_::KIND_BRACED);\n            $self->checkNamespace($self->semValue);\n            },\n            119 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Use_($self->semStack[$stackPos-(3-2)], Stmt\\Use_::TYPE_NORMAL, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            120 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Use_($self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            121 => null,\n            122 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Const_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), []);\n            },\n            123 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Const_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(4-1)]);\n            $self->checkConstantAttributes($self->semValue);\n            },\n            124 => static function ($self, $stackPos) {\n                 $self->semValue = Stmt\\Use_::TYPE_FUNCTION;\n            },\n            125 => static function ($self, $stackPos) {\n                 $self->semValue = Stmt\\Use_::TYPE_CONSTANT;\n            },\n            126 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\GroupUse($self->semStack[$stackPos-(8-3)], $self->semStack[$stackPos-(8-6)], $self->semStack[$stackPos-(8-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            },\n            127 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\GroupUse($self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-5)], Stmt\\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            },\n            128 => null,\n            129 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            130 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            131 => null,\n            132 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            133 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            134 => null,\n            135 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            136 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            137 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UseItem($self->semStack[$stackPos-(1-1)], null, Stmt\\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(1-1));\n            },\n            138 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UseItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], Stmt\\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(3-3));\n            },\n            139 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UseItem($self->semStack[$stackPos-(1-1)], null, Stmt\\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(1-1));\n            },\n            140 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UseItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], Stmt\\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(3-3));\n            },\n            141 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)]; $self->semValue->type = Stmt\\Use_::TYPE_NORMAL;\n            },\n            142 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)]; $self->semValue->type = $self->semStack[$stackPos-(2-1)];\n            },\n            143 => null,\n            144 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            145 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            146 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Const_($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            147 => null,\n            148 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            149 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            150 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Const_(new Node\\Identifier($self->semStack[$stackPos-(3-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)],  $self->tokenEndStack[$stackPos-(3-1)])), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            151 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Const_(new Node\\Identifier($self->semStack[$stackPos-(3-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)],  $self->tokenEndStack[$stackPos-(3-1)])), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            152 => static function ($self, $stackPos) {\n                 if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; } $self->semValue = $self->semStack[$stackPos-(2-1)];;\n            },\n            153 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            154 => static function ($self, $stackPos) {\n                 $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);;\n            if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            155 => null,\n            156 => null,\n            157 => null,\n            158 => static function ($self, $stackPos) {\n                 throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            159 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Block($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            160 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\If_($self->semStack[$stackPos-(7-3)], ['stmts' => $self->semStack[$stackPos-(7-5)], 'elseifs' => $self->semStack[$stackPos-(7-6)], 'else' => $self->semStack[$stackPos-(7-7)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            },\n            161 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\If_($self->semStack[$stackPos-(10-3)], ['stmts' => $self->semStack[$stackPos-(10-6)], 'elseifs' => $self->semStack[$stackPos-(10-7)], 'else' => $self->semStack[$stackPos-(10-8)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos]));\n            },\n            162 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\While_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            163 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Do_($self->semStack[$stackPos-(7-5)], $self->semStack[$stackPos-(7-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            },\n            164 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\For_(['init' => $self->semStack[$stackPos-(9-3)], 'cond' => $self->semStack[$stackPos-(9-5)], 'loop' => $self->semStack[$stackPos-(9-7)], 'stmts' => $self->semStack[$stackPos-(9-9)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            165 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Switch_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            166 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Break_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            167 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Continue_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            168 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Return_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            169 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Global_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            170 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Static_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            171 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Echo_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            172 => static function ($self, $stackPos) {\n\n        $self->semValue = new Stmt\\InlineHTML($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n        $self->semValue->setAttribute('hasLeadingNewline', $self->inlineHtmlHasLeadingNewline($stackPos-(1-1)));\n\n            },\n            173 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Expression($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            174 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Unset_($self->semStack[$stackPos-(5-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            175 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Foreach_($self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $self->semStack[$stackPos-(7-5)][1], 'stmts' => $self->semStack[$stackPos-(7-7)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            },\n            176 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Foreach_($self->semStack[$stackPos-(9-3)], $self->semStack[$stackPos-(9-7)][0], ['keyVar' => $self->semStack[$stackPos-(9-5)], 'byRef' => $self->semStack[$stackPos-(9-7)][1], 'stmts' => $self->semStack[$stackPos-(9-9)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            177 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Foreach_($self->semStack[$stackPos-(6-3)], new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(6-4)],  $self->tokenEndStack[$stackPos-(6-4)])), ['stmts' => $self->semStack[$stackPos-(6-6)]], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]));\n            },\n            178 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Declare_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            179 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TryCatch($self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-5)], $self->semStack[$stackPos-(6-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); $self->checkTryCatch($self->semValue);\n            },\n            180 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Goto_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            181 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Label($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            182 => static function ($self, $stackPos) {\n                 $self->semValue = null; /* means: no statement */\n            },\n            183 => null,\n            184 => static function ($self, $stackPos) {\n                 $self->semValue = $self->maybeCreateNop($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]);\n            },\n            185 => static function ($self, $stackPos) {\n                 if ($self->semStack[$stackPos-(1-1)] instanceof Stmt\\Block) { $self->semValue = $self->semStack[$stackPos-(1-1)]->stmts; } else if ($self->semStack[$stackPos-(1-1)] === null) { $self->semValue = []; } else { $self->semValue = [$self->semStack[$stackPos-(1-1)]]; };\n            },\n            186 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            187 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            188 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            189 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            190 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Catch_($self->semStack[$stackPos-(8-3)], $self->semStack[$stackPos-(8-4)], $self->semStack[$stackPos-(8-7)], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            },\n            191 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            192 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Finally_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            193 => null,\n            194 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            195 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            196 => static function ($self, $stackPos) {\n                 $self->semValue = false;\n            },\n            197 => static function ($self, $stackPos) {\n                 $self->semValue = true;\n            },\n            198 => static function ($self, $stackPos) {\n                 $self->semValue = false;\n            },\n            199 => static function ($self, $stackPos) {\n                 $self->semValue = true;\n            },\n            200 => static function ($self, $stackPos) {\n                 $self->semValue = false;\n            },\n            201 => static function ($self, $stackPos) {\n                 $self->semValue = true;\n            },\n            202 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            203 => static function ($self, $stackPos) {\n                 $self->semValue = [];\n            },\n            204 => null,\n            205 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            206 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            207 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            208 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Function_($self->semStack[$stackPos-(8-3)], ['byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-5)], 'returnType' => $self->semStack[$stackPos-(8-7)], 'stmts' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            },\n            209 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Function_($self->semStack[$stackPos-(9-4)], ['byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-6)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            210 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Class_($self->semStack[$stackPos-(7-2)], ['type' => $self->semStack[$stackPos-(7-1)], 'extends' => $self->semStack[$stackPos-(7-3)], 'implements' => $self->semStack[$stackPos-(7-4)], 'stmts' => $self->semStack[$stackPos-(7-6)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkClass($self->semValue, $stackPos-(7-2));\n            },\n            211 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Class_($self->semStack[$stackPos-(8-3)], ['type' => $self->semStack[$stackPos-(8-2)], 'extends' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkClass($self->semValue, $stackPos-(8-3));\n            },\n            212 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Interface_($self->semStack[$stackPos-(7-3)], ['extends' => $self->semStack[$stackPos-(7-4)], 'stmts' => $self->semStack[$stackPos-(7-6)], 'attrGroups' => $self->semStack[$stackPos-(7-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkInterface($self->semValue, $stackPos-(7-3));\n            },\n            213 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Trait_($self->semStack[$stackPos-(6-3)], ['stmts' => $self->semStack[$stackPos-(6-5)], 'attrGroups' => $self->semStack[$stackPos-(6-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]));\n            },\n            214 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Enum_($self->semStack[$stackPos-(8-3)], ['scalarType' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkEnum($self->semValue, $stackPos-(8-3));\n            },\n            215 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            216 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            217 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            218 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            219 => static function ($self, $stackPos) {\n                 $self->semValue = 0;\n            },\n            220 => null,\n            221 => null,\n            222 => static function ($self, $stackPos) {\n                 $self->checkClassModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)];\n            },\n            223 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::ABSTRACT;\n            },\n            224 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::FINAL;\n            },\n            225 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::READONLY;\n            },\n            226 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            227 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            228 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            229 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            230 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            231 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            232 => null,\n            233 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            234 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            235 => null,\n            236 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            237 => null,\n            238 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            239 => static function ($self, $stackPos) {\n                 if ($self->semStack[$stackPos-(1-1)] instanceof Stmt\\Block) { $self->semValue = $self->semStack[$stackPos-(1-1)]->stmts; } else if ($self->semStack[$stackPos-(1-1)] === null) { $self->semValue = []; } else { $self->semValue = [$self->semStack[$stackPos-(1-1)]]; };\n            },\n            240 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            241 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            242 => null,\n            243 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            244 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            245 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\DeclareItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            246 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            247 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-3)];\n            },\n            248 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            249 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(5-3)];\n            },\n            250 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            251 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            252 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Case_($self->semStack[$stackPos-(4-2)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            253 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Case_(null, $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            254 => null,\n            255 => null,\n            256 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Match_($self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            },\n            257 => static function ($self, $stackPos) {\n                 $self->semValue = [];\n            },\n            258 => null,\n            259 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            260 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            261 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\MatchArm($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            262 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\MatchArm(null, $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            263 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            264 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            265 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            266 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            267 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\ElseIf_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            268 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            269 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            270 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\ElseIf_($self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); $self->fixupAlternativeElse($self->semValue);\n            },\n            271 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            272 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Else_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            273 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            274 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Else_($self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->fixupAlternativeElse($self->semValue);\n            },\n            275 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)], false);\n            },\n            276 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(2-2)], true);\n            },\n            277 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)], false);\n            },\n            278 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->fixupArrayDestructuring($self->semStack[$stackPos-(1-1)]), false);\n            },\n            279 => null,\n            280 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            281 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            282 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            283 => static function ($self, $stackPos) {\n                 $self->semValue = 0;\n            },\n            284 => static function ($self, $stackPos) {\n                 $self->checkModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)];\n            },\n            285 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PUBLIC;\n            },\n            286 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PROTECTED;\n            },\n            287 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PRIVATE;\n            },\n            288 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PUBLIC_SET;\n            },\n            289 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PROTECTED_SET;\n            },\n            290 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PRIVATE_SET;\n            },\n            291 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::READONLY;\n            },\n            292 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::FINAL;\n            },\n            293 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Param($self->semStack[$stackPos-(7-6)], null, $self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-4)], $self->semStack[$stackPos-(7-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-1)], $self->semStack[$stackPos-(7-7)]);\n            $self->checkParam($self->semValue);\n            $self->addPropertyNameToHooks($self->semValue);\n            },\n            294 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Param($self->semStack[$stackPos-(9-6)], $self->semStack[$stackPos-(9-8)], $self->semStack[$stackPos-(9-3)], $self->semStack[$stackPos-(9-4)], $self->semStack[$stackPos-(9-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(9-2)], $self->semStack[$stackPos-(9-1)], $self->semStack[$stackPos-(9-9)]);\n            $self->checkParam($self->semValue);\n            $self->addPropertyNameToHooks($self->semValue);\n            },\n            295 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Param(new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])), null, $self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-4)], $self->semStack[$stackPos-(6-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(6-2)], $self->semStack[$stackPos-(6-1)]);\n            },\n            296 => null,\n            297 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\NullableType($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            298 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UnionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            299 => null,\n            300 => null,\n            301 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Name('static', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            302 => static function ($self, $stackPos) {\n                 $self->semValue = $self->handleBuiltinTypes($self->semStack[$stackPos-(1-1)]);\n            },\n            303 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier('array', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            304 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier('callable', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            305 => null,\n            306 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            307 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]);\n            },\n            308 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            309 => null,\n            310 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            311 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]);\n            },\n            312 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            313 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]);\n            },\n            314 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            315 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\IntersectionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            316 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]);\n            },\n            317 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            318 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\IntersectionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            319 => null,\n            320 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\NullableType($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            321 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UnionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            322 => null,\n            323 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            324 => null,\n            325 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            326 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            327 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            328 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            329 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            330 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-2)]);\n            },\n            331 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            332 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            333 => static function ($self, $stackPos) {\n                 $self->semValue = array(new Node\\Arg($self->semStack[$stackPos-(4-2)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])));\n            },\n            334 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-2)]);\n            },\n            335 => static function ($self, $stackPos) {\n                 $self->semValue = array(new Node\\Arg($self->semStack[$stackPos-(3-1)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)],  $self->tokenEndStack[$stackPos-(3-1)])), $self->semStack[$stackPos-(3-3)]);\n            },\n            336 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            337 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            338 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\VariadicPlaceholder($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            339 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            340 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            341 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Arg($self->semStack[$stackPos-(2-2)], true, false, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            342 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Arg($self->semStack[$stackPos-(2-2)], false, true, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            343 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Arg($self->semStack[$stackPos-(3-3)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(3-1)]);\n            },\n            344 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Arg($self->semStack[$stackPos-(1-1)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            345 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            346 => null,\n            347 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            348 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            349 => null,\n            350 => null,\n            351 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            352 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            353 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\StaticVar($self->semStack[$stackPos-(1-1)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            354 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\StaticVar($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            355 => static function ($self, $stackPos) {\n                 if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; } else { $self->semValue = $self->semStack[$stackPos-(2-1)]; }\n            },\n            356 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            357 => static function ($self, $stackPos) {\n                 $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);;\n            if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            358 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Property($self->semStack[$stackPos-(5-2)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-1)]);\n            },\n            359 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\ClassConst($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(5-1)]);\n            $self->checkClassConst($self->semValue, $stackPos-(5-2));\n            },\n            360 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\ClassConst($self->semStack[$stackPos-(6-5)], $self->semStack[$stackPos-(6-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(6-1)], $self->semStack[$stackPos-(6-4)]);\n            $self->checkClassConst($self->semValue, $stackPos-(6-2));\n            },\n            361 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\ClassMethod($self->semStack[$stackPos-(10-5)], ['type' => $self->semStack[$stackPos-(10-2)], 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-7)], 'returnType' => $self->semStack[$stackPos-(10-9)], 'stmts' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkClassMethod($self->semValue, $stackPos-(10-2));\n            },\n            362 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUse($self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            363 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\EnumCase($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            364 => static function ($self, $stackPos) {\n                 $self->semValue = null; /* will be skipped */\n            },\n            365 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            366 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            367 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            368 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            369 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUseAdaptation\\Precedence($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            370 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUseAdaptation\\Alias($self->semStack[$stackPos-(5-1)][0], $self->semStack[$stackPos-(5-1)][1], $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            371 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUseAdaptation\\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], $self->semStack[$stackPos-(4-3)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            372 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUseAdaptation\\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            373 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUseAdaptation\\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            374 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]);\n            },\n            375 => null,\n            376 => static function ($self, $stackPos) {\n                 $self->semValue = array(null, $self->semStack[$stackPos-(1-1)]);\n            },\n            377 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            378 => null,\n            379 => null,\n            380 => static function ($self, $stackPos) {\n                 $self->semValue = 0;\n            },\n            381 => static function ($self, $stackPos) {\n                 $self->semValue = 0;\n            },\n            382 => null,\n            383 => null,\n            384 => static function ($self, $stackPos) {\n                 $self->checkModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)];\n            },\n            385 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PUBLIC;\n            },\n            386 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PROTECTED;\n            },\n            387 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PRIVATE;\n            },\n            388 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PUBLIC_SET;\n            },\n            389 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PROTECTED_SET;\n            },\n            390 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PRIVATE_SET;\n            },\n            391 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::STATIC;\n            },\n            392 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::ABSTRACT;\n            },\n            393 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::FINAL;\n            },\n            394 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::READONLY;\n            },\n            395 => null,\n            396 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            397 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            398 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\VarLikeIdentifier(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            399 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\PropertyItem($self->semStack[$stackPos-(1-1)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            400 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\PropertyItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            401 => static function ($self, $stackPos) {\n                 $self->semValue = [];\n            },\n            402 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            403 => static function ($self, $stackPos) {\n                 $self->semValue = [];\n            },\n            404 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\PropertyHook($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-5)], ['flags' => $self->semStack[$stackPos-(5-2)], 'byRef' => $self->semStack[$stackPos-(5-3)], 'params' => [], 'attrGroups' => $self->semStack[$stackPos-(5-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkPropertyHook($self->semValue, null);\n            },\n            405 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\PropertyHook($self->semStack[$stackPos-(8-4)], $self->semStack[$stackPos-(8-8)], ['flags' => $self->semStack[$stackPos-(8-2)], 'byRef' => $self->semStack[$stackPos-(8-3)], 'params' => $self->semStack[$stackPos-(8-6)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkPropertyHook($self->semValue, $stackPos-(8-5));\n            },\n            406 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            407 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            408 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            409 => static function ($self, $stackPos) {\n                 $self->semValue = 0;\n            },\n            410 => static function ($self, $stackPos) {\n                 $self->checkPropertyHookModifiers($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)];\n            },\n            411 => null,\n            412 => null,\n            413 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            414 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            415 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            416 => null,\n            417 => null,\n            418 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Assign($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            419 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Assign($self->fixupArrayDestructuring($self->semStack[$stackPos-(3-1)]), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            420 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Assign($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            421 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignRef($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            422 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignRef($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            if (!$self->phpVersion->allowsAssignNewByReference()) {\n                $self->emitError(new Error('Cannot assign new by reference', $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])));\n            }\n\n            },\n            423 => null,\n            424 => null,\n            425 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\FuncCall(new Node\\Name($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)],  $self->tokenEndStack[$stackPos-(2-1)])), $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            426 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Clone_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            427 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Plus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            428 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Minus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            429 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Mul($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            430 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Div($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            431 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Concat($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            432 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Mod($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            433 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            434 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\BitwiseOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            435 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\BitwiseXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            436 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\ShiftLeft($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            437 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\ShiftRight($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            438 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Pow($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            439 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Coalesce($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            440 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PostInc($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            441 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PreInc($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            442 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PostDec($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            443 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PreDec($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            444 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BooleanOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            445 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BooleanAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            446 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\LogicalOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            447 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\LogicalAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            448 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\LogicalXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            449 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BitwiseOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            450 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            451 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            452 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BitwiseXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            453 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Concat($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            454 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Plus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            455 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Minus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            456 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Mul($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            457 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Div($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            458 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Mod($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            459 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\ShiftLeft($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            460 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\ShiftRight($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            461 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Pow($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            462 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\UnaryPlus($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            463 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\UnaryMinus($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            464 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BooleanNot($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            465 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BitwiseNot($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            466 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Identical($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            467 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\NotIdentical($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            468 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Equal($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            469 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\NotEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            470 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Spaceship($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            471 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Smaller($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            472 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\SmallerOrEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            473 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Greater($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            474 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\GreaterOrEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            475 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Instanceof_($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            476 => static function ($self, $stackPos) {\n\n          $self->semValue = $self->semStack[$stackPos-(3-2)];\n          if ($self->semValue instanceof Expr\\ArrowFunction) {\n              $self->parenthesizedArrowFunctions->offsetSet($self->semValue);\n          }\n\n            },\n            477 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Ternary($self->semStack[$stackPos-(5-1)], $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            478 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Ternary($self->semStack[$stackPos-(4-1)], null, $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            479 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Coalesce($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            480 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Isset_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            481 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Empty_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            482 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Include_($self->semStack[$stackPos-(2-2)], Expr\\Include_::TYPE_INCLUDE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            483 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Include_($self->semStack[$stackPos-(2-2)], Expr\\Include_::TYPE_INCLUDE_ONCE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            484 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Eval_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            485 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Include_($self->semStack[$stackPos-(2-2)], Expr\\Include_::TYPE_REQUIRE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            486 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Include_($self->semStack[$stackPos-(2-2)], Expr\\Include_::TYPE_REQUIRE_ONCE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            487 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]);\n            $attrs['kind'] = $self->getIntCastKind($self->semStack[$stackPos-(2-1)]);\n            $self->semValue = new Expr\\Cast\\Int_($self->semStack[$stackPos-(2-2)], $attrs);\n            },\n            488 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]);\n            $attrs['kind'] = $self->getFloatCastKind($self->semStack[$stackPos-(2-1)]);\n            $self->semValue = new Expr\\Cast\\Double($self->semStack[$stackPos-(2-2)], $attrs);\n            },\n            489 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]);\n            $attrs['kind'] = $self->getStringCastKind($self->semStack[$stackPos-(2-1)]);\n            $self->semValue = new Expr\\Cast\\String_($self->semStack[$stackPos-(2-2)], $attrs);\n            },\n            490 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Cast\\Array_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            491 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Cast\\Object_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            492 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]);\n            $attrs['kind'] = $self->getBoolCastKind($self->semStack[$stackPos-(2-1)]);\n            $self->semValue = new Expr\\Cast\\Bool_($self->semStack[$stackPos-(2-2)], $attrs);\n            },\n            493 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Cast\\Unset_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            494 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Cast\\Void_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            495 => static function ($self, $stackPos) {\n                 $self->semValue = $self->createExitExpr($self->semStack[$stackPos-(2-1)], $stackPos-(2-1), $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            496 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ErrorSuppress($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            497 => null,\n            498 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ShellExec($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            499 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Print_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            500 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Yield_(null, null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            501 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Yield_($self->semStack[$stackPos-(2-2)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            502 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Yield_($self->semStack[$stackPos-(4-4)], $self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            503 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\YieldFrom($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            504 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Throw_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            505 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrowFunction(['static' => false, 'byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-4)], 'returnType' => $self->semStack[$stackPos-(8-6)], 'expr' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            },\n            506 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrowFunction(['static' => true, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'returnType' => $self->semStack[$stackPos-(9-7)], 'expr' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            507 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Closure(['static' => false, 'byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-4)], 'uses' => $self->semStack[$stackPos-(8-6)], 'returnType' => $self->semStack[$stackPos-(8-7)], 'stmts' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            },\n            508 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Closure(['static' => true, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'uses' => $self->semStack[$stackPos-(9-7)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            509 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrowFunction(['static' => false, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'returnType' => $self->semStack[$stackPos-(9-7)], 'expr' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            510 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrowFunction(['static' => true, 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-6)], 'returnType' => $self->semStack[$stackPos-(10-8)], 'expr' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos]));\n            },\n            511 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Closure(['static' => false, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'uses' => $self->semStack[$stackPos-(9-7)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            512 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Closure(['static' => true, 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-6)], 'uses' => $self->semStack[$stackPos-(10-8)], 'returnType' => $self->semStack[$stackPos-(10-9)], 'stmts' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos]));\n            },\n            513 => static function ($self, $stackPos) {\n                 $self->semValue = array(new Stmt\\Class_(null, ['type' => $self->semStack[$stackPos-(8-2)], 'extends' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])), $self->semStack[$stackPos-(8-3)]);\n            $self->checkClass($self->semValue[0], -1);\n            },\n            514 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\New_($self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            515 => static function ($self, $stackPos) {\n                 list($class, $ctorArgs) = $self->semStack[$stackPos-(2-2)]; $self->semValue = new Expr\\New_($class, $ctorArgs, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            516 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\New_($self->semStack[$stackPos-(2-2)], [], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            517 => null,\n            518 => null,\n            519 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            520 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-3)];\n            },\n            521 => null,\n            522 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            523 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            524 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ClosureUse($self->semStack[$stackPos-(2-2)], $self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            525 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            526 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            527 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            528 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            529 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\StaticCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            530 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            531 => null,\n            532 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            533 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            534 => static function ($self, $stackPos) {\n                 $self->semValue = new Name\\FullyQualified(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            535 => static function ($self, $stackPos) {\n                 $self->semValue = new Name\\Relative(substr($self->semStack[$stackPos-(1-1)], 10), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            536 => null,\n            537 => null,\n            538 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            539 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2;\n            },\n            540 => null,\n            541 => null,\n            542 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            543 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]); foreach ($self->semValue as $s) { if ($s instanceof Node\\InterpolatedStringPart) { $s->value = Node\\Scalar\\String_::parseEscapeSequences($s->value, '`', $self->phpVersion->supportsUnicodeEscapes()); } };\n            },\n            544 => static function ($self, $stackPos) {\n                 foreach ($self->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\\InterpolatedStringPart) { $s->value = Node\\Scalar\\String_::parseEscapeSequences($s->value, '`', $self->phpVersion->supportsUnicodeEscapes()); } }; $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            545 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            546 => null,\n            547 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ConstFetch($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            548 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Line($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            549 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\File($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            550 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Dir($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            551 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Class_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            552 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Trait_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            553 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Method($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            554 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Function_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            555 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Namespace_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            556 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Property($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            557 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ClassConstFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            558 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ClassConstFetch($self->semStack[$stackPos-(5-1)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            559 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ClassConstFetch($self->semStack[$stackPos-(3-1)], new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(3-3)],  $self->tokenEndStack[$stackPos-(3-3)])), $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2;\n            },\n            560 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\\Array_::KIND_SHORT;\n            $self->semValue = new Expr\\Array_($self->semStack[$stackPos-(3-2)], $attrs);\n            },\n            561 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\\Array_::KIND_LONG;\n            $self->semValue = new Expr\\Array_($self->semStack[$stackPos-(4-3)], $attrs);\n            $self->createdArrays->offsetSet($self->semValue);\n            },\n            562 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)]; $self->createdArrays->offsetSet($self->semValue);\n            },\n            563 => static function ($self, $stackPos) {\n                 $self->semValue = Scalar\\String_::fromString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]), $self->phpVersion->supportsUnicodeEscapes());\n            },\n            564 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Scalar\\String_::KIND_DOUBLE_QUOTED;\n            foreach ($self->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\\InterpolatedStringPart) { $s->value = Node\\Scalar\\String_::parseEscapeSequences($s->value, '\"', $self->phpVersion->supportsUnicodeEscapes()); } }; $self->semValue = new Scalar\\InterpolatedString($self->semStack[$stackPos-(3-2)], $attrs);\n            },\n            565 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseLNumber($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]), $self->phpVersion->allowsInvalidOctals());\n            },\n            566 => static function ($self, $stackPos) {\n                 $self->semValue = Scalar\\Float_::fromString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            567 => null,\n            568 => null,\n            569 => null,\n            570 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseDocString($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(3-3)],  $self->tokenEndStack[$stackPos-(3-3)]), true);\n            },\n            571 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseDocString($self->semStack[$stackPos-(2-1)], '', $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(2-2)],  $self->tokenEndStack[$stackPos-(2-2)]), true);\n            },\n            572 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseDocString($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(3-3)],  $self->tokenEndStack[$stackPos-(3-3)]), true);\n            },\n            573 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            574 => null,\n            575 => null,\n            576 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            577 => null,\n            578 => null,\n            579 => null,\n            580 => null,\n            581 => null,\n            582 => null,\n            583 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            584 => null,\n            585 => null,\n            586 => null,\n            587 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            588 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            589 => null,\n            590 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\MethodCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            591 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\NullsafeMethodCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            592 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            593 => null,\n            594 => null,\n            595 => null,\n            596 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            597 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            598 => null,\n            599 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            600 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            601 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable(new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])), $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2;\n            },\n            602 => static function ($self, $stackPos) {\n                 $var = $self->semStack[$stackPos-(1-1)]->name; $self->semValue = \\is_string($var) ? new Node\\VarLikeIdentifier($var, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])) : $var;\n            },\n            603 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            604 => null,\n            605 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            606 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            607 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            608 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            609 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            610 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            611 => null,\n            612 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            613 => null,\n            614 => null,\n            615 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            616 => null,\n            617 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2;\n            },\n            618 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\List_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); $self->semValue->setAttribute('kind', Expr\\List_::KIND_LIST);\n            $self->postprocessList($self->semValue);\n            },\n            619 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)]; $end = count($self->semValue)-1; if ($self->semValue[$end]->value instanceof Expr\\Error) array_pop($self->semValue);\n            },\n            620 => null,\n            621 => static function ($self, $stackPos) {\n                 /* do nothing -- prevent default action of $$=$self->semStack[$1]. See $551. */\n            },\n            622 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            623 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            624 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(1-1)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            625 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(2-2)], null, true, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            626 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(1-1)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            627 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(3-3)], $self->semStack[$stackPos-(3-1)], false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            628 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(4-4)], $self->semStack[$stackPos-(4-1)], true, $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            629 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(3-3)], $self->semStack[$stackPos-(3-1)], false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            630 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(2-2)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]), true);\n            },\n            631 => static function ($self, $stackPos) {\n                 /* Create an Error node now to remember the position. We'll later either report an error,\n             or convert this into a null element, depending on whether this is a creation or destructuring context. */\n          $attrs = $self->createEmptyElemAttributes($self->tokenPos);\n          $self->semValue = new Node\\ArrayItem(new Expr\\Error($attrs), null, false, $attrs);\n            },\n            632 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            633 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            634 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            635 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)]);\n            },\n            636 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]); $attrs['rawValue'] = $self->semStack[$stackPos-(1-1)]; $self->semValue = new Node\\InterpolatedStringPart($self->semStack[$stackPos-(1-1)], $attrs);\n            },\n            637 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            638 => null,\n            639 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            640 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            641 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            642 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            643 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            644 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrayDimFetch($self->semStack[$stackPos-(6-2)], $self->semStack[$stackPos-(6-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]));\n            },\n            645 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            646 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\String_($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            647 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseNumString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            648 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseNumString('-' . $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            649 => null,\n        ];\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Parser/Php8.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Parser;\n\nuse PhpParser\\Error;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Stmt;\n\n/* This is an automatically GENERATED file, which should not be manually edited.\n * Instead edit one of the following:\n *  * the grammar file grammar/php.y\n *  * the skeleton file grammar/parser.template\n *  * the preprocessing script grammar/rebuildParsers.php\n */\nclass Php8 extends \\PhpParser\\ParserAbstract\n{\n    public const YYERRTOK = 256;\n    public const T_VOID_CAST = 257;\n    public const T_THROW = 258;\n    public const T_INCLUDE = 259;\n    public const T_INCLUDE_ONCE = 260;\n    public const T_EVAL = 261;\n    public const T_REQUIRE = 262;\n    public const T_REQUIRE_ONCE = 263;\n    public const T_LOGICAL_OR = 264;\n    public const T_LOGICAL_XOR = 265;\n    public const T_LOGICAL_AND = 266;\n    public const T_PRINT = 267;\n    public const T_YIELD = 268;\n    public const T_DOUBLE_ARROW = 269;\n    public const T_YIELD_FROM = 270;\n    public const T_PLUS_EQUAL = 271;\n    public const T_MINUS_EQUAL = 272;\n    public const T_MUL_EQUAL = 273;\n    public const T_DIV_EQUAL = 274;\n    public const T_CONCAT_EQUAL = 275;\n    public const T_MOD_EQUAL = 276;\n    public const T_AND_EQUAL = 277;\n    public const T_OR_EQUAL = 278;\n    public const T_XOR_EQUAL = 279;\n    public const T_SL_EQUAL = 280;\n    public const T_SR_EQUAL = 281;\n    public const T_POW_EQUAL = 282;\n    public const T_COALESCE_EQUAL = 283;\n    public const T_COALESCE = 284;\n    public const T_BOOLEAN_OR = 285;\n    public const T_BOOLEAN_AND = 286;\n    public const T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG = 287;\n    public const T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG = 288;\n    public const T_IS_EQUAL = 289;\n    public const T_IS_NOT_EQUAL = 290;\n    public const T_IS_IDENTICAL = 291;\n    public const T_IS_NOT_IDENTICAL = 292;\n    public const T_SPACESHIP = 293;\n    public const T_IS_SMALLER_OR_EQUAL = 294;\n    public const T_IS_GREATER_OR_EQUAL = 295;\n    public const T_PIPE = 296;\n    public const T_SL = 297;\n    public const T_SR = 298;\n    public const T_INSTANCEOF = 299;\n    public const T_INC = 300;\n    public const T_DEC = 301;\n    public const T_INT_CAST = 302;\n    public const T_DOUBLE_CAST = 303;\n    public const T_STRING_CAST = 304;\n    public const T_ARRAY_CAST = 305;\n    public const T_OBJECT_CAST = 306;\n    public const T_BOOL_CAST = 307;\n    public const T_UNSET_CAST = 308;\n    public const T_POW = 309;\n    public const T_NEW = 310;\n    public const T_CLONE = 311;\n    public const T_EXIT = 312;\n    public const T_IF = 313;\n    public const T_ELSEIF = 314;\n    public const T_ELSE = 315;\n    public const T_ENDIF = 316;\n    public const T_LNUMBER = 317;\n    public const T_DNUMBER = 318;\n    public const T_STRING = 319;\n    public const T_STRING_VARNAME = 320;\n    public const T_VARIABLE = 321;\n    public const T_NUM_STRING = 322;\n    public const T_INLINE_HTML = 323;\n    public const T_ENCAPSED_AND_WHITESPACE = 324;\n    public const T_CONSTANT_ENCAPSED_STRING = 325;\n    public const T_ECHO = 326;\n    public const T_DO = 327;\n    public const T_WHILE = 328;\n    public const T_ENDWHILE = 329;\n    public const T_FOR = 330;\n    public const T_ENDFOR = 331;\n    public const T_FOREACH = 332;\n    public const T_ENDFOREACH = 333;\n    public const T_DECLARE = 334;\n    public const T_ENDDECLARE = 335;\n    public const T_AS = 336;\n    public const T_SWITCH = 337;\n    public const T_MATCH = 338;\n    public const T_ENDSWITCH = 339;\n    public const T_CASE = 340;\n    public const T_DEFAULT = 341;\n    public const T_BREAK = 342;\n    public const T_CONTINUE = 343;\n    public const T_GOTO = 344;\n    public const T_FUNCTION = 345;\n    public const T_FN = 346;\n    public const T_CONST = 347;\n    public const T_RETURN = 348;\n    public const T_TRY = 349;\n    public const T_CATCH = 350;\n    public const T_FINALLY = 351;\n    public const T_USE = 352;\n    public const T_INSTEADOF = 353;\n    public const T_GLOBAL = 354;\n    public const T_STATIC = 355;\n    public const T_ABSTRACT = 356;\n    public const T_FINAL = 357;\n    public const T_PRIVATE = 358;\n    public const T_PROTECTED = 359;\n    public const T_PUBLIC = 360;\n    public const T_READONLY = 361;\n    public const T_PUBLIC_SET = 362;\n    public const T_PROTECTED_SET = 363;\n    public const T_PRIVATE_SET = 364;\n    public const T_VAR = 365;\n    public const T_UNSET = 366;\n    public const T_ISSET = 367;\n    public const T_EMPTY = 368;\n    public const T_HALT_COMPILER = 369;\n    public const T_CLASS = 370;\n    public const T_TRAIT = 371;\n    public const T_INTERFACE = 372;\n    public const T_ENUM = 373;\n    public const T_EXTENDS = 374;\n    public const T_IMPLEMENTS = 375;\n    public const T_OBJECT_OPERATOR = 376;\n    public const T_NULLSAFE_OBJECT_OPERATOR = 377;\n    public const T_LIST = 378;\n    public const T_ARRAY = 379;\n    public const T_CALLABLE = 380;\n    public const T_CLASS_C = 381;\n    public const T_TRAIT_C = 382;\n    public const T_METHOD_C = 383;\n    public const T_FUNC_C = 384;\n    public const T_PROPERTY_C = 385;\n    public const T_LINE = 386;\n    public const T_FILE = 387;\n    public const T_START_HEREDOC = 388;\n    public const T_END_HEREDOC = 389;\n    public const T_DOLLAR_OPEN_CURLY_BRACES = 390;\n    public const T_CURLY_OPEN = 391;\n    public const T_PAAMAYIM_NEKUDOTAYIM = 392;\n    public const T_NAMESPACE = 393;\n    public const T_NS_C = 394;\n    public const T_DIR = 395;\n    public const T_NS_SEPARATOR = 396;\n    public const T_ELLIPSIS = 397;\n    public const T_NAME_FULLY_QUALIFIED = 398;\n    public const T_NAME_QUALIFIED = 399;\n    public const T_NAME_RELATIVE = 400;\n    public const T_ATTRIBUTE = 401;\n\n    protected int $tokenToSymbolMapSize = 402;\n    protected int $actionTableSize = 1537;\n    protected int $gotoTableSize = 642;\n\n    protected int $invalidSymbol = 174;\n    protected int $errorSymbol = 1;\n    protected int $defaultAction = -32766;\n    protected int $unexpectedTokenRule = 32767;\n\n    protected int $YY2TBLSTATE = 452;\n    protected int $numNonLeafStates = 767;\n\n    protected array $symbolToName = array(\n        \"EOF\",\n        \"error\",\n        \"T_VOID_CAST\",\n        \"T_THROW\",\n        \"T_INCLUDE\",\n        \"T_INCLUDE_ONCE\",\n        \"T_EVAL\",\n        \"T_REQUIRE\",\n        \"T_REQUIRE_ONCE\",\n        \"','\",\n        \"T_LOGICAL_OR\",\n        \"T_LOGICAL_XOR\",\n        \"T_LOGICAL_AND\",\n        \"T_PRINT\",\n        \"T_YIELD\",\n        \"T_DOUBLE_ARROW\",\n        \"T_YIELD_FROM\",\n        \"'='\",\n        \"T_PLUS_EQUAL\",\n        \"T_MINUS_EQUAL\",\n        \"T_MUL_EQUAL\",\n        \"T_DIV_EQUAL\",\n        \"T_CONCAT_EQUAL\",\n        \"T_MOD_EQUAL\",\n        \"T_AND_EQUAL\",\n        \"T_OR_EQUAL\",\n        \"T_XOR_EQUAL\",\n        \"T_SL_EQUAL\",\n        \"T_SR_EQUAL\",\n        \"T_POW_EQUAL\",\n        \"T_COALESCE_EQUAL\",\n        \"'?'\",\n        \"':'\",\n        \"T_COALESCE\",\n        \"T_BOOLEAN_OR\",\n        \"T_BOOLEAN_AND\",\n        \"'|'\",\n        \"'^'\",\n        \"T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG\",\n        \"T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG\",\n        \"T_IS_EQUAL\",\n        \"T_IS_NOT_EQUAL\",\n        \"T_IS_IDENTICAL\",\n        \"T_IS_NOT_IDENTICAL\",\n        \"T_SPACESHIP\",\n        \"'<'\",\n        \"T_IS_SMALLER_OR_EQUAL\",\n        \"'>'\",\n        \"T_IS_GREATER_OR_EQUAL\",\n        \"T_PIPE\",\n        \"'.'\",\n        \"T_SL\",\n        \"T_SR\",\n        \"'+'\",\n        \"'-'\",\n        \"'*'\",\n        \"'/'\",\n        \"'%'\",\n        \"'!'\",\n        \"T_INSTANCEOF\",\n        \"'~'\",\n        \"T_INC\",\n        \"T_DEC\",\n        \"T_INT_CAST\",\n        \"T_DOUBLE_CAST\",\n        \"T_STRING_CAST\",\n        \"T_ARRAY_CAST\",\n        \"T_OBJECT_CAST\",\n        \"T_BOOL_CAST\",\n        \"T_UNSET_CAST\",\n        \"'@'\",\n        \"T_POW\",\n        \"'['\",\n        \"T_NEW\",\n        \"T_CLONE\",\n        \"T_EXIT\",\n        \"T_IF\",\n        \"T_ELSEIF\",\n        \"T_ELSE\",\n        \"T_ENDIF\",\n        \"T_LNUMBER\",\n        \"T_DNUMBER\",\n        \"T_STRING\",\n        \"T_STRING_VARNAME\",\n        \"T_VARIABLE\",\n        \"T_NUM_STRING\",\n        \"T_INLINE_HTML\",\n        \"T_ENCAPSED_AND_WHITESPACE\",\n        \"T_CONSTANT_ENCAPSED_STRING\",\n        \"T_ECHO\",\n        \"T_DO\",\n        \"T_WHILE\",\n        \"T_ENDWHILE\",\n        \"T_FOR\",\n        \"T_ENDFOR\",\n        \"T_FOREACH\",\n        \"T_ENDFOREACH\",\n        \"T_DECLARE\",\n        \"T_ENDDECLARE\",\n        \"T_AS\",\n        \"T_SWITCH\",\n        \"T_MATCH\",\n        \"T_ENDSWITCH\",\n        \"T_CASE\",\n        \"T_DEFAULT\",\n        \"T_BREAK\",\n        \"T_CONTINUE\",\n        \"T_GOTO\",\n        \"T_FUNCTION\",\n        \"T_FN\",\n        \"T_CONST\",\n        \"T_RETURN\",\n        \"T_TRY\",\n        \"T_CATCH\",\n        \"T_FINALLY\",\n        \"T_USE\",\n        \"T_INSTEADOF\",\n        \"T_GLOBAL\",\n        \"T_STATIC\",\n        \"T_ABSTRACT\",\n        \"T_FINAL\",\n        \"T_PRIVATE\",\n        \"T_PROTECTED\",\n        \"T_PUBLIC\",\n        \"T_READONLY\",\n        \"T_PUBLIC_SET\",\n        \"T_PROTECTED_SET\",\n        \"T_PRIVATE_SET\",\n        \"T_VAR\",\n        \"T_UNSET\",\n        \"T_ISSET\",\n        \"T_EMPTY\",\n        \"T_HALT_COMPILER\",\n        \"T_CLASS\",\n        \"T_TRAIT\",\n        \"T_INTERFACE\",\n        \"T_ENUM\",\n        \"T_EXTENDS\",\n        \"T_IMPLEMENTS\",\n        \"T_OBJECT_OPERATOR\",\n        \"T_NULLSAFE_OBJECT_OPERATOR\",\n        \"T_LIST\",\n        \"T_ARRAY\",\n        \"T_CALLABLE\",\n        \"T_CLASS_C\",\n        \"T_TRAIT_C\",\n        \"T_METHOD_C\",\n        \"T_FUNC_C\",\n        \"T_PROPERTY_C\",\n        \"T_LINE\",\n        \"T_FILE\",\n        \"T_START_HEREDOC\",\n        \"T_END_HEREDOC\",\n        \"T_DOLLAR_OPEN_CURLY_BRACES\",\n        \"T_CURLY_OPEN\",\n        \"T_PAAMAYIM_NEKUDOTAYIM\",\n        \"T_NAMESPACE\",\n        \"T_NS_C\",\n        \"T_DIR\",\n        \"T_NS_SEPARATOR\",\n        \"T_ELLIPSIS\",\n        \"T_NAME_FULLY_QUALIFIED\",\n        \"T_NAME_QUALIFIED\",\n        \"T_NAME_RELATIVE\",\n        \"T_ATTRIBUTE\",\n        \"';'\",\n        \"']'\",\n        \"'('\",\n        \"')'\",\n        \"'{'\",\n        \"'}'\",\n        \"'`'\",\n        \"'\\\"'\",\n        \"'$'\"\n    );\n\n    protected array $tokenToSymbol = array(\n            0,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,   58,  172,  174,  173,   57,  174,  174,\n          167,  168,   55,   53,    9,   54,   50,   56,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,   32,  165,\n           45,   17,   47,   31,   70,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,   72,  174,  166,   37,  174,  171,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  169,   36,  170,   60,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,  174,  174,  174,  174,\n          174,  174,  174,  174,  174,  174,    1,    2,    3,    4,\n            5,    6,    7,    8,   10,   11,   12,   13,   14,   15,\n           16,   18,   19,   20,   21,   22,   23,   24,   25,   26,\n           27,   28,   29,   30,   33,   34,   35,   38,   39,   40,\n           41,   42,   43,   44,   46,   48,   49,   51,   52,   59,\n           61,   62,   63,   64,   65,   66,   67,   68,   69,   71,\n           73,   74,   75,   76,   77,   78,   79,   80,   81,   82,\n           83,   84,   85,   86,   87,   88,   89,   90,   91,   92,\n           93,   94,   95,   96,   97,   98,   99,  100,  101,  102,\n          103,  104,  105,  106,  107,  108,  109,  110,  111,  112,\n          113,  114,  115,  116,  117,  118,  119,  120,  121,  122,\n          123,  124,  125,  126,  127,  128,  129,  130,  131,  132,\n          133,  134,  135,  136,  137,  138,  139,  140,  141,  142,\n          143,  144,  145,  146,  147,  148,  149,  150,  151,  152,\n          153,  154,  155,  156,  157,  158,  159,  160,  161,  162,\n          163,  164\n    );\n\n    protected array $action = array(\n          132,  133,  134,  582,  135,  136,  162,  779,  780,  781,\n          137,   41,  863,-32766,  970, 1404, -584,  974,  973, 1302,\n            0,  395,  396,  455,  246,  854,-32766,-32766,-32766,-32766,\n        -32766,  440,-32766,   27,-32766,  773,  772,-32766,-32766,-32766,\n        -32766,  508,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32766,\n          131,-32766,-32766,-32766,-32766,  437,  782,  859, 1148,-32766,\n          949,-32766,-32766,-32766,-32766,-32766,-32766,  972, 1385,  300,\n          271,   53,  398,  786,  787,  788,  789,  305,  865,  441,\n         -341,   39,  254, -584, -584, -195,  843,  790,  791,  792,\n          793,  794,  795,  796,  797,  798,  799,  819,  583,  820,\n          821,  822,  823,  811,  812,  353,  354,  814,  815,  800,\n          801,  802,  804,  805,  806,  368,  846,  847,  848,  849,\n          850,  584, 1062, -194,  856,  807,  808,  585,  586,    3,\n          831,  829,  830,  842,  826,  827,    4,  860,  587,  588,\n          825,  589,  590,  591,  592,  939,  593,  594,    5,  854,\n        -32766,-32766,-32766,  828,  595,  596,-32766,  138,  764,  132,\n          133,  134,  582,  135,  136, 1098,  779,  780,  781,  137,\n           41,-32766,-32766,-32766,-32766,-32766,-32766, -275, 1302,  613,\n          153, 1071,  749,  990,  991,-32766,-32766,-32766,  992,-32766,\n          891,-32766,  892,-32766,  773,  772,-32766,  986, 1309,  397,\n          396,-32766,-32766,-32766,  858,  299,  630,-32766,-32766,  440,\n          502,  736,-32766,-32766,  437,  782,-32767,-32767,-32767,-32767,\n          106,  107,  108,  109,  951,-32766, 1021,   29,  734,  271,\n           53,  398,  786,  787,  788,  789,  144, 1071,  441, -341,\n          332,   38,  864,  862, -195,  843,  790,  791,  792,  793,\n          794,  795,  796,  797,  798,  799,  819,  583,  820,  821,\n          822,  823,  811,  812,  353,  354,  814,  815,  800,  801,\n          802,  804,  805,  806,  368,  846,  847,  848,  849,  850,\n          584,  863, -194,  139,  807,  808,  585,  586,  323,  831,\n          829,  830,  842,  826,  827, 1370,  148,  587,  588,  825,\n          589,  590,  591,  592,  245,  593,  594,  395,  396,-32766,\n        -32766,-32766,  828,  595,  596,  -85,  138,  440,  132,  133,\n          134,  582,  135,  136, 1095,  779,  780,  781,  137,   41,\n        -32766,-32766,-32766,-32766,-32766,   51,  578, 1302,  257,-32766,\n          636,  107,  108,  109,-32766,-32766,-32766,  503,-32766,  316,\n        -32766,-32766,-32766,  773,  772,-32766, -383,  166, -383, 1022,\n        -32766,-32766,-32766,  305,   79, 1133,-32766,-32766, 1414,  762,\n          332, 1415,-32766,  437,  782,-32766, 1071,  110,  111,  112,\n          113,  114,  -85,  283,-32766,  477,  478,  479,  271,   53,\n          398,  786,  787,  788,  789,  115,  407,  441,   10,-32766,\n          299, 1341,  306,  307,  843,  790,  791,  792,  793,  794,\n          795,  796,  797,  798,  799,  819,  583,  820,  821,  822,\n          823,  811,  812,  353,  354,  814,  815,  800,  801,  802,\n          804,  805,  806,  368,  846,  847,  848,  849,  850,  584,\n          320, 1068, -582,  807,  808,  585,  586, 1389,  831,  829,\n          830,  842,  826,  827,  329, 1388,  587,  588,  825,  589,\n          590,  591,  592,   86,  593,  594, 1071,  332,-32766,-32766,\n        -32766,  828,  595,  596,  349,  151, -581,  132,  133,  134,\n          582,  135,  136, 1100,  779,  780,  781,  137,   41,-32766,\n          290,-32766,-32766,-32766,-32766,-32766,-32766,-32766,-32767,-32767,\n        -32767,-32767,-32767,-32766,-32766,-32766,  891, 1175,  892, -582,\n         -582,  754,  773,  772, 1159, 1160, 1161, 1155, 1154, 1153,\n         1162, 1156, 1157, 1158,-32766, -582,-32766,-32766,-32766,-32766,\n        -32766,-32766,-32766,  782,-32766,-32766,-32766, -588,  -78,-32766,\n        -32766,-32766,  350, -581, -581,-32766,-32766,  271,   53,  398,\n          786,  787,  788,  789,  383,-32766,  441,-32766,-32766, -581,\n        -32766,  773,  772,  843,  790,  791,  792,  793,  794,  795,\n          796,  797,  798,  799,  819,  583,  820,  821,  822,  823,\n          811,  812,  353,  354,  814,  815,  800,  801,  802,  804,\n          805,  806,  368,  846,  847,  848,  849,  850,  584, -620,\n         1068, -620,  807,  808,  585,  586,  389,  831,  829,  830,\n          842,  826,  827,  441,  405,  587,  588,  825,  589,  590,\n          591,  592,  333,  593,  594, 1071,   87,   88,   89,  459,\n          828,  595,  596,  460,  151,  803,  774,  775,  776,  777,\n          778,  854,  779,  780,  781,  816,  817,   40,  461,   90,\n           91,   92,   93,   94,   95,   96,   97,   98,   99,  100,\n          101,  102,  103,  104,  105,  106,  107,  108,  109,  110,\n          111,  112,  113,  114,  462,  283, 1329, 1159, 1160, 1161,\n         1155, 1154, 1153, 1162, 1156, 1157, 1158,  115,  869,  488,\n          489,  782, 1304, 1303, 1305,  108,  109, 1132,  154,-32766,\n        -32766, 1134,  679,   23,  156,  783,  784,  785,  786,  787,\n          788,  789,  698,  699,  852,  152,  423, -580,  393,  394,\n          157,  843,  790,  791,  792,  793,  794,  795,  796,  797,\n          798,  799,  819,  841,  820,  821,  822,  823,  811,  812,\n          813,  840,  814,  815,  800,  801,  802,  804,  805,  806,\n          845,  846,  847,  848,  849,  850,  851, 1094, -578,  863,\n          807,  808,  809,  810,  -58,  831,  829,  830,  842,  826,\n          827,  399,  400,  818,  824,  825,  832,  833,  835,  834,\n          294,  836,  837,  158, -580, -580,  160,  294,  828,  839,\n          838,   54,   55,   56,   57,  534,   58,   59,   36, -110,\n         -580,  -57,   60,   61, -110,   62, -110,  670,  671,  129,\n          130,  312, -587,  140, -110, -110, -110, -110, -110, -110,\n         -110, -110, -110, -110, -110, -578, -578,  141,  147,  949,\n          161,  712,  -87,  163,  164,  165,  -84,  949,  -78,  -73,\n          -72, -578,   63,   64,  143, -309,  -71,   65,  332,   66,\n          251,  252,   67,   68,   69,   70,   71,   72,   73,   74,\n          739,   31,  276,   47,  457,  535, -357,  713,  740, 1335,\n         1336,  536,  -70,  863, 1068,  -69,  -68, 1333,   45,   22,\n          537,  949,  538,  -67,  539,  -66,  540,   52,  -65,  541,\n          542,  714,  715,  -46,   48,   49,  463,  392,  391, 1071,\n           50,  543,  -18,  145,  281, 1302,  381,  348,  291,  750,\n         1304, 1303, 1305, 1295,  939,  753,  290,  948,  545,  546,\n          547,  150,  939,  290, -305,  295,  288,  289,  292,  293,\n          549,  550,  338, 1321, 1322, 1323, 1324, 1326, 1318, 1319,\n          304, 1300,  296,  301,  302,  283, 1325, 1320,  773,  772,\n         1304, 1303, 1305,  305,  308,  309,   75, -154, -154, -154,\n          327,  328,  332,  966,  854, 1070,  939,  149,  115, 1416,\n          388,  680, -154,  708, -154,  725, -154,   13, -154,  668,\n          723,  313,   31,  277, 1304, 1303, 1305,  863,  390,-32766,\n          600, 1166,  987,  951,  863,  310,  701,  734, 1333,  990,\n          991,  951,-32766,  686,  544,  734,  949,  685,  606, 1340,\n          485,  513,  925,  986, -110, -110, -110,   35,  116,  117,\n          118,  119,  120,  121,  122,  123,  124,  125,  126,  127,\n          128,  702,  949,  634, 1295,  773,  772,  741, -579,  305,\n         -614, 1334,    0,    0,    0,  951,  311,  949,    0,  734,\n         -154,  549,  550,  319, 1321, 1322, 1323, 1324, 1326, 1318,\n         1319, 1209, 1211,  744,    0, 1342,    0, 1325, 1320, -544,\n         -534,    0, -578,-32766,   -4,  949,   11,   77,  751, 1302,\n           30,  387,  328,  332,  862,   43,-32766,-32766,-32766, -613,\n        -32766,  939,-32766,  968,-32766,   44,  759,-32766, 1330,  773,\n          772,  760,-32766,-32766,-32766, -579, -579,  882,-32766,-32766,\n          930, 1031, 1008, 1015,-32766,  437, 1005,  939, 1016,  928,\n         1003, -579, 1137, 1140, 1141, 1138,-32766, 1177, 1139, 1145,\n           37,  874,  939, -586, 1357, 1374, 1407,-32766,  673, -578,\n         -578, -612, -588, 1302, -587, -586, -585,   31,  276, -528,\n        -32766,-32766,-32766,    1,-32766, -578,-32766,   78,-32766,  863,\n          939,-32766,   32, 1333, -278,   33,-32766,-32766,-32766,   42,\n         1007,   46,-32766,-32766,  734,   76,   80,   81,-32766,  437,\n           82,   83,  390,   84,  453,   31,  277,   85,  146,  303,\n        -32766,  155,  159,  990,  991,  249,  951,  863,  544, 1295,\n          734, 1333,  334,  369,  370,  371,  548,  986, -110, -110,\n         -110,  951,  372,  326,  373,  734,  374,  550,  375, 1321,\n         1322, 1323, 1324, 1326, 1318, 1319,  376,  377,  422,  378,\n           21,  -50, 1325, 1320,  379,  382,  454, 1295,  577,  951,\n          380,  384,   77,  734,   -4, -276, -275,  328,  332,   15,\n           16,   17,   18,   20,  363,  550,  421, 1321, 1322, 1323,\n         1324, 1326, 1318, 1319,  142,  504,  505,  512,  515,  516,\n         1325, 1320,  949,  517,  518,-32766,  522,  523,  524,  531,\n           77, 1302,  611,  718, 1101,  328,  332, 1097,-32766,-32766,\n        -32766, 1250,-32766, 1331,-32766,  949,-32766, 1099, 1096,-32766,\n         1077, 1290, 1309, 1073,-32766,-32766,-32766, -280,-32766, -102,\n        -32766,-32766,   14,   19, 1302,   24,-32766,  437,  323,  420,\n          625,-32766,-32766,-32766,  631,-32766,  659,-32766,-32766,-32766,\n          724, 1254,-32766,  -16, 1308, 1251, 1386,-32766,-32766,-32766,\n          735,-32766,  738,-32766,-32766,  742,  743, 1302,  745,-32766,\n          437,  746,  747,  748,-32766,-32766,-32766,  939,-32766,  300,\n        -32766,-32766,-32766,  752, 1309,-32766,  764,  737,  332,  765,\n        -32766,-32766,-32766, -253, -253, -253,-32766,-32766,  426,  390,\n          939,  756,-32766,  437,  926,  863, 1411, 1413,  885,  884,\n          990,  991,  980, 1023,-32766,  544, -252, -252, -252, 1412,\n          979,  977,  390,  925,  986, -110, -110, -110,  978,  981,\n         1283,  959,  969,  990,  991,  957, 1176, 1172,  544, 1126,\n         -110, -110, 1013, 1014,  657, -110,  925,  986, -110, -110,\n         -110, 1410,    2, 1368, -110, 1268,  951, 1383,    0,    0,\n          734, -253,    0,-32766,    0,    0,-32766,  863, 1059, 1054,\n         1053, 1052, 1058, 1055, 1056, 1057,    0,    0,    0,  951,\n            0,    0,    0,  734, -252,  305,    0,    0,   79,    0,\n            0, 1071,    0,    0,  332,    0,    0,    0,    0,    0,\n            0,    0, -110, -110,    0,    0,    0, -110,    0,    0,\n            0,    0,    0,    0,    0,  299, -110,    0,    0,    0,\n            0,    0,    0,    0,    0,-32766,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,  305,    0,    0,\n           79,    0,    0,    0,    0,    0,  332\n    );\n\n    protected array $actionCheck = array(\n            3,    4,    5,    6,    7,    8,   17,   10,   11,   12,\n           13,   14,   84,   76,    1,   87,   72,   74,   75,   82,\n            0,  108,  109,  110,   15,   82,   89,   90,   91,   10,\n           93,  118,   95,  103,   97,   38,   39,  100,   10,   11,\n           12,  104,  105,  106,  107,   10,   11,   12,  111,  112,\n           15,   10,   11,   12,  117,  118,   59,   82,  128,   31,\n            1,   33,   34,   35,   36,   37,  129,  124,    1,   31,\n           73,   74,   75,   76,   77,   78,   79,  164,    1,   82,\n            9,  153,  154,  139,  140,    9,   89,   90,   91,   92,\n           93,   94,   95,   96,   97,   98,   99,  100,  101,  102,\n          103,  104,  105,  106,  107,  108,  109,  110,  111,  112,\n          113,  114,  115,  116,  117,  118,  119,  120,  121,  122,\n          123,  124,    1,    9,   82,  128,  129,  130,  131,    9,\n          133,  134,  135,  136,  137,  138,    9,  162,  141,  142,\n          143,  144,  145,  146,  147,   86,  149,  150,    9,   82,\n           10,   11,   12,  156,  157,  158,  118,  160,  169,    3,\n            4,    5,    6,    7,    8,  168,   10,   11,   12,   13,\n           14,   31,   76,   33,   34,   35,   36,  168,   82,   83,\n           15,  143,  169,  119,  120,   89,   90,   91,  124,   93,\n          108,   95,  110,   97,   38,   39,  100,  133,    1,  108,\n          109,  105,  106,  107,  162,  167,    1,  111,  112,  118,\n           32,  169,  118,  117,  118,   59,   45,   46,   47,   48,\n           49,   50,   51,   52,  165,  129,   32,    9,  169,   73,\n           74,   75,   76,   77,   78,   79,  169,  143,   82,  168,\n          173,    9,  165,  161,  168,   89,   90,   91,   92,   93,\n           94,   95,   96,   97,   98,   99,  100,  101,  102,  103,\n          104,  105,  106,  107,  108,  109,  110,  111,  112,  113,\n          114,  115,  116,  117,  118,  119,  120,  121,  122,  123,\n          124,   84,  168,    9,  128,  129,  130,  131,  168,  133,\n          134,  135,  136,  137,  138,    1,    9,  141,  142,  143,\n          144,  145,  146,  147,   99,  149,  150,  108,  109,   10,\n           11,   12,  156,  157,  158,   32,  160,  118,    3,    4,\n            5,    6,    7,    8,  168,   10,   11,   12,   13,   14,\n           31,   76,   33,   34,   35,   72,   87,   82,    9,  142,\n           54,   50,   51,   52,   89,   90,   91,  169,   93,    9,\n           95,  118,   97,   38,   39,  100,  108,   15,  110,  165,\n          105,  106,  107,  164,  167,  165,  111,  112,   82,  169,\n          173,   85,  117,  118,   59,  118,  143,   53,   54,   55,\n           56,   57,   99,   59,  129,  134,  135,  136,   73,   74,\n           75,   76,   77,   78,   79,   71,  108,   82,  110,  142,\n          167,  152,  139,  140,   89,   90,   91,   92,   93,   94,\n           95,   96,   97,   98,   99,  100,  101,  102,  103,  104,\n          105,  106,  107,  108,  109,  110,  111,  112,  113,  114,\n          115,  116,  117,  118,  119,  120,  121,  122,  123,  124,\n            9,  118,   72,  128,  129,  130,  131,    1,  133,  134,\n          135,  136,  137,  138,    9,    9,  141,  142,  143,  144,\n          145,  146,  147,  169,  149,  150,  143,  173,   10,   11,\n           12,  156,  157,  158,    9,  160,   72,    3,    4,    5,\n            6,    7,    8,  168,   10,   11,   12,   13,   14,   31,\n          167,   33,   34,   35,   36,   37,   38,   39,   40,   41,\n           42,   43,   44,   10,   11,   12,  108,  165,  110,  139,\n          140,  169,   38,   39,  118,  119,  120,  121,  122,  123,\n          124,  125,  126,  127,   31,  155,   33,   34,   35,   36,\n           37,   38,   39,   59,   10,   11,   12,  167,   17,   10,\n           11,   12,    9,  139,  140,   10,   11,   73,   74,   75,\n           76,   77,   78,   79,    9,   31,   82,   33,   34,  155,\n           31,   38,   39,   89,   90,   91,   92,   93,   94,   95,\n           96,   97,   98,   99,  100,  101,  102,  103,  104,  105,\n          106,  107,  108,  109,  110,  111,  112,  113,  114,  115,\n          116,  117,  118,  119,  120,  121,  122,  123,  124,  166,\n          118,  168,  128,  129,  130,  131,    9,  133,  134,  135,\n          136,  137,  138,   82,    9,  141,  142,  143,  144,  145,\n          146,  147,   72,  149,  150,  143,   10,   11,   12,    9,\n          156,  157,  158,    9,  160,    3,    4,    5,    6,    7,\n            8,   82,   10,   11,   12,   13,   14,   31,    9,   33,\n           34,   35,   36,   37,   38,   39,   40,   41,   42,   43,\n           44,   45,   46,   47,   48,   49,   50,   51,   52,   53,\n           54,   55,   56,   57,    9,   59,    1,  118,  119,  120,\n          121,  122,  123,  124,  125,  126,  127,   71,    9,  139,\n          140,   59,  161,  162,  163,   51,   52,    1,   15,   53,\n           54,  170,   77,   78,   15,   73,   74,   75,   76,   77,\n           78,   79,   77,   78,   82,  103,  104,   72,  108,  109,\n           15,   89,   90,   91,   92,   93,   94,   95,   96,   97,\n           98,   99,  100,  101,  102,  103,  104,  105,  106,  107,\n          108,  109,  110,  111,  112,  113,  114,  115,  116,  117,\n          118,  119,  120,  121,  122,  123,  124,    1,   72,   84,\n          128,  129,  130,  131,   17,  133,  134,  135,  136,  137,\n          138,  108,  109,  141,  142,  143,  144,  145,  146,  147,\n           31,  149,  150,   15,  139,  140,   15,   31,  156,  157,\n          158,    2,    3,    4,    5,    6,    7,    8,   15,  103,\n          155,   17,   13,   14,  108,   16,  110,  113,  114,   17,\n           17,  115,  167,   17,  118,  119,  120,  121,  122,  123,\n          124,  125,  126,  127,  128,  139,  140,   17,   17,    1,\n           17,   82,   32,   17,   17,   17,   32,    1,   32,   32,\n           32,  155,   53,   54,  169,   36,   32,   58,  173,   60,\n           61,   62,   63,   64,   65,   66,   67,   68,   69,   70,\n           32,   72,   73,   74,   75,   76,  170,  118,   32,   80,\n           81,   82,   32,   84,  118,   32,   32,   88,   89,   90,\n           91,    1,   93,   32,   95,   32,   97,   72,   32,  100,\n          101,  142,  143,   32,  105,  106,  107,  108,  109,  143,\n          111,  112,   32,   32,   32,   82,  117,  118,   32,   32,\n          161,  162,  163,  124,   86,   32,  167,   32,  129,  130,\n          131,   32,   86,  167,   36,   38,   36,   36,   36,   36,\n          141,  142,   36,  144,  145,  146,  147,  148,  149,  150,\n          151,  118,   38,   38,   38,   59,  157,  158,   38,   39,\n          161,  162,  163,  164,  139,  140,  167,   77,   78,   79,\n          171,  172,  173,   39,   82,  142,   86,   72,   71,   85,\n          155,   92,   92,   79,   94,   94,   96,   99,   98,  115,\n           82,  116,   72,   73,  161,  162,  163,   84,  108,   87,\n           91,   84,  133,  165,   84,  137,   96,  169,   88,  119,\n          120,  165,  142,  102,  124,  169,    1,   98,  159,  152,\n           99,   99,  132,  133,  134,  135,  136,   17,   18,   19,\n           20,   21,   22,   23,   24,   25,   26,   27,   28,   29,\n           30,  102,    1,  159,  124,   38,   39,   32,   72,  164,\n          167,  172,   -1,   -1,   -1,  165,  138,    1,   -1,  169,\n          170,  141,  142,  137,  144,  145,  146,  147,  148,  149,\n          150,   61,   62,   32,   -1,  152,   -1,  157,  158,  155,\n          155,   -1,   72,   76,    0,    1,  155,  167,   32,   82,\n          155,  155,  172,  173,  161,  165,   89,   90,   91,  167,\n           93,   86,   95,  160,   97,  165,  165,  100,  166,   38,\n           39,  165,  105,  106,  107,  139,  140,  165,  111,  112,\n          165,  165,  165,  165,  117,  118,  165,   86,  165,  165,\n          165,  155,  165,  165,  165,  165,  129,  165,  165,  165,\n          169,  166,   86,  167,  166,  166,  166,   76,  166,  139,\n          140,  167,  167,   82,  167,  167,  167,   72,   73,  167,\n           89,   90,   91,  167,   93,  155,   95,  160,   97,   84,\n           86,  100,  167,   88,  168,  167,  105,  106,  107,  167,\n          165,  167,  111,  112,  169,  167,  167,  167,  117,  118,\n          167,  167,  108,  167,  110,   72,   73,  167,  167,  115,\n          129,  167,  167,  119,  120,  167,  165,   84,  124,  124,\n          169,   88,  167,  167,  167,  167,  132,  133,  134,  135,\n          136,  165,  167,  169,  167,  169,  167,  142,  167,  144,\n          145,  146,  147,  148,  149,  150,  167,  167,  170,  167,\n          156,   32,  157,  158,  167,  167,  167,  124,  167,  165,\n          167,  169,  167,  169,  170,  168,  168,  172,  173,  168,\n          168,  168,  168,  168,  168,  142,  168,  144,  145,  146,\n          147,  148,  149,  150,   32,  168,  168,  168,  168,  168,\n          157,  158,    1,  168,  168,   76,  168,  168,  168,  168,\n          167,   82,  168,  168,  168,  172,  173,  168,   89,   90,\n           91,  168,   93,  168,   95,    1,   97,  168,  168,  100,\n          168,  168,    1,  168,  105,  106,  107,  168,   76,  168,\n          111,  112,  168,  168,   82,  168,  117,  118,  168,  168,\n          168,   89,   90,   91,  168,   93,  168,   95,  129,   97,\n          168,  168,  100,   32,  168,  168,  168,  105,  106,  107,\n          169,   76,  169,  111,  112,  169,  169,   82,  169,  117,\n          118,  169,  169,  169,   89,   90,   91,   86,   93,   31,\n           95,  129,   97,  169,    1,  100,  169,  169,  173,  169,\n          105,  106,  107,  102,  103,  104,  111,  112,  170,  108,\n           86,  170,  117,  118,  170,   84,  170,  170,  170,  170,\n          119,  120,  170,  170,  129,  124,  102,  103,  104,  170,\n          170,  170,  108,  132,  133,  134,  135,  136,  170,  170,\n          170,  170,  170,  119,  120,  170,  170,  170,  124,  170,\n          119,  120,  170,  170,  170,  124,  132,  133,  134,  135,\n          136,  170,  167,  170,  133,  171,  165,  170,   -1,   -1,\n          169,  170,   -1,  142,   -1,   -1,  118,   84,  120,  121,\n          122,  123,  124,  125,  126,  127,   -1,   -1,   -1,  165,\n           -1,   -1,   -1,  169,  170,  164,   -1,   -1,  167,   -1,\n           -1,  143,   -1,   -1,  173,   -1,   -1,   -1,   -1,   -1,\n           -1,   -1,  119,  120,   -1,   -1,   -1,  124,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,  167,  133,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,  142,   -1,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,   -1,   -1,  164,   -1,   -1,\n          167,   -1,   -1,   -1,   -1,   -1,  173\n    );\n\n    protected array $actionBase = array(\n            0,  156,   -3,  315,  474,  474,  880, 1074, 1271, 1294,\n          749,  675,  531,  559,  836, 1031, 1031, 1046, 1031,  828,\n         1005,   42,   59,   59,   59,  963,  898,  632,  632,  898,\n          632,  997,  997,  997,  997, 1061, 1061,  -63,  -63,   96,\n         1232, 1199,  255,  255,  255,  255,  255, 1265,  255,  255,\n          255,  255,  255, 1265,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,  255,  255,  255,\n          255,  255,  255,  255,  255,  255,  255,   77,  194,  120,\n          205, 1197,  783, 1150, 1163, 1152, 1166, 1145, 1144, 1151,\n         1156, 1167, 1261, 1263,  889, 1254, 1267, 1158,  972, 1147,\n         1162,  962,  616,  616,  616,  616,  616,  616,  616,  616,\n          616,  616,  616,  616,  616,  616,  616,  616,  616,  616,\n          616,  616,  616,  616,  616,  616,  616,  616,  616,   19,\n           35,  535,   41,   41,   41,   41,   41,   41,   41,   41,\n           41,   41,   41,   41,   41,   41,   41,   41,   41,   41,\n           41,   41,  529,  529,  529,  910,  910,  524,  299, 1113,\n         1075, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113,  140,\n           28, 1000,  493,  493,  458,  458,  458,  458,  458,  696,\n         1328, 1301,  171,  171,  171,  171, 1363, 1363,  -70,  523,\n          248,  756,  291,  197,  -87,  644,   38,  199,  323,  323,\n          482,  482,  233,  233,  482,  482,  482,  324,  324,   94,\n           94,   94,   94,   82,  249,  860,   67,   67,   67,   67,\n          860,  860,  860,  860,  913,  869,  860, 1036, 1049,  860,\n          860,  370,  645,  966,  646,  646,  398,  -72,  -72,  398,\n           64,  -72,  294,  286,  257,  859,   91,  433,  257, 1073,\n          404,  686,  686,  815,  686,  686,  686,  923,  610,  923,\n         1141,  902,  902,  861,  807,  964, 1198, 1168,  901, 1252,\n          929, 1253, 1200,  342,  251,  -56,  263,  550,  806, 1139,\n         1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139, 1139,\n         1139, 1195,  523, 1141,  -25, 1247, 1249, 1195, 1195, 1195,\n          523,  523,  523,  523,  523,  523,  523,  523,  870,  523,\n          523,  694,  -25,  625,  635,  -25,  896,  523,  915,   77,\n           77,   77,   77,   77,   77,   77,   77,   77,   77,   77,\n          178,   77,   77,  194,   13,   13,   77,  200,  121,   13,\n           13,   13,  -11,   13,   77,   77,   77,  610,  886,  849,\n          663,  283,  874,  114,  886,  886,  886,   71,    9,   76,\n          809,  888,  288,  882,  882,  882,  907,  986,  986,  882,\n          903,  882,  907,  882,  882,  986,  986,  875,  986,  274,\n          620,  465,  597,  624,  986,  340,  882,  882,  882,  882,\n          916,  986,  127,  139,  639,  882,  329,  287,  882,  882,\n          916,  858,  876,  908,  986,  986,  986,  916,  545,  908,\n          908,  908,  931,  936,  864,  872,  445,  431,  679,  232,\n          924,  872,  872,  882,  605,  864,  872,  864,  872,  933,\n          872,  872,  872,  864,  872,  903,  533,  872,  813,  665,\n          218,  872,  882,   20, 1008, 1009,  800, 1010, 1002, 1013,\n         1069, 1014, 1016, 1171,  982, 1028, 1004, 1020, 1071,  998,\n          995,  885,  792,  793,  921,  914,  979,  897,  897,  897,\n          975,  977,  897,  897,  897,  897,  897,  897,  897,  897,\n          792,  932,  926,  899, 1037,  796,  810, 1114,  857, 1214,\n         1264, 1036, 1008, 1016,  804, 1004, 1020,  998,  995,  856,\n          853,  844,  851,  843,  840,  808,  814,  871, 1116, 1119,\n         1021,  920,  811, 1085, 1038, 1211, 1044, 1045, 1047, 1088,\n         1123,  942, 1125, 1216,  895, 1217, 1218,  965, 1051, 1173,\n          897,  974,  873,  968, 1049,  978,  792,  969, 1129, 1130,\n         1081,  961, 1097, 1098, 1072,  911,  884,  970, 1219, 1059,\n         1060, 1062, 1176, 1177,  930, 1082,  996, 1099,  912, 1058,\n         1100, 1101, 1105, 1106, 1179, 1222, 1182,  922, 1183,  945,\n          879, 1077,  909, 1223,  165,  892,  893,  906, 1068,  683,\n         1035, 1184, 1208, 1229, 1108, 1109, 1110, 1230, 1231, 1024,\n          946, 1083,  900, 1084, 1078,  947,  948,  689,  905, 1132,\n          890,  891,  904,  705,  768, 1238, 1239, 1240, 1025,  877,\n          894,  951,  953, 1133,  887, 1135, 1241,  771,  954, 1242,\n         1115,  816,  817,  521,  784,  747,  818,  881, 1194,  925,\n          865,  878, 1067,  817,  883,  955, 1245,  957,  958,  959,\n         1111,  960, 1086, 1246,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  632,  632,  632,\n          632,  789,  789,  789,  789,  789,  789,  789,  632,  789,\n          789,  789,  632,  632,    0,    0,  632,    0,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  789,  789,  789,  789,  789,  789,\n          789,  789,  789,  789,  616,  616,  616,  616,  616,  616,\n          616,  616,  616,  616,  616,  616,  616,  616,  616,  616,\n          616,  616,  616,  616,  616,  616,  616,  616,  616,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,  616,  616,  616,  616,\n          616,  616,  616,  616,  616,  616,  616,  616,  616,  616,\n          616,  616,  616,  616,  616,  616,  616,  616,  616,  616,\n          616,  616,  823,  823,  616,  616,  823,  823,  823,  823,\n          823,  823,  823,  823,  823,  823,  616,  616,    0,  616,\n          616,  616,  616,  616,  616,  616,  875,  823,  823,  324,\n          324,  324,  324,  823,  823,  396,  396,  396,  823,  324,\n          823,   64,  324,  823,   64,  823,  823,  823,  823,  823,\n          823,  823,  823,  823,    0,    0,  823,  823,  823,  823,\n          -25,  -72,  823,  903,  903,  903,  903,  823,  823,  823,\n          823,  -72,  -72,  823,  -57,  -57,  823,  823,    0,    0,\n            0,  324,  324,  -25,    0,    0,  -25,    0,    0,  903,\n          903,  823,   64,  875,  446,  823,  342,    0,    0,    0,\n            0,    0,    0,    0,  -25,  903,  -25,  523,  -72,  -72,\n          523,  523,   13,   77,  446,  612,  612,  612,  612,   77,\n            0,    0,    0,    0,    0,  610,  875,  875,  875,  875,\n          875,  875,  875,  875,  875,  875,  875,  875,  903,    0,\n          875,    0,  875,  875,  903,  903,  903,    0,    0,    0,\n            0,    0,    0,    0,    0,  986,    0,    0,    0,    0,\n            0,    0,    0,  903,    0,  986,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,  903,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,  897,  911,    0,    0,  911,\n            0,  897,  897,  897,    0,    0,    0,  905,  887\n    );\n\n    protected array $actionDefault = array(\n            3,32767,32767,32767,  102,  102,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,  100,\n        32767,  632,  632,  632,  632,32767,32767,  257,  102,32767,\n        32767,  503,  417,  417,  417,32767,32767,32767,  576,  576,\n          576,  576,  576,   17,32767,32767,32767,32767,32767,32767,\n        32767,  503,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,   36,    7,    8,   10,   11,   49,  338,  100,\n        32767,32767,32767,32767,32767,32767,32767,32767,  102,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,  404,  625,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,  497,  507,  485,  486,  488,  489,  416,  577,\n          631,  344,  628,  342,  415,  146,  354,  343,  245,  261,\n          508,  262,  509,  512,  513,  218,  401,  150,  151,  448,\n          504,  450,  502,  506,  449,  422,  429,  430,  431,  432,\n          433,  434,  435,  436,  437,  438,  439,  440,  441,  420,\n          421,  505,  482,  481,  480,32767,32767,  446,  447,32767,\n        32767,32767,32767,32767,32767,32767,32767,  102,32767,  451,\n          454,  419,  452,  453,  470,  471,  468,  469,  472,32767,\n          323,32767,  473,  474,  475,  476,32767,32767,  382,  196,\n          380,32767,  477,32767,  111,  455,  323,  111,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,  461,  462,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,  102,32767,32767,32767,\n          100,  520,  570,  479,  456,  457,32767,  545,32767,  102,\n        32767,  547,32767,32767,32767,32767,32767,32767,32767,32767,\n          572,  443,  445,  540,  626,  423,  629,32767,  533,  100,\n          196,32767,  546,  196,  196,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,  571,32767,  639,  533,  110,\n          110,  110,  110,  110,  110,  110,  110,  110,  110,  110,\n          110,32767,  196,  110,32767,  110,  110,32767,32767,  100,\n          196,  196,  196,  196,  196,  196,  196,  196,  548,  196,\n          196,  191,32767,  271,  273,  102,  594,  196,  550,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,  404,32767,32767,32767,32767,  533,  466,  139,\n        32767,  535,  139,  578,  458,  459,  460,  578,  578,  578,\n          319,  296,32767,32767,32767,32767,32767,  548,  548,  100,\n          100,  100,  100,32767,32767,32767,32767,  111,  519,   99,\n           99,   99,   99,   99,  103,  101,32767,32767,32767,32767,\n          226,32767,  101,  101,   99,32767,  101,  101,32767,32767,\n          226,  228,  215,  230,32767,  598,  599,  226,  101,  230,\n          230,  230,  250,  250,  522,  325,  101,   99,  101,  101,\n          198,  325,  325,32767,  101,  522,  325,  522,  325,  200,\n          325,  325,  325,  522,  325,32767,  101,  325,  217,   99,\n           99,  325,32767,32767,32767,32767,  535,32767,32767,32767,\n        32767,32767,32767,32767,  225,32767,32767,32767,32767,32767,\n        32767,32767,32767,  565,32767,  583,  596,  464,  465,  467,\n          582,  580,  490,  491,  492,  493,  494,  495,  496,  499,\n          627,32767,  539,32767,32767,32767,  353,32767,  637,32767,\n        32767,32767,    9,   74,  528,   42,   43,   51,   57,  554,\n          555,  556,  557,  551,  552,  558,  553,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,  638,32767,  578,32767,32767,32767,32767,\n          463,  560,  604,32767,32767,  579,  630,32767,32767,32767,\n        32767,32767,32767,32767,32767,  139,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,  565,32767,  137,32767,\n        32767,32767,32767,32767,32767,32767,32767,  561,32767,32767,\n        32767,  578,32767,32767,32767,32767,  321,  318,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,  578,32767,32767,32767,32767,32767,\n          298,32767,  315,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,  400,  535,  301,  303,  304,32767,32767,32767,32767,\n          376,32767,32767,32767,32767,32767,32767,32767,32767,32767,\n        32767,32767,32767,32767,  153,  153,    3,    3,  356,  153,\n          153,  153,  356,  356,  153,  356,  356,  356,  153,  153,\n          153,  153,  153,  153,  153,  283,  186,  265,  268,  250,\n          250,  153,  368,  153,  402,  402,  411\n    );\n\n    protected array $goto = array(\n          201,  169,  201,  201,  201, 1069,  598,  719,  448,  684,\n          644,  681,  443,  345,  341,  342,  344,  615,  447,  346,\n          449,  661,  481,  728,  570,  570,  570,  570, 1245,  626,\n          172,  172,  172,  172,  225,  202,  198,  198,  182,  184,\n          220,  198,  198,  198,  198,  198, 1195,  199,  199,  199,\n          199,  199, 1195,  192,  193,  194,  195,  196,  197,  222,\n          220,  223,  557,  558,  438,  559,  562,  563,  564,  565,\n          566,  567,  568,  569,  173,  174,  175,  200,  176,  177,\n          178,  170,  179,  180,  181,  183,  219,  221,  224,  242,\n          247,  248,  259,  260,  262,  263,  264,  265,  266,  267,\n          268,  272,  273,  274,  275,  282,  285,  297,  298,  324,\n          325,  444,  445,  446,  620,  226,  227,  228,  229,  230,\n          231,  232,  233,  234,  235,  236,  237,  238,  239,  240,\n          241,  193,  194,  195,  196,  197,  222,  203,  204,  205,\n          206,  243,  185,  186,  207,  187,  208,  204,  188,  244,\n          203,  168,  209,  210,  189,  211,  212,  213,  190,  214,\n          215,  171,  216,  217,  218,  191,  287,  284,  287,  287,\n          883,  255,  255,  255,  255,  255, 1125,  605,  487,  487,\n          622,  758,  660,  662, 1103,  359,  682,  487, 1075, 1074,\n          706,  709, 1041,  717,  726, 1037,  733,  922,  879,  922,\n          922,  253,  253,  253,  253,  250,  256,  646,  646, 1078,\n         1079, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332, 1332,\n         1332,  880,  351,  938,  933,  934,  947,  889,  935,  886,\n          936,  937,  887,  890,  476,  941,  894,  476, 1044, 1044,\n          893,  364,  364,  364,  364,  352,  351,  532, 1131, 1127,\n         1128, 1351, 1351,  331,  315, 1351, 1351, 1351, 1351, 1351,\n         1351, 1351, 1351, 1351, 1351, 1069, 1301, 1072, 1072,  704,\n          983, 1301, 1301, 1064, 1080, 1081, 1069,  942, 1301,  943,\n          458, 1069,  881, 1069, 1069, 1069, 1069, 1069, 1069, 1069,\n         1069, 1069,  897,  855, 1069, 1069, 1069, 1069,  677,  678,\n         1301,  695,  696,  697, 1006, 1301, 1301, 1301, 1301,  450,\n          909, 1301,  436,  896, 1301, 1301, 1382, 1382, 1382, 1382,\n          915,  581,  574,  499,  612,  450,  367,  971,  971,  955,\n          501, 1076, 1076,  956, 1400, 1400,  367,  367,  688, 1087,\n         1083, 1084,  572,  411,  414,  623,  627,  572,  572,  367,\n          367, 1400,  357,  367,  572, 1417, 1377, 1378,  317,  574,\n          581,  607,  608,  318,  618,  624, 1390,  640,  641, 1027,\n          576, 1403, 1403,  367,  367,   28,  474,  520,  442,  521,\n          635, 1000, 1000, 1000, 1000,  527,  409,  474, 1348, 1348,\n          994, 1001, 1348, 1348, 1348, 1348, 1348, 1348, 1348, 1348,\n         1348, 1348,  633,  647,  650,  651,  652,  653,  674,  675,\n          676,  730,  732,  561,  561,  258,  258,  561,  561,  561,\n          561,  561,  561,  561,  561,  561,  561,  610, 1362,  467,\n          683,  467,  876,  616,  638,  876,  467,  467, 1191,  861,\n         1373,  360,  361, 1093,  456, 1373, 1373,  560,  560,  705,\n          432,  560, 1373,  560,  560,  560,  560,  560,  560,  560,\n          560, 1277,  975,  575,  602,  575, 1278, 1281,  976,  575,\n         1282,  602,  689,  412,  480, 1384, 1384, 1384, 1384,  347,\n          873,  716,  576,  861,  876,  861,  490,  619,  491,  492,\n          639,    8,  857,    9,  902,  907,  989,  716, 1408, 1409,\n          716, 1369,  418, 1296,  278,  899,  330, 1174,  424,  425,\n         1292,  330,  330,  693, 1049,  694, 1114,  429,  430,  431,\n          761,  707, 1060,  905,  433, 1102, 1104, 1107,  355,  467,\n          467,  467,  467,  467,  467,  467,  467,  467,  467,  467,\n          467,  419,  339,  467,  911,  467,  467, 1294,  628,  629,\n         1116,  497,  960, 1181,  621, 1144, 1371, 1371, 1116, 1118,\n         1297, 1298, 1011, 1284, 1046, 1151, 1179, 1152,  731,  871,\n          528,  722,  901, 1142,  687, 1025, 1284,  496, 1375, 1376,\n          895,  910,  898, 1113, 1117,  998,  427,  727, 1165, 1299,\n         1359, 1360, 1291, 1030,  386, 1009, 1002,    0,  757,    0,\n            0,  573, 1039, 1034,  654,  656,  658,    0,    0,    0,\n            0,    0,    0,    0,    0,  876,    0,    0,  999,    0,\n          766,  766,    0,    0,    0,    0,    0,    0,    0,    0,\n            0,    0,    0,    0,    0,    0,    0,    0,    0,    0,\n         1163,  914\n    );\n\n    protected array $gotoCheck = array(\n           42,   42,   42,   42,   42,   73,  127,   73,   66,   66,\n           56,   56,   66,   66,   66,   66,   66,   66,   66,   66,\n           66,   66,  159,    9,  107,  107,  107,  107,  159,  107,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   23,   23,   23,   23,\n           15,    5,    5,    5,    5,    5,   15,   48,  157,  157,\n          134,   48,   48,   48,  131,   97,   48,  157,  119,  119,\n           48,   48,   48,   48,   48,   48,   48,   25,   25,   25,\n           25,    5,    5,    5,    5,    5,    5,  108,  108,  120,\n          120,  108,  108,  108,  108,  108,  108,  108,  108,  108,\n          108,   26,  177,   15,   15,   15,   15,   15,   15,   15,\n           15,   15,   15,   15,   83,   15,   15,   83,  107,  107,\n           15,   24,   24,   24,   24,  177,  177,   76,   15,   15,\n           15,  179,  179,  178,  178,  179,  179,  179,  179,  179,\n          179,  179,  179,  179,  179,   73,   73,   89,   89,   89,\n           89,   73,   73,   89,   89,   89,   73,   65,   73,   65,\n           83,   73,   27,   73,   73,   73,   73,   73,   73,   73,\n           73,   73,   35,    6,   73,   73,   73,   73,   86,   86,\n           73,   86,   86,   86,   49,   73,   73,   73,   73,  118,\n           35,   73,   43,   35,   73,   73,    9,    9,    9,    9,\n           45,   76,   76,   84,  181,  118,   14,    9,    9,   73,\n           84,  118,  118,   73,  191,  191,   14,   14,  118,  118,\n          118,  118,   19,   59,   59,   59,   59,   19,   19,   14,\n           14,  191,  188,   14,   19,   14,  187,  187,   76,   76,\n           76,   76,   76,   76,   76,   76,  190,   76,   76,  103,\n           14,  191,  191,   14,   14,   76,   19,  163,   13,  163,\n           13,   19,   19,   19,   19,  163,   62,   19,  180,  180,\n           19,   19,  180,  180,  180,  180,  180,  180,  180,  180,\n          180,  180,   81,   81,   81,   81,   81,   81,   81,   81,\n           81,   81,   81,  182,  182,    5,    5,  182,  182,  182,\n          182,  182,  182,  182,  182,  182,  182,  104,   14,   23,\n           64,   23,   22,    2,    2,   22,   23,   23,  158,   12,\n          134,   97,   97,  115,  113,  134,  134,  165,  165,  117,\n           14,  165,  134,  165,  165,  165,  165,  165,  165,  165,\n          165,   79,   79,    9,    9,    9,   79,   79,   79,    9,\n           79,    9,  121,    9,    9,  134,  134,  134,  134,   29,\n           18,    7,   14,   12,   22,   12,    9,    9,    9,    9,\n           80,   46,    7,   46,   39,    9,   92,    7,    9,    9,\n            7,  134,   28,   20,   24,   37,   24,  156,   82,   82,\n          169,   24,   24,   82,  110,   82,  133,   82,   82,   82,\n           99,   82,  114,    9,   82,  130,  130,  130,   82,   23,\n           23,   23,   23,   23,   23,   23,   23,   23,   23,   23,\n           23,   31,    9,   23,   41,   23,   23,   14,   17,   17,\n          134,  160,   17,   17,    8,    8,  134,  134,  134,  136,\n           20,   20,   96,   20,   17,  149,  149,  149,    8,   20,\n            8,    8,   17,    8,   17,   17,   20,  185,  185,  185,\n           17,   16,   16,   16,   16,   93,   93,   93,  152,   20,\n           20,   20,   17,   50,  141,   16,   50,   -1,   50,   -1,\n           -1,   50,   50,   50,   85,   85,   85,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,   22,   -1,   -1,   16,   -1,\n           24,   24,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n           -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,\n           16,   16\n    );\n\n    protected array $gotoBase = array(\n            0,    0, -303,    0,    0,  170,  280,  471,  543,   10,\n            0,    0,  136,   31,   22, -186,  111,   66,  164,   71,\n           95,    0,  148,  160,  235,  191,  214,  275,  155,  176,\n            0,   86,    0,    0,    0,  -92,    0,  156,    0,  165,\n            0,   85,   -1,  286,    0,  291, -270,    0, -558,  284,\n          579,    0,    0,    0,    0,    0,  -33,    0,    0,  294,\n            0,    0,  341,    0,  184,  261, -237,    0,    0,    0,\n            0,    0,    0,   -5,    0,    0,  -32,    0,    0,   37,\n          172,   32,   -3,  -50, -167,  105, -444,    0,    0,  -21,\n            0,    0,  161,  274,    0,    0,  101, -318,    0,   97,\n            0,    0,    0,  331,  381,    0,    0,   -7,  -38,    0,\n          131,    0,    0,  158,   90,  162,    0,  159,   39, -100,\n          -83,  173,    0,    0,    0,    0,    0,    4,    0,    0,\n          522,  182,    0,  127,  169,    0,   99,    0,    0,    0,\n            0, -171,    0,    0,    0,    0,    0,    0,    0,  287,\n            0,    0,  126,    0,    0,    0,  144,  141,  188, -255,\n           93,    0,    0, -138,    0,  202,    0,    0,    0,  128,\n            0,    0,    0,    0,    0,    0,    0,  -82,  -74,    6,\n          143,  292,  168,    0,    0,  270,    0,  -31,  319,    0,\n          332,   20,    0,    0\n    );\n\n    protected array $gotoDefault = array(\n        -32768,  533,  768,    7,  769,  964,  844,  853,  597,  551,\n          729,  356,  648,  439, 1367,  940, 1180,  617,  872, 1310,\n         1316,  475,  875,  336,  755,  952,  923,  924,  415,  402,\n          888,  413,  672,  649,  514,  908,  471,  900,  506,  903,\n          470,  912,  167,  435,  530,  916,    6,  919,  579,  950,\n         1004,  403,  927,  404,  700,  929,  601,  931,  932,  410,\n          416,  417, 1185,  609,  645,  944,  261,  603,  945,  401,\n          946,  954,  406,  408,  710,  486,  525,  519,  428, 1146,\n          604,  632,  669,  464,  493,  643,  655,  642,  500,  451,\n          434,  335,  988,  996,  507,  484, 1010,  358, 1018,  763,\n         1193,  663,  509, 1026,  664, 1033, 1036,  552,  553,  498,\n         1048,  270, 1051,  510, 1061,   26,  690, 1066, 1067,  691,\n          665, 1089,  666,  692,  667, 1091,  483,  599, 1194,  482,\n         1106, 1112,  472, 1115, 1356,  473, 1119,  269, 1122,  286,\n          362,  385,  452, 1129, 1130,   12, 1136,  720,  721,   25,\n          280,  529, 1164,  711, 1170,  279, 1173,  469, 1192,  468,\n         1265, 1267,  580,  511, 1285,  321, 1288,  703,  526, 1293,\n          465, 1358,  466,  554,  494,  343,  555, 1401,  314,  365,\n          340,  571,  322,  366,  556,  495, 1364, 1372,  337,   34,\n         1391, 1402,  614,  637\n    );\n\n    protected array $ruleToNonTerminal = array(\n            0,    1,    3,    3,    2,    5,    5,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    6,    6,    6,\n            6,    6,    6,    6,    6,    6,    6,    7,    7,    7,\n            7,    7,    7,    7,    7,    8,    8,    9,   10,   11,\n           11,   11,   12,   12,   13,   13,   14,   15,   15,   16,\n           16,   17,   17,   18,   18,   21,   21,   22,   23,   23,\n           24,   24,    4,    4,    4,    4,    4,    4,    4,    4,\n            4,    4,    4,    4,   29,   29,   30,   30,   32,   34,\n           34,   28,   36,   36,   33,   38,   38,   35,   35,   37,\n           37,   39,   39,   31,   40,   40,   41,   43,   44,   44,\n           45,   45,   46,   46,   48,   47,   47,   47,   47,   49,\n           49,   49,   49,   49,   49,   49,   49,   49,   49,   49,\n           49,   49,   49,   49,   49,   49,   49,   49,   49,   49,\n           49,   49,   49,   25,   25,   50,   69,   69,   72,   72,\n           71,   70,   70,   63,   75,   75,   76,   76,   77,   77,\n           78,   78,   79,   79,   80,   80,   80,   80,   26,   26,\n           27,   27,   27,   27,   27,   88,   88,   90,   90,   83,\n           83,   91,   91,   92,   92,   92,   84,   84,   87,   87,\n           85,   85,   93,   94,   94,   57,   57,   65,   65,   68,\n           68,   68,   67,   95,   95,   96,   58,   58,   58,   58,\n           97,   97,   98,   98,   99,   99,  100,  101,  101,  102,\n          102,  103,  103,   55,   55,   51,   51,  105,   53,   53,\n          106,   52,   52,   54,   54,   64,   64,   64,   64,   81,\n           81,  109,  109,  111,  111,  112,  112,  112,  112,  112,\n          112,  112,  112,  110,  110,  110,  115,  115,  115,  115,\n           89,   89,  118,  118,  118,  119,  119,  116,  116,  120,\n          120,  122,  122,  123,  123,  117,  124,  124,  121,  125,\n          125,  125,  125,  113,  113,   82,   82,   82,   20,   20,\n           20,  128,  128,  128,  128,  129,  129,  129,  127,  126,\n          126,  131,  131,  131,  130,  130,   60,  132,  132,  133,\n           61,  135,  135,  136,  136,  137,  137,   86,  138,  138,\n          138,  138,  138,  138,  138,  138,  144,  144,  145,  145,\n          146,  146,  146,  146,  146,  147,  148,  148,  143,  143,\n          139,  139,  142,  142,  150,  150,  149,  149,  149,  149,\n          149,  149,  149,  149,  149,  149,  140,  151,  151,  153,\n          152,  152,  141,  141,  114,  114,  154,  154,  156,  156,\n          156,  155,  155,   62,  104,  157,  157,   56,   56,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,   42,   42,   42,   42,\n           42,   42,   42,   42,   42,   42,  164,  165,  165,  166,\n          158,  158,  163,  163,  167,  168,  168,  169,  170,  171,\n          171,  171,  171,   19,   19,   73,   73,   73,   73,  159,\n          159,  159,  159,  173,  173,  162,  162,  162,  160,  160,\n          179,  179,  179,  179,  179,  179,  179,  179,  179,  179,\n          180,  180,  180,  108,  182,  182,  182,  182,  161,  161,\n          161,  161,  161,  161,  161,  161,   59,   59,  176,  176,\n          176,  176,  176,  183,  183,  172,  172,  172,  172,  184,\n          184,  184,  184,  184,   74,   74,   66,   66,   66,   66,\n          134,  134,  134,  134,  187,  186,  175,  175,  175,  175,\n          175,  175,  174,  174,  174,  185,  185,  185,  185,  107,\n          181,  189,  189,  188,  188,  190,  190,  190,  190,  190,\n          190,  190,  190,  178,  178,  178,  178,  177,  192,  191,\n          191,  191,  191,  191,  191,  191,  191,  193,  193,  193,\n          193\n    );\n\n    protected array $ruleToLength = array(\n            1,    1,    2,    0,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    0,\n            1,    0,    1,    1,    2,    1,    3,    4,    1,    2,\n            0,    1,    1,    1,    1,    4,    3,    5,    4,    3,\n            4,    1,    3,    4,    1,    1,    8,    7,    2,    3,\n            1,    2,    3,    1,    2,    3,    1,    1,    3,    1,\n            3,    1,    2,    2,    3,    1,    3,    2,    3,    1,\n            3,    3,    2,    0,    1,    1,    1,    1,    1,    3,\n            7,   10,    5,    7,    9,    5,    3,    3,    3,    3,\n            3,    3,    1,    2,    5,    7,    9,    6,    5,    6,\n            3,    2,    1,    1,    1,    1,    0,    2,    1,    3,\n            8,    0,    4,    2,    1,    3,    0,    1,    0,    1,\n            0,    1,    3,    1,    1,    1,    1,    1,    8,    9,\n            7,    8,    7,    6,    8,    0,    2,    0,    2,    1,\n            2,    1,    2,    1,    1,    1,    0,    2,    0,    2,\n            0,    2,    2,    1,    3,    1,    4,    1,    4,    1,\n            1,    4,    2,    1,    3,    3,    3,    4,    4,    5,\n            0,    2,    4,    3,    1,    1,    7,    0,    2,    1,\n            3,    3,    4,    1,    4,    0,    2,    5,    0,    2,\n            6,    0,    2,    0,    3,    1,    2,    1,    1,    2,\n            0,    1,    3,    0,    2,    1,    1,    1,    1,    1,\n            1,    1,    1,    7,    9,    6,    1,    2,    1,    1,\n            1,    1,    1,    1,    1,    1,    3,    3,    3,    1,\n            3,    3,    3,    3,    3,    1,    3,    3,    1,    1,\n            2,    1,    1,    0,    1,    0,    2,    2,    2,    4,\n            3,    2,    4,    4,    3,    3,    1,    3,    1,    1,\n            3,    2,    2,    3,    1,    1,    2,    3,    1,    1,\n            2,    3,    1,    1,    3,    2,    0,    1,    5,    7,\n            5,    6,   10,    3,    5,    1,    1,    3,    0,    2,\n            4,    5,    4,    4,    4,    3,    1,    1,    1,    1,\n            1,    1,    0,    1,    1,    2,    1,    1,    1,    1,\n            1,    1,    1,    1,    1,    1,    2,    1,    3,    1,\n            1,    3,    0,    2,    0,    3,    5,    8,    1,    3,\n            3,    0,    2,    2,    2,    3,    1,    0,    1,    1,\n            3,    3,    3,    4,    4,    1,    1,    2,    2,    3,\n            3,    3,    3,    3,    3,    3,    3,    3,    3,    3,\n            3,    3,    2,    2,    2,    2,    3,    3,    3,    3,\n            3,    3,    3,    3,    3,    3,    3,    3,    3,    3,\n            3,    3,    3,    3,    2,    2,    2,    2,    3,    3,\n            3,    3,    3,    3,    3,    3,    3,    3,    3,    3,\n            5,    4,    3,    4,    4,    2,    2,    4,    2,    2,\n            2,    2,    2,    2,    2,    2,    2,    2,    2,    2,\n            1,    3,    2,    1,    2,    4,    2,    2,    8,    9,\n            8,    9,    9,   10,    9,   10,    8,    3,    2,    2,\n            1,    1,    0,    4,    2,    1,    3,    2,    1,    2,\n            2,    2,    4,    1,    1,    1,    1,    1,    1,    1,\n            1,    3,    1,    1,    1,    0,    1,    1,    0,    1,\n            1,    1,    1,    1,    1,    1,    1,    1,    1,    1,\n            3,    5,    3,    3,    4,    1,    1,    3,    1,    1,\n            1,    1,    1,    3,    2,    3,    0,    1,    1,    3,\n            1,    1,    1,    1,    1,    1,    3,    1,    1,    1,\n            4,    1,    4,    4,    0,    1,    1,    1,    3,    3,\n            1,    4,    2,    2,    1,    3,    1,    4,    3,    3,\n            3,    3,    1,    3,    1,    1,    3,    1,    1,    4,\n            1,    1,    1,    3,    1,    1,    2,    1,    3,    4,\n            3,    2,    0,    2,    2,    1,    2,    1,    1,    1,\n            4,    3,    3,    3,    3,    6,    3,    1,    1,    2,\n            1\n    );\n\n    protected function initReduceCallbacks(): void {\n        $this->reduceCallbacks = [\n            0 => null,\n            1 => static function ($self, $stackPos) {\n                 $self->semValue = $self->handleNamespaces($self->semStack[$stackPos-(1-1)]);\n            },\n            2 => static function ($self, $stackPos) {\n                 if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; } $self->semValue = $self->semStack[$stackPos-(2-1)];;\n            },\n            3 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            4 => static function ($self, $stackPos) {\n                 $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);;\n            if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            5 => null,\n            6 => null,\n            7 => null,\n            8 => null,\n            9 => null,\n            10 => null,\n            11 => null,\n            12 => null,\n            13 => null,\n            14 => null,\n            15 => null,\n            16 => null,\n            17 => null,\n            18 => null,\n            19 => null,\n            20 => null,\n            21 => null,\n            22 => null,\n            23 => null,\n            24 => null,\n            25 => null,\n            26 => null,\n            27 => null,\n            28 => null,\n            29 => null,\n            30 => null,\n            31 => null,\n            32 => null,\n            33 => null,\n            34 => null,\n            35 => null,\n            36 => null,\n            37 => null,\n            38 => null,\n            39 => null,\n            40 => null,\n            41 => null,\n            42 => null,\n            43 => null,\n            44 => null,\n            45 => null,\n            46 => null,\n            47 => null,\n            48 => null,\n            49 => null,\n            50 => null,\n            51 => null,\n            52 => null,\n            53 => null,\n            54 => null,\n            55 => null,\n            56 => null,\n            57 => null,\n            58 => null,\n            59 => null,\n            60 => null,\n            61 => null,\n            62 => null,\n            63 => null,\n            64 => null,\n            65 => null,\n            66 => null,\n            67 => null,\n            68 => null,\n            69 => null,\n            70 => null,\n            71 => null,\n            72 => null,\n            73 => null,\n            74 => null,\n            75 => null,\n            76 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)]; if ($self->semValue === \"<?=\") $self->emitError(new Error('Cannot use \"<?=\" as an identifier', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])));\n            },\n            77 => null,\n            78 => null,\n            79 => null,\n            80 => null,\n            81 => null,\n            82 => null,\n            83 => null,\n            84 => null,\n            85 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            86 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            87 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            88 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            89 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            90 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            91 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            92 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            93 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            94 => null,\n            95 => static function ($self, $stackPos) {\n                 $self->semValue = new Name(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            96 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            97 => static function ($self, $stackPos) {\n                 /* nothing */\n            },\n            98 => static function ($self, $stackPos) {\n                 /* nothing */\n            },\n            99 => static function ($self, $stackPos) {\n                 /* nothing */\n            },\n            100 => static function ($self, $stackPos) {\n                 $self->emitError(new Error('A trailing comma is not allowed here', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])));\n            },\n            101 => null,\n            102 => null,\n            103 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Attribute($self->semStack[$stackPos-(1-1)], [], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            104 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Attribute($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            105 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            106 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            107 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\AttributeGroup($self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            108 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            109 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            110 => static function ($self, $stackPos) {\n                 $self->semValue = [];\n            },\n            111 => null,\n            112 => null,\n            113 => null,\n            114 => null,\n            115 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\HaltCompiler($self->handleHaltCompiler(), $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            116 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Namespace_($self->semStack[$stackPos-(3-2)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            $self->semValue->setAttribute('kind', Stmt\\Namespace_::KIND_SEMICOLON);\n            $self->checkNamespace($self->semValue);\n            },\n            117 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Namespace_($self->semStack[$stackPos-(5-2)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            $self->semValue->setAttribute('kind', Stmt\\Namespace_::KIND_BRACED);\n            $self->checkNamespace($self->semValue);\n            },\n            118 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Namespace_(null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            $self->semValue->setAttribute('kind', Stmt\\Namespace_::KIND_BRACED);\n            $self->checkNamespace($self->semValue);\n            },\n            119 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Use_($self->semStack[$stackPos-(3-2)], Stmt\\Use_::TYPE_NORMAL, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            120 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Use_($self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            121 => null,\n            122 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Const_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), []);\n            },\n            123 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Const_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(4-1)]);\n            $self->checkConstantAttributes($self->semValue);\n            },\n            124 => static function ($self, $stackPos) {\n                 $self->semValue = Stmt\\Use_::TYPE_FUNCTION;\n            },\n            125 => static function ($self, $stackPos) {\n                 $self->semValue = Stmt\\Use_::TYPE_CONSTANT;\n            },\n            126 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\GroupUse($self->semStack[$stackPos-(8-3)], $self->semStack[$stackPos-(8-6)], $self->semStack[$stackPos-(8-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            },\n            127 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\GroupUse($self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-5)], Stmt\\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            },\n            128 => null,\n            129 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            130 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            131 => null,\n            132 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            133 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            134 => null,\n            135 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            136 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            137 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UseItem($self->semStack[$stackPos-(1-1)], null, Stmt\\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(1-1));\n            },\n            138 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UseItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], Stmt\\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(3-3));\n            },\n            139 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UseItem($self->semStack[$stackPos-(1-1)], null, Stmt\\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(1-1));\n            },\n            140 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UseItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], Stmt\\Use_::TYPE_UNKNOWN, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->checkUseUse($self->semValue, $stackPos-(3-3));\n            },\n            141 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)]; $self->semValue->type = Stmt\\Use_::TYPE_NORMAL;\n            },\n            142 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)]; $self->semValue->type = $self->semStack[$stackPos-(2-1)];\n            },\n            143 => null,\n            144 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            145 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            146 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Const_($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            147 => null,\n            148 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            149 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            150 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Const_(new Node\\Identifier($self->semStack[$stackPos-(3-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)],  $self->tokenEndStack[$stackPos-(3-1)])), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            151 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Const_(new Node\\Identifier($self->semStack[$stackPos-(3-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)],  $self->tokenEndStack[$stackPos-(3-1)])), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            152 => static function ($self, $stackPos) {\n                 if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; } $self->semValue = $self->semStack[$stackPos-(2-1)];;\n            },\n            153 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            154 => static function ($self, $stackPos) {\n                 $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);;\n            if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            155 => null,\n            156 => null,\n            157 => null,\n            158 => static function ($self, $stackPos) {\n                 throw new Error('__HALT_COMPILER() can only be used from the outermost scope', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            159 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Block($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            160 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\If_($self->semStack[$stackPos-(7-3)], ['stmts' => $self->semStack[$stackPos-(7-5)], 'elseifs' => $self->semStack[$stackPos-(7-6)], 'else' => $self->semStack[$stackPos-(7-7)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            },\n            161 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\If_($self->semStack[$stackPos-(10-3)], ['stmts' => $self->semStack[$stackPos-(10-6)], 'elseifs' => $self->semStack[$stackPos-(10-7)], 'else' => $self->semStack[$stackPos-(10-8)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos]));\n            },\n            162 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\While_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            163 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Do_($self->semStack[$stackPos-(7-5)], $self->semStack[$stackPos-(7-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            },\n            164 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\For_(['init' => $self->semStack[$stackPos-(9-3)], 'cond' => $self->semStack[$stackPos-(9-5)], 'loop' => $self->semStack[$stackPos-(9-7)], 'stmts' => $self->semStack[$stackPos-(9-9)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            165 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Switch_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            166 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Break_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            167 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Continue_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            168 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Return_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            169 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Global_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            170 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Static_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            171 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Echo_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            172 => static function ($self, $stackPos) {\n\n        $self->semValue = new Stmt\\InlineHTML($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n        $self->semValue->setAttribute('hasLeadingNewline', $self->inlineHtmlHasLeadingNewline($stackPos-(1-1)));\n\n            },\n            173 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Expression($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            174 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Unset_($self->semStack[$stackPos-(5-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            175 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Foreach_($self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-5)][0], ['keyVar' => null, 'byRef' => $self->semStack[$stackPos-(7-5)][1], 'stmts' => $self->semStack[$stackPos-(7-7)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            },\n            176 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Foreach_($self->semStack[$stackPos-(9-3)], $self->semStack[$stackPos-(9-7)][0], ['keyVar' => $self->semStack[$stackPos-(9-5)], 'byRef' => $self->semStack[$stackPos-(9-7)][1], 'stmts' => $self->semStack[$stackPos-(9-9)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            177 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Foreach_($self->semStack[$stackPos-(6-3)], new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(6-4)],  $self->tokenEndStack[$stackPos-(6-4)])), ['stmts' => $self->semStack[$stackPos-(6-6)]], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]));\n            },\n            178 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Declare_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            179 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TryCatch($self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-5)], $self->semStack[$stackPos-(6-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); $self->checkTryCatch($self->semValue);\n            },\n            180 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Goto_($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            181 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Label($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            182 => static function ($self, $stackPos) {\n                 $self->semValue = null; /* means: no statement */\n            },\n            183 => null,\n            184 => static function ($self, $stackPos) {\n                 $self->semValue = $self->maybeCreateNop($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]);\n            },\n            185 => static function ($self, $stackPos) {\n                 if ($self->semStack[$stackPos-(1-1)] instanceof Stmt\\Block) { $self->semValue = $self->semStack[$stackPos-(1-1)]->stmts; } else if ($self->semStack[$stackPos-(1-1)] === null) { $self->semValue = []; } else { $self->semValue = [$self->semStack[$stackPos-(1-1)]]; };\n            },\n            186 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            187 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            188 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            189 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            190 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Catch_($self->semStack[$stackPos-(8-3)], $self->semStack[$stackPos-(8-4)], $self->semStack[$stackPos-(8-7)], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            },\n            191 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            192 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Finally_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            193 => null,\n            194 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            195 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            196 => static function ($self, $stackPos) {\n                 $self->semValue = false;\n            },\n            197 => static function ($self, $stackPos) {\n                 $self->semValue = true;\n            },\n            198 => static function ($self, $stackPos) {\n                 $self->semValue = false;\n            },\n            199 => static function ($self, $stackPos) {\n                 $self->semValue = true;\n            },\n            200 => static function ($self, $stackPos) {\n                 $self->semValue = false;\n            },\n            201 => static function ($self, $stackPos) {\n                 $self->semValue = true;\n            },\n            202 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            203 => static function ($self, $stackPos) {\n                 $self->semValue = [];\n            },\n            204 => null,\n            205 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            206 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            207 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            208 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Function_($self->semStack[$stackPos-(8-3)], ['byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-5)], 'returnType' => $self->semStack[$stackPos-(8-7)], 'stmts' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            },\n            209 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Function_($self->semStack[$stackPos-(9-4)], ['byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-6)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            210 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Class_($self->semStack[$stackPos-(7-2)], ['type' => $self->semStack[$stackPos-(7-1)], 'extends' => $self->semStack[$stackPos-(7-3)], 'implements' => $self->semStack[$stackPos-(7-4)], 'stmts' => $self->semStack[$stackPos-(7-6)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkClass($self->semValue, $stackPos-(7-2));\n            },\n            211 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Class_($self->semStack[$stackPos-(8-3)], ['type' => $self->semStack[$stackPos-(8-2)], 'extends' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkClass($self->semValue, $stackPos-(8-3));\n            },\n            212 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Interface_($self->semStack[$stackPos-(7-3)], ['extends' => $self->semStack[$stackPos-(7-4)], 'stmts' => $self->semStack[$stackPos-(7-6)], 'attrGroups' => $self->semStack[$stackPos-(7-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkInterface($self->semValue, $stackPos-(7-3));\n            },\n            213 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Trait_($self->semStack[$stackPos-(6-3)], ['stmts' => $self->semStack[$stackPos-(6-5)], 'attrGroups' => $self->semStack[$stackPos-(6-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]));\n            },\n            214 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Enum_($self->semStack[$stackPos-(8-3)], ['scalarType' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkEnum($self->semValue, $stackPos-(8-3));\n            },\n            215 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            216 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            217 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            218 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            219 => static function ($self, $stackPos) {\n                 $self->semValue = 0;\n            },\n            220 => null,\n            221 => null,\n            222 => static function ($self, $stackPos) {\n                 $self->checkClassModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)];\n            },\n            223 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::ABSTRACT;\n            },\n            224 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::FINAL;\n            },\n            225 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::READONLY;\n            },\n            226 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            227 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            228 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            229 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            230 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            231 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            232 => null,\n            233 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            234 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            235 => null,\n            236 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            237 => null,\n            238 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            239 => static function ($self, $stackPos) {\n                 if ($self->semStack[$stackPos-(1-1)] instanceof Stmt\\Block) { $self->semValue = $self->semStack[$stackPos-(1-1)]->stmts; } else if ($self->semStack[$stackPos-(1-1)] === null) { $self->semValue = []; } else { $self->semValue = [$self->semStack[$stackPos-(1-1)]]; };\n            },\n            240 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            241 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            242 => null,\n            243 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            244 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            245 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\DeclareItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            246 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            247 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-3)];\n            },\n            248 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            249 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(5-3)];\n            },\n            250 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            251 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            252 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Case_($self->semStack[$stackPos-(4-2)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            253 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Case_(null, $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            254 => null,\n            255 => null,\n            256 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Match_($self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]));\n            },\n            257 => static function ($self, $stackPos) {\n                 $self->semValue = [];\n            },\n            258 => null,\n            259 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            260 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            261 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\MatchArm($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            262 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\MatchArm(null, $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            263 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            264 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            265 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            266 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            267 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\ElseIf_($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            268 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            269 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            270 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\ElseIf_($self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-6)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])); $self->fixupAlternativeElse($self->semValue);\n            },\n            271 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            272 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Else_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            273 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            274 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Else_($self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->fixupAlternativeElse($self->semValue);\n            },\n            275 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)], false);\n            },\n            276 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(2-2)], true);\n            },\n            277 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)], false);\n            },\n            278 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->fixupArrayDestructuring($self->semStack[$stackPos-(1-1)]), false);\n            },\n            279 => null,\n            280 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            281 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            282 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            283 => static function ($self, $stackPos) {\n                 $self->semValue = 0;\n            },\n            284 => static function ($self, $stackPos) {\n                 $self->checkModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)];\n            },\n            285 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PUBLIC;\n            },\n            286 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PROTECTED;\n            },\n            287 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PRIVATE;\n            },\n            288 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PUBLIC_SET;\n            },\n            289 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PROTECTED_SET;\n            },\n            290 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PRIVATE_SET;\n            },\n            291 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::READONLY;\n            },\n            292 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::FINAL;\n            },\n            293 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Param($self->semStack[$stackPos-(7-6)], null, $self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-4)], $self->semStack[$stackPos-(7-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-1)], $self->semStack[$stackPos-(7-7)]);\n            $self->checkParam($self->semValue);\n            $self->addPropertyNameToHooks($self->semValue);\n            },\n            294 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Param($self->semStack[$stackPos-(9-6)], $self->semStack[$stackPos-(9-8)], $self->semStack[$stackPos-(9-3)], $self->semStack[$stackPos-(9-4)], $self->semStack[$stackPos-(9-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(9-2)], $self->semStack[$stackPos-(9-1)], $self->semStack[$stackPos-(9-9)]);\n            $self->checkParam($self->semValue);\n            $self->addPropertyNameToHooks($self->semValue);\n            },\n            295 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Param(new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])), null, $self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-4)], $self->semStack[$stackPos-(6-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(6-2)], $self->semStack[$stackPos-(6-1)]);\n            },\n            296 => null,\n            297 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\NullableType($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            298 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UnionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            299 => null,\n            300 => null,\n            301 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Name('static', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            302 => static function ($self, $stackPos) {\n                 $self->semValue = $self->handleBuiltinTypes($self->semStack[$stackPos-(1-1)]);\n            },\n            303 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier('array', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            304 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Identifier('callable', $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            305 => null,\n            306 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            307 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]);\n            },\n            308 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            309 => null,\n            310 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            311 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]);\n            },\n            312 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            313 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]);\n            },\n            314 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            315 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\IntersectionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            316 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]);\n            },\n            317 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            318 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\IntersectionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            319 => null,\n            320 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\NullableType($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            321 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\UnionType($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            322 => null,\n            323 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            324 => null,\n            325 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            326 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(2-2)];\n            },\n            327 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            328 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            329 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            330 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-2)]);\n            },\n            331 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            332 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-2)];\n            },\n            333 => static function ($self, $stackPos) {\n                 $self->semValue = array(new Node\\Arg($self->semStack[$stackPos-(4-2)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])));\n            },\n            334 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-2)]);\n            },\n            335 => static function ($self, $stackPos) {\n                 $self->semValue = array(new Node\\Arg($self->semStack[$stackPos-(3-1)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)],  $self->tokenEndStack[$stackPos-(3-1)])), $self->semStack[$stackPos-(3-3)]);\n            },\n            336 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            337 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            338 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\VariadicPlaceholder($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            339 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            340 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            341 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Arg($self->semStack[$stackPos-(2-2)], true, false, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            342 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Arg($self->semStack[$stackPos-(2-2)], false, true, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            343 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Arg($self->semStack[$stackPos-(3-3)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(3-1)]);\n            },\n            344 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\Arg($self->semStack[$stackPos-(1-1)], false, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            345 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            346 => null,\n            347 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            348 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            349 => null,\n            350 => null,\n            351 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            352 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            353 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\StaticVar($self->semStack[$stackPos-(1-1)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            354 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\StaticVar($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            355 => static function ($self, $stackPos) {\n                 if ($self->semStack[$stackPos-(2-2)] !== null) { $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)]; } else { $self->semValue = $self->semStack[$stackPos-(2-1)]; }\n            },\n            356 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            357 => static function ($self, $stackPos) {\n                 $nop = $self->maybeCreateZeroLengthNop($self->tokenPos);;\n            if ($nop !== null) { $self->semStack[$stackPos-(1-1)][] = $nop; } $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            358 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Property($self->semStack[$stackPos-(5-2)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-1)]);\n            },\n            359 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\Property($self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-1)], $self->semStack[$stackPos-(7-6)]);\n            $self->checkPropertyHooksForMultiProperty($self->semValue, $stackPos-(7-5));\n            $self->checkEmptyPropertyHookList($self->semStack[$stackPos-(7-6)], $stackPos-(7-5));\n            $self->addPropertyNameToHooks($self->semValue);\n            },\n            360 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\ClassConst($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(5-1)]);\n            $self->checkClassConst($self->semValue, $stackPos-(5-2));\n            },\n            361 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\ClassConst($self->semStack[$stackPos-(6-5)], $self->semStack[$stackPos-(6-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(6-1)], $self->semStack[$stackPos-(6-4)]);\n            $self->checkClassConst($self->semValue, $stackPos-(6-2));\n            },\n            362 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\ClassMethod($self->semStack[$stackPos-(10-5)], ['type' => $self->semStack[$stackPos-(10-2)], 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-7)], 'returnType' => $self->semStack[$stackPos-(10-9)], 'stmts' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkClassMethod($self->semValue, $stackPos-(10-2));\n            },\n            363 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUse($self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            364 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\EnumCase($self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            365 => static function ($self, $stackPos) {\n                 $self->semValue = null; /* will be skipped */\n            },\n            366 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            367 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            368 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            369 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            370 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUseAdaptation\\Precedence($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            371 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUseAdaptation\\Alias($self->semStack[$stackPos-(5-1)][0], $self->semStack[$stackPos-(5-1)][1], $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            372 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUseAdaptation\\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], $self->semStack[$stackPos-(4-3)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            373 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUseAdaptation\\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            374 => static function ($self, $stackPos) {\n                 $self->semValue = new Stmt\\TraitUseAdaptation\\Alias($self->semStack[$stackPos-(4-1)][0], $self->semStack[$stackPos-(4-1)][1], null, $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            375 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)]);\n            },\n            376 => null,\n            377 => static function ($self, $stackPos) {\n                 $self->semValue = array(null, $self->semStack[$stackPos-(1-1)]);\n            },\n            378 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            379 => null,\n            380 => null,\n            381 => static function ($self, $stackPos) {\n                 $self->semValue = 0;\n            },\n            382 => static function ($self, $stackPos) {\n                 $self->semValue = 0;\n            },\n            383 => null,\n            384 => null,\n            385 => static function ($self, $stackPos) {\n                 $self->checkModifier($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)];\n            },\n            386 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PUBLIC;\n            },\n            387 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PROTECTED;\n            },\n            388 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PRIVATE;\n            },\n            389 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PUBLIC_SET;\n            },\n            390 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PROTECTED_SET;\n            },\n            391 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::PRIVATE_SET;\n            },\n            392 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::STATIC;\n            },\n            393 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::ABSTRACT;\n            },\n            394 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::FINAL;\n            },\n            395 => static function ($self, $stackPos) {\n                 $self->semValue = Modifiers::READONLY;\n            },\n            396 => null,\n            397 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            398 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            399 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\VarLikeIdentifier(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            400 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\PropertyItem($self->semStack[$stackPos-(1-1)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            401 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\PropertyItem($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            402 => static function ($self, $stackPos) {\n                 $self->semValue = [];\n            },\n            403 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            404 => static function ($self, $stackPos) {\n                 $self->semValue = [];\n            },\n            405 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)]; $self->checkEmptyPropertyHookList($self->semStack[$stackPos-(3-2)], $stackPos-(3-1));\n            },\n            406 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\PropertyHook($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-5)], ['flags' => $self->semStack[$stackPos-(5-2)], 'byRef' => $self->semStack[$stackPos-(5-3)], 'params' => [], 'attrGroups' => $self->semStack[$stackPos-(5-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkPropertyHook($self->semValue, null);\n            },\n            407 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\PropertyHook($self->semStack[$stackPos-(8-4)], $self->semStack[$stackPos-(8-8)], ['flags' => $self->semStack[$stackPos-(8-2)], 'byRef' => $self->semStack[$stackPos-(8-3)], 'params' => $self->semStack[$stackPos-(8-6)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            $self->checkPropertyHook($self->semValue, $stackPos-(8-5));\n            },\n            408 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            409 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            410 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            411 => static function ($self, $stackPos) {\n                 $self->semValue = 0;\n            },\n            412 => static function ($self, $stackPos) {\n                 $self->checkPropertyHookModifiers($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $stackPos-(2-2)); $self->semValue = $self->semStack[$stackPos-(2-1)] | $self->semStack[$stackPos-(2-2)];\n            },\n            413 => null,\n            414 => null,\n            415 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            416 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            417 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            418 => null,\n            419 => null,\n            420 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Assign($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            421 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Assign($self->fixupArrayDestructuring($self->semStack[$stackPos-(3-1)]), $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            422 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Assign($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            423 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignRef($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            424 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignRef($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            if (!$self->phpVersion->allowsAssignNewByReference()) {\n                $self->emitError(new Error('Cannot assign new by reference', $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])));\n            }\n\n            },\n            425 => null,\n            426 => null,\n            427 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\FuncCall(new Node\\Name($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)],  $self->tokenEndStack[$stackPos-(2-1)])), $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            428 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Clone_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            429 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Plus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            430 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Minus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            431 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Mul($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            432 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Div($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            433 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Concat($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            434 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Mod($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            435 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            436 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\BitwiseOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            437 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\BitwiseXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            438 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\ShiftLeft($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            439 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\ShiftRight($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            440 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Pow($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            441 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\AssignOp\\Coalesce($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            442 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PostInc($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            443 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PreInc($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            444 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PostDec($self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            445 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PreDec($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            446 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BooleanOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            447 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BooleanAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            448 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\LogicalOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            449 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\LogicalAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            450 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\LogicalXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            451 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BitwiseOr($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            452 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            453 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BitwiseAnd($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            454 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\BitwiseXor($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            455 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Concat($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            456 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Plus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            457 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Minus($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            458 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Mul($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            459 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Div($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            460 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Mod($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            461 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\ShiftLeft($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            462 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\ShiftRight($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            463 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Pow($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            464 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\UnaryPlus($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            465 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\UnaryMinus($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            466 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BooleanNot($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            467 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BitwiseNot($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            468 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Identical($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            469 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\NotIdentical($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            470 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Equal($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            471 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\NotEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            472 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Spaceship($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            473 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Smaller($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            474 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\SmallerOrEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            475 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Greater($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            476 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\GreaterOrEqual($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            477 => static function ($self, $stackPos) {\n\n          $self->semValue = new Expr\\BinaryOp\\Pipe($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n          $self->checkPipeOperatorParentheses($self->semStack[$stackPos-(3-3)]);\n\n            },\n            478 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Instanceof_($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            479 => static function ($self, $stackPos) {\n\n          $self->semValue = $self->semStack[$stackPos-(3-2)];\n          if ($self->semValue instanceof Expr\\ArrowFunction) {\n              $self->parenthesizedArrowFunctions->offsetSet($self->semValue);\n          }\n\n            },\n            480 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Ternary($self->semStack[$stackPos-(5-1)], $self->semStack[$stackPos-(5-3)], $self->semStack[$stackPos-(5-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            481 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Ternary($self->semStack[$stackPos-(4-1)], null, $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            482 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\BinaryOp\\Coalesce($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            483 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Isset_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            484 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Empty_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            485 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Include_($self->semStack[$stackPos-(2-2)], Expr\\Include_::TYPE_INCLUDE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            486 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Include_($self->semStack[$stackPos-(2-2)], Expr\\Include_::TYPE_INCLUDE_ONCE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            487 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Eval_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            488 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Include_($self->semStack[$stackPos-(2-2)], Expr\\Include_::TYPE_REQUIRE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            489 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Include_($self->semStack[$stackPos-(2-2)], Expr\\Include_::TYPE_REQUIRE_ONCE, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            490 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]);\n            $attrs['kind'] = $self->getIntCastKind($self->semStack[$stackPos-(2-1)]);\n            $self->semValue = new Expr\\Cast\\Int_($self->semStack[$stackPos-(2-2)], $attrs);\n            },\n            491 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]);\n            $attrs['kind'] = $self->getFloatCastKind($self->semStack[$stackPos-(2-1)]);\n            $self->semValue = new Expr\\Cast\\Double($self->semStack[$stackPos-(2-2)], $attrs);\n            },\n            492 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]);\n            $attrs['kind'] = $self->getStringCastKind($self->semStack[$stackPos-(2-1)]);\n            $self->semValue = new Expr\\Cast\\String_($self->semStack[$stackPos-(2-2)], $attrs);\n            },\n            493 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Cast\\Array_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            494 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Cast\\Object_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            495 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]);\n            $attrs['kind'] = $self->getBoolCastKind($self->semStack[$stackPos-(2-1)]);\n            $self->semValue = new Expr\\Cast\\Bool_($self->semStack[$stackPos-(2-2)], $attrs);\n            },\n            496 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Cast\\Unset_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            497 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Cast\\Void_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            498 => static function ($self, $stackPos) {\n                 $self->semValue = $self->createExitExpr($self->semStack[$stackPos-(2-1)], $stackPos-(2-1), $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            499 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ErrorSuppress($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            500 => null,\n            501 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ShellExec($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            502 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Print_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            503 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Yield_(null, null, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            504 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Yield_($self->semStack[$stackPos-(2-2)], null, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            505 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Yield_($self->semStack[$stackPos-(4-4)], $self->semStack[$stackPos-(4-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            506 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\YieldFrom($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            507 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Throw_($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            508 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrowFunction(['static' => false, 'byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-4)], 'returnType' => $self->semStack[$stackPos-(8-6)], 'expr' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            },\n            509 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrowFunction(['static' => true, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'returnType' => $self->semStack[$stackPos-(9-7)], 'expr' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            510 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Closure(['static' => false, 'byRef' => $self->semStack[$stackPos-(8-2)], 'params' => $self->semStack[$stackPos-(8-4)], 'uses' => $self->semStack[$stackPos-(8-6)], 'returnType' => $self->semStack[$stackPos-(8-7)], 'stmts' => $self->semStack[$stackPos-(8-8)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos]));\n            },\n            511 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Closure(['static' => true, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'uses' => $self->semStack[$stackPos-(9-7)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => []], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            512 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrowFunction(['static' => false, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'returnType' => $self->semStack[$stackPos-(9-7)], 'expr' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            513 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrowFunction(['static' => true, 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-6)], 'returnType' => $self->semStack[$stackPos-(10-8)], 'expr' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos]));\n            },\n            514 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Closure(['static' => false, 'byRef' => $self->semStack[$stackPos-(9-3)], 'params' => $self->semStack[$stackPos-(9-5)], 'uses' => $self->semStack[$stackPos-(9-7)], 'returnType' => $self->semStack[$stackPos-(9-8)], 'stmts' => $self->semStack[$stackPos-(9-9)], 'attrGroups' => $self->semStack[$stackPos-(9-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]));\n            },\n            515 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Closure(['static' => true, 'byRef' => $self->semStack[$stackPos-(10-4)], 'params' => $self->semStack[$stackPos-(10-6)], 'uses' => $self->semStack[$stackPos-(10-8)], 'returnType' => $self->semStack[$stackPos-(10-9)], 'stmts' => $self->semStack[$stackPos-(10-10)], 'attrGroups' => $self->semStack[$stackPos-(10-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(10-1)], $self->tokenEndStack[$stackPos]));\n            },\n            516 => static function ($self, $stackPos) {\n                 $self->semValue = array(new Stmt\\Class_(null, ['type' => $self->semStack[$stackPos-(8-2)], 'extends' => $self->semStack[$stackPos-(8-4)], 'implements' => $self->semStack[$stackPos-(8-5)], 'stmts' => $self->semStack[$stackPos-(8-7)], 'attrGroups' => $self->semStack[$stackPos-(8-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(8-1)], $self->tokenEndStack[$stackPos])), $self->semStack[$stackPos-(8-3)]);\n            $self->checkClass($self->semValue[0], -1);\n            },\n            517 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\New_($self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            518 => static function ($self, $stackPos) {\n                 list($class, $ctorArgs) = $self->semStack[$stackPos-(2-2)]; $self->semValue = new Expr\\New_($class, $ctorArgs, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            519 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\New_($self->semStack[$stackPos-(2-2)], [], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            520 => null,\n            521 => null,\n            522 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            523 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(4-3)];\n            },\n            524 => null,\n            525 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            526 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            527 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ClosureUse($self->semStack[$stackPos-(2-2)], $self->semStack[$stackPos-(2-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            528 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            529 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            530 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            531 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\FuncCall($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            532 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\StaticCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            533 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            534 => null,\n            535 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            536 => static function ($self, $stackPos) {\n                 $self->semValue = new Name($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            537 => static function ($self, $stackPos) {\n                 $self->semValue = new Name\\FullyQualified(substr($self->semStack[$stackPos-(1-1)], 1), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            538 => static function ($self, $stackPos) {\n                 $self->semValue = new Name\\Relative(substr($self->semStack[$stackPos-(1-1)], 10), $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            539 => null,\n            540 => null,\n            541 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            542 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2;\n            },\n            543 => null,\n            544 => null,\n            545 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            546 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]); foreach ($self->semValue as $s) { if ($s instanceof Node\\InterpolatedStringPart) { $s->value = Node\\Scalar\\String_::parseEscapeSequences($s->value, '`', $self->phpVersion->supportsUnicodeEscapes()); } };\n            },\n            547 => static function ($self, $stackPos) {\n                 foreach ($self->semStack[$stackPos-(1-1)] as $s) { if ($s instanceof Node\\InterpolatedStringPart) { $s->value = Node\\Scalar\\String_::parseEscapeSequences($s->value, '`', $self->phpVersion->supportsUnicodeEscapes()); } }; $self->semValue = $self->semStack[$stackPos-(1-1)];\n            },\n            548 => static function ($self, $stackPos) {\n                 $self->semValue = array();\n            },\n            549 => null,\n            550 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ConstFetch($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            551 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Line($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            552 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\File($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            553 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Dir($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            554 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Class_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            555 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Trait_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            556 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Method($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            557 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Function_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            558 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Namespace_($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            559 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\MagicConst\\Property($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            560 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ClassConstFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            561 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ClassConstFetch($self->semStack[$stackPos-(5-1)], $self->semStack[$stackPos-(5-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]));\n            },\n            562 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ClassConstFetch($self->semStack[$stackPos-(3-1)], new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(3-3)],  $self->tokenEndStack[$stackPos-(3-3)])), $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2;\n            },\n            563 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\\Array_::KIND_SHORT;\n            $self->semValue = new Expr\\Array_($self->semStack[$stackPos-(3-2)], $attrs);\n            },\n            564 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Expr\\Array_::KIND_LONG;\n            $self->semValue = new Expr\\Array_($self->semStack[$stackPos-(4-3)], $attrs);\n            $self->createdArrays->offsetSet($self->semValue);\n            },\n            565 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)]; $self->createdArrays->offsetSet($self->semValue);\n            },\n            566 => static function ($self, $stackPos) {\n                 $self->semValue = Scalar\\String_::fromString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]), $self->phpVersion->supportsUnicodeEscapes());\n            },\n            567 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]); $attrs['kind'] = Scalar\\String_::KIND_DOUBLE_QUOTED;\n            foreach ($self->semStack[$stackPos-(3-2)] as $s) { if ($s instanceof Node\\InterpolatedStringPart) { $s->value = Node\\Scalar\\String_::parseEscapeSequences($s->value, '\"', $self->phpVersion->supportsUnicodeEscapes()); } }; $self->semValue = new Scalar\\InterpolatedString($self->semStack[$stackPos-(3-2)], $attrs);\n            },\n            568 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseLNumber($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]), $self->phpVersion->allowsInvalidOctals());\n            },\n            569 => static function ($self, $stackPos) {\n                 $self->semValue = Scalar\\Float_::fromString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            570 => null,\n            571 => null,\n            572 => null,\n            573 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseDocString($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(3-3)],  $self->tokenEndStack[$stackPos-(3-3)]), true);\n            },\n            574 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseDocString($self->semStack[$stackPos-(2-1)], '', $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(2-2)],  $self->tokenEndStack[$stackPos-(2-2)]), true);\n            },\n            575 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseDocString($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-2)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]), $self->getAttributes($self->tokenStartStack[$stackPos-(3-3)],  $self->tokenEndStack[$stackPos-(3-3)]), true);\n            },\n            576 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            577 => null,\n            578 => null,\n            579 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            580 => null,\n            581 => null,\n            582 => null,\n            583 => null,\n            584 => null,\n            585 => null,\n            586 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            587 => null,\n            588 => null,\n            589 => null,\n            590 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            591 => null,\n            592 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\MethodCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            593 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\NullsafeMethodCall($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->semStack[$stackPos-(4-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            594 => static function ($self, $stackPos) {\n                 $self->semValue = null;\n            },\n            595 => null,\n            596 => null,\n            597 => null,\n            598 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            599 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            600 => null,\n            601 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            602 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable($self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            603 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable(new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])), $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2;\n            },\n            604 => static function ($self, $stackPos) {\n                 $var = $self->semStack[$stackPos-(1-1)]->name; $self->semValue = \\is_string($var) ? new Node\\VarLikeIdentifier($var, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])) : $var;\n            },\n            605 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            606 => null,\n            607 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            608 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            609 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            610 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            611 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\StaticPropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            612 => null,\n            613 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            614 => null,\n            615 => null,\n            616 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            617 => null,\n            618 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Error($self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos])); $self->errorState = 2;\n            },\n            619 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\List_($self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos])); $self->semValue->setAttribute('kind', Expr\\List_::KIND_LIST);\n            $self->postprocessList($self->semValue);\n            },\n            620 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(1-1)]; $end = count($self->semValue)-1; if ($self->semValue[$end]->value instanceof Expr\\Error) array_pop($self->semValue);\n            },\n            621 => null,\n            622 => static function ($self, $stackPos) {\n                 /* do nothing -- prevent default action of $$=$self->semStack[$1]. See $551. */\n            },\n            623 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(3-1)][] = $self->semStack[$stackPos-(3-3)]; $self->semValue = $self->semStack[$stackPos-(3-1)];\n            },\n            624 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            625 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(1-1)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            626 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(2-2)], null, true, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            627 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(1-1)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            628 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(3-3)], $self->semStack[$stackPos-(3-1)], false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            629 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(4-4)], $self->semStack[$stackPos-(4-1)], true, $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            630 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(3-3)], $self->semStack[$stackPos-(3-1)], false, $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            631 => static function ($self, $stackPos) {\n                 $self->semValue = new Node\\ArrayItem($self->semStack[$stackPos-(2-2)], null, false, $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]), true);\n            },\n            632 => static function ($self, $stackPos) {\n                 /* Create an Error node now to remember the position. We'll later either report an error,\n             or convert this into a null element, depending on whether this is a creation or destructuring context. */\n          $attrs = $self->createEmptyElemAttributes($self->tokenPos);\n          $self->semValue = new Node\\ArrayItem(new Expr\\Error($attrs), null, false, $attrs);\n            },\n            633 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            634 => static function ($self, $stackPos) {\n                 $self->semStack[$stackPos-(2-1)][] = $self->semStack[$stackPos-(2-2)]; $self->semValue = $self->semStack[$stackPos-(2-1)];\n            },\n            635 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(1-1)]);\n            },\n            636 => static function ($self, $stackPos) {\n                 $self->semValue = array($self->semStack[$stackPos-(2-1)], $self->semStack[$stackPos-(2-2)]);\n            },\n            637 => static function ($self, $stackPos) {\n                 $attrs = $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]); $attrs['rawValue'] = $self->semStack[$stackPos-(1-1)]; $self->semValue = new Node\\InterpolatedStringPart($self->semStack[$stackPos-(1-1)], $attrs);\n            },\n            638 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            639 => null,\n            640 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrayDimFetch($self->semStack[$stackPos-(4-1)], $self->semStack[$stackPos-(4-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(4-1)], $self->tokenEndStack[$stackPos]));\n            },\n            641 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\PropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            642 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\NullsafePropertyFetch($self->semStack[$stackPos-(3-1)], $self->semStack[$stackPos-(3-3)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            643 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            644 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\Variable($self->semStack[$stackPos-(3-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(3-1)], $self->tokenEndStack[$stackPos]));\n            },\n            645 => static function ($self, $stackPos) {\n                 $self->semValue = new Expr\\ArrayDimFetch($self->semStack[$stackPos-(6-2)], $self->semStack[$stackPos-(6-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]));\n            },\n            646 => static function ($self, $stackPos) {\n                 $self->semValue = $self->semStack[$stackPos-(3-2)];\n            },\n            647 => static function ($self, $stackPos) {\n                 $self->semValue = new Scalar\\String_($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            648 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseNumString($self->semStack[$stackPos-(1-1)], $self->getAttributes($self->tokenStartStack[$stackPos-(1-1)], $self->tokenEndStack[$stackPos]));\n            },\n            649 => static function ($self, $stackPos) {\n                 $self->semValue = $self->parseNumString('-' . $self->semStack[$stackPos-(2-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(2-1)], $self->tokenEndStack[$stackPos]));\n            },\n            650 => null,\n        ];\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Parser.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\ninterface Parser {\n    /**\n     * Parses PHP code into a node tree.\n     *\n     * @param string $code The source code to parse\n     * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults\n     *                                        to ErrorHandler\\Throwing.\n     *\n     * @return Node\\Stmt[]|null Array of statements (or null non-throwing error handler is used and\n     *                          the parser was unable to recover from an error).\n     */\n    public function parse(string $code, ?ErrorHandler $errorHandler = null): ?array;\n\n    /**\n     * Return tokens for the last parse.\n     *\n     * @return Token[]\n     */\n    public function getTokens(): array;\n}\n"
  },
  {
    "path": "lib/PhpParser/ParserAbstract.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\n/*\n * This parser is based on a skeleton written by Moriyoshi Koizumi, which in\n * turn is based on work by Masato Bito.\n */\n\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Expr\\Array_;\nuse PhpParser\\Node\\Expr\\Cast\\Double;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\InterpolatedStringPart;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Param;\nuse PhpParser\\Node\\PropertyHook;\nuse PhpParser\\Node\\Scalar\\InterpolatedString;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Scalar\\String_;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\Node\\Stmt\\Class_;\nuse PhpParser\\Node\\Stmt\\ClassConst;\nuse PhpParser\\Node\\Stmt\\ClassMethod;\nuse PhpParser\\Node\\Stmt\\Const_;\nuse PhpParser\\Node\\Stmt\\Else_;\nuse PhpParser\\Node\\Stmt\\ElseIf_;\nuse PhpParser\\Node\\Stmt\\Enum_;\nuse PhpParser\\Node\\Stmt\\Interface_;\nuse PhpParser\\Node\\Stmt\\Namespace_;\nuse PhpParser\\Node\\Stmt\\Nop;\nuse PhpParser\\Node\\Stmt\\Property;\nuse PhpParser\\Node\\Stmt\\TryCatch;\nuse PhpParser\\Node\\UseItem;\nuse PhpParser\\Node\\VarLikeIdentifier;\nuse PhpParser\\NodeVisitor\\CommentAnnotatingVisitor;\n\nabstract class ParserAbstract implements Parser {\n    private const SYMBOL_NONE = -1;\n\n    /** @var Lexer Lexer that is used when parsing */\n    protected Lexer $lexer;\n    /** @var PhpVersion PHP version to target on a best-effort basis */\n    protected PhpVersion $phpVersion;\n\n    /*\n     * The following members will be filled with generated parsing data:\n     */\n\n    /** @var int Size of $tokenToSymbol map */\n    protected int $tokenToSymbolMapSize;\n    /** @var int Size of $action table */\n    protected int $actionTableSize;\n    /** @var int Size of $goto table */\n    protected int $gotoTableSize;\n\n    /** @var int Symbol number signifying an invalid token */\n    protected int $invalidSymbol;\n    /** @var int Symbol number of error recovery token */\n    protected int $errorSymbol;\n    /** @var int Action number signifying default action */\n    protected int $defaultAction;\n    /** @var int Rule number signifying that an unexpected token was encountered */\n    protected int $unexpectedTokenRule;\n\n    protected int $YY2TBLSTATE;\n    /** @var int Number of non-leaf states */\n    protected int $numNonLeafStates;\n\n    /** @var int[] Map of PHP token IDs to internal symbols */\n    protected array $phpTokenToSymbol;\n    /** @var array<int, bool> Map of PHP token IDs to drop */\n    protected array $dropTokens;\n    /** @var int[] Map of external symbols (static::T_*) to internal symbols */\n    protected array $tokenToSymbol;\n    /** @var string[] Map of symbols to their names */\n    protected array $symbolToName;\n    /** @var array<int, string> Names of the production rules (only necessary for debugging) */\n    protected array $productions;\n\n    /** @var int[] Map of states to a displacement into the $action table. The corresponding action for this\n     *             state/symbol pair is $action[$actionBase[$state] + $symbol]. If $actionBase[$state] is 0, the\n     *             action is defaulted, i.e. $actionDefault[$state] should be used instead. */\n    protected array $actionBase;\n    /** @var int[] Table of actions. Indexed according to $actionBase comment. */\n    protected array $action;\n    /** @var int[] Table indexed analogously to $action. If $actionCheck[$actionBase[$state] + $symbol] != $symbol\n     *             then the action is defaulted, i.e. $actionDefault[$state] should be used instead. */\n    protected array $actionCheck;\n    /** @var int[] Map of states to their default action */\n    protected array $actionDefault;\n    /** @var callable[] Semantic action callbacks */\n    protected array $reduceCallbacks;\n\n    /** @var int[] Map of non-terminals to a displacement into the $goto table. The corresponding goto state for this\n     *             non-terminal/state pair is $goto[$gotoBase[$nonTerminal] + $state] (unless defaulted) */\n    protected array $gotoBase;\n    /** @var int[] Table of states to goto after reduction. Indexed according to $gotoBase comment. */\n    protected array $goto;\n    /** @var int[] Table indexed analogously to $goto. If $gotoCheck[$gotoBase[$nonTerminal] + $state] != $nonTerminal\n     *             then the goto state is defaulted, i.e. $gotoDefault[$nonTerminal] should be used. */\n    protected array $gotoCheck;\n    /** @var int[] Map of non-terminals to the default state to goto after their reduction */\n    protected array $gotoDefault;\n\n    /** @var int[] Map of rules to the non-terminal on their left-hand side, i.e. the non-terminal to use for\n     *             determining the state to goto after reduction. */\n    protected array $ruleToNonTerminal;\n    /** @var int[] Map of rules to the length of their right-hand side, which is the number of elements that have to\n     *             be popped from the stack(s) on reduction. */\n    protected array $ruleToLength;\n\n    /*\n     * The following members are part of the parser state:\n     */\n\n    /** @var mixed Temporary value containing the result of last semantic action (reduction) */\n    protected $semValue;\n    /** @var mixed[] Semantic value stack (contains values of tokens and semantic action results) */\n    protected array $semStack;\n    /** @var int[] Token start position stack */\n    protected array $tokenStartStack;\n    /** @var int[] Token end position stack */\n    protected array $tokenEndStack;\n\n    /** @var ErrorHandler Error handler */\n    protected ErrorHandler $errorHandler;\n    /** @var int Error state, used to avoid error floods */\n    protected int $errorState;\n\n    /** @var \\SplObjectStorage<Array_, null>|null Array nodes created during parsing, for postprocessing of empty elements. */\n    protected ?\\SplObjectStorage $createdArrays;\n\n    /** @var \\SplObjectStorage<Expr\\ArrowFunction, null>|null\n     *       Arrow functions that are wrapped in parentheses, to enforce the pipe operator parentheses requirements.\n     */\n    protected ?\\SplObjectStorage $parenthesizedArrowFunctions;\n\n    /** @var Token[] Tokens for the current parse */\n    protected array $tokens;\n    /** @var int Current position in token array */\n    protected int $tokenPos;\n\n    /**\n     * Initialize $reduceCallbacks map.\n     */\n    abstract protected function initReduceCallbacks(): void;\n\n    /**\n     * Creates a parser instance.\n     *\n     * Options:\n     *  * phpVersion: ?PhpVersion,\n     *\n     * @param Lexer $lexer A lexer\n     * @param PhpVersion $phpVersion PHP version to target, defaults to latest supported. This\n     *                               option is best-effort: Even if specified, parsing will generally assume the latest\n     *                               supported version and only adjust behavior in minor ways, for example by omitting\n     *                               errors in older versions and interpreting type hints as a name or identifier depending\n     *                               on version.\n     */\n    public function __construct(Lexer $lexer, ?PhpVersion $phpVersion = null) {\n        $this->lexer = $lexer;\n        $this->phpVersion = $phpVersion ?? PhpVersion::getNewestSupported();\n\n        $this->initReduceCallbacks();\n        $this->phpTokenToSymbol = $this->createTokenMap();\n        $this->dropTokens = array_fill_keys(\n            [\\T_WHITESPACE, \\T_OPEN_TAG, \\T_COMMENT, \\T_DOC_COMMENT, \\T_BAD_CHARACTER], true\n        );\n    }\n\n    /**\n     * Parses PHP code into a node tree.\n     *\n     * If a non-throwing error handler is used, the parser will continue parsing after an error\n     * occurred and attempt to build a partial AST.\n     *\n     * @param string $code The source code to parse\n     * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults\n     *                                        to ErrorHandler\\Throwing.\n     *\n     * @return Node\\Stmt[]|null Array of statements (or null non-throwing error handler is used and\n     *                          the parser was unable to recover from an error).\n     */\n    public function parse(string $code, ?ErrorHandler $errorHandler = null): ?array {\n        $this->errorHandler = $errorHandler ?: new ErrorHandler\\Throwing();\n        $this->createdArrays = new \\SplObjectStorage();\n        $this->parenthesizedArrowFunctions = new \\SplObjectStorage();\n\n        $this->tokens = $this->lexer->tokenize($code, $this->errorHandler);\n        $result = $this->doParse();\n\n        // Report errors for any empty elements used inside arrays. This is delayed until after the main parse,\n        // because we don't know a priori whether a given array expression will be used in a destructuring context\n        // or not.\n        foreach ($this->createdArrays as $node) {\n            foreach ($node->items as $item) {\n                if ($item->value instanceof Expr\\Error) {\n                    $this->errorHandler->handleError(\n                        new Error('Cannot use empty array elements in arrays', $item->getAttributes()));\n                }\n            }\n        }\n\n        // Clear out some of the interior state, so we don't hold onto unnecessary\n        // memory between uses of the parser\n        $this->tokenStartStack = [];\n        $this->tokenEndStack = [];\n        $this->semStack = [];\n        $this->semValue = null;\n        $this->createdArrays = null;\n        $this->parenthesizedArrowFunctions = null;\n\n        if ($result !== null) {\n            $traverser = new NodeTraverser(new CommentAnnotatingVisitor($this->tokens));\n            $traverser->traverse($result);\n        }\n\n        return $result;\n    }\n\n    public function getTokens(): array {\n        return $this->tokens;\n    }\n\n    /** @return Stmt[]|null */\n    protected function doParse(): ?array {\n        // We start off with no lookahead-token\n        $symbol = self::SYMBOL_NONE;\n        $tokenValue = null;\n        $this->tokenPos = -1;\n\n        // Keep stack of start and end attributes\n        $this->tokenStartStack = [];\n        $this->tokenEndStack = [0];\n\n        // Start off in the initial state and keep a stack of previous states\n        $state = 0;\n        $stateStack = [$state];\n\n        // Semantic value stack (contains values of tokens and semantic action results)\n        $this->semStack = [];\n\n        // Current position in the stack(s)\n        $stackPos = 0;\n\n        $this->errorState = 0;\n\n        for (;;) {\n            //$this->traceNewState($state, $symbol);\n\n            if ($this->actionBase[$state] === 0) {\n                $rule = $this->actionDefault[$state];\n            } else {\n                if ($symbol === self::SYMBOL_NONE) {\n                    do {\n                        $token = $this->tokens[++$this->tokenPos];\n                        $tokenId = $token->id;\n                    } while (isset($this->dropTokens[$tokenId]));\n\n                    // Map the lexer token id to the internally used symbols.\n                    $tokenValue = $token->text;\n                    if (!isset($this->phpTokenToSymbol[$tokenId])) {\n                        throw new \\RangeException(sprintf(\n                            'The lexer returned an invalid token (id=%d, value=%s)',\n                            $tokenId, $tokenValue\n                        ));\n                    }\n                    $symbol = $this->phpTokenToSymbol[$tokenId];\n\n                    //$this->traceRead($symbol);\n                }\n\n                $idx = $this->actionBase[$state] + $symbol;\n                if ((($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol)\n                     || ($state < $this->YY2TBLSTATE\n                         && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0\n                         && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol))\n                    && ($action = $this->action[$idx]) !== $this->defaultAction) {\n                    /*\n                     * >= numNonLeafStates: shift and reduce\n                     * > 0: shift\n                     * = 0: accept\n                     * < 0: reduce\n                     * = -YYUNEXPECTED: error\n                     */\n                    if ($action > 0) {\n                        /* shift */\n                        //$this->traceShift($symbol);\n\n                        ++$stackPos;\n                        $stateStack[$stackPos] = $state = $action;\n                        $this->semStack[$stackPos] = $tokenValue;\n                        $this->tokenStartStack[$stackPos] = $this->tokenPos;\n                        $this->tokenEndStack[$stackPos] = $this->tokenPos;\n                        $symbol = self::SYMBOL_NONE;\n\n                        if ($this->errorState) {\n                            --$this->errorState;\n                        }\n\n                        if ($action < $this->numNonLeafStates) {\n                            continue;\n                        }\n\n                        /* $yyn >= numNonLeafStates means shift-and-reduce */\n                        $rule = $action - $this->numNonLeafStates;\n                    } else {\n                        $rule = -$action;\n                    }\n                } else {\n                    $rule = $this->actionDefault[$state];\n                }\n            }\n\n            for (;;) {\n                if ($rule === 0) {\n                    /* accept */\n                    //$this->traceAccept();\n                    return $this->semValue;\n                }\n                if ($rule !== $this->unexpectedTokenRule) {\n                    /* reduce */\n                    //$this->traceReduce($rule);\n\n                    $ruleLength = $this->ruleToLength[$rule];\n                    try {\n                        $callback = $this->reduceCallbacks[$rule];\n                        if ($callback !== null) {\n                            $callback($this, $stackPos);\n                        } elseif ($ruleLength > 0) {\n                            $this->semValue = $this->semStack[$stackPos - $ruleLength + 1];\n                        }\n                    } catch (Error $e) {\n                        if (-1 === $e->getStartLine()) {\n                            $e->setStartLine($this->tokens[$this->tokenPos]->line);\n                        }\n\n                        $this->emitError($e);\n                        // Can't recover from this type of error\n                        return null;\n                    }\n\n                    /* Goto - shift nonterminal */\n                    $lastTokenEnd = $this->tokenEndStack[$stackPos];\n                    $stackPos -= $ruleLength;\n                    $nonTerminal = $this->ruleToNonTerminal[$rule];\n                    $idx = $this->gotoBase[$nonTerminal] + $stateStack[$stackPos];\n                    if ($idx >= 0 && $idx < $this->gotoTableSize && $this->gotoCheck[$idx] === $nonTerminal) {\n                        $state = $this->goto[$idx];\n                    } else {\n                        $state = $this->gotoDefault[$nonTerminal];\n                    }\n\n                    ++$stackPos;\n                    $stateStack[$stackPos]     = $state;\n                    $this->semStack[$stackPos] = $this->semValue;\n                    $this->tokenEndStack[$stackPos] = $lastTokenEnd;\n                    if ($ruleLength === 0) {\n                        // Empty productions use the start attributes of the lookahead token.\n                        $this->tokenStartStack[$stackPos] = $this->tokenPos;\n                    }\n                } else {\n                    /* error */\n                    switch ($this->errorState) {\n                        case 0:\n                            $msg = $this->getErrorMessage($symbol, $state);\n                            $this->emitError(new Error($msg, $this->getAttributesForToken($this->tokenPos)));\n                            // Break missing intentionally\n                            // no break\n                        case 1:\n                        case 2:\n                            $this->errorState = 3;\n\n                            // Pop until error-expecting state uncovered\n                            while (!(\n                                (($idx = $this->actionBase[$state] + $this->errorSymbol) >= 0\n                                    && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol)\n                                || ($state < $this->YY2TBLSTATE\n                                    && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $this->errorSymbol) >= 0\n                                    && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $this->errorSymbol)\n                            ) || ($action = $this->action[$idx]) === $this->defaultAction) { // Not totally sure about this\n                                if ($stackPos <= 0) {\n                                    // Could not recover from error\n                                    return null;\n                                }\n                                $state = $stateStack[--$stackPos];\n                                //$this->tracePop($state);\n                            }\n\n                            //$this->traceShift($this->errorSymbol);\n                            ++$stackPos;\n                            $stateStack[$stackPos] = $state = $action;\n\n                            // We treat the error symbol as being empty, so we reset the end attributes\n                            // to the end attributes of the last non-error symbol\n                            $this->tokenStartStack[$stackPos] = $this->tokenPos;\n                            $this->tokenEndStack[$stackPos] = $this->tokenEndStack[$stackPos - 1];\n                            break;\n\n                        case 3:\n                            if ($symbol === 0) {\n                                // Reached EOF without recovering from error\n                                return null;\n                            }\n\n                            //$this->traceDiscard($symbol);\n                            $symbol = self::SYMBOL_NONE;\n                            break 2;\n                    }\n                }\n\n                if ($state < $this->numNonLeafStates) {\n                    break;\n                }\n\n                /* >= numNonLeafStates means shift-and-reduce */\n                $rule = $state - $this->numNonLeafStates;\n            }\n        }\n    }\n\n    protected function emitError(Error $error): void {\n        $this->errorHandler->handleError($error);\n    }\n\n    /**\n     * Format error message including expected tokens.\n     *\n     * @param int $symbol Unexpected symbol\n     * @param int $state State at time of error\n     *\n     * @return string Formatted error message\n     */\n    protected function getErrorMessage(int $symbol, int $state): string {\n        $expectedString = '';\n        if ($expected = $this->getExpectedTokens($state)) {\n            $expectedString = ', expecting ' . implode(' or ', $expected);\n        }\n\n        return 'Syntax error, unexpected ' . $this->symbolToName[$symbol] . $expectedString;\n    }\n\n    /**\n     * Get limited number of expected tokens in given state.\n     *\n     * @param int $state State\n     *\n     * @return string[] Expected tokens. If too many, an empty array is returned.\n     */\n    protected function getExpectedTokens(int $state): array {\n        $expected = [];\n\n        $base = $this->actionBase[$state];\n        foreach ($this->symbolToName as $symbol => $name) {\n            $idx = $base + $symbol;\n            if ($idx >= 0 && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol\n                || $state < $this->YY2TBLSTATE\n                && ($idx = $this->actionBase[$state + $this->numNonLeafStates] + $symbol) >= 0\n                && $idx < $this->actionTableSize && $this->actionCheck[$idx] === $symbol\n            ) {\n                if ($this->action[$idx] !== $this->unexpectedTokenRule\n                    && $this->action[$idx] !== $this->defaultAction\n                    && $symbol !== $this->errorSymbol\n                ) {\n                    if (count($expected) === 4) {\n                        /* Too many expected tokens */\n                        return [];\n                    }\n\n                    $expected[] = $name;\n                }\n            }\n        }\n\n        return $expected;\n    }\n\n    /**\n     * Get attributes for a node with the given start and end token positions.\n     *\n     * @param int $tokenStartPos Token position the node starts at\n     * @param int $tokenEndPos Token position the node ends at\n     * @return array<string, mixed> Attributes\n     */\n    protected function getAttributes(int $tokenStartPos, int $tokenEndPos): array {\n        $startToken = $this->tokens[$tokenStartPos];\n        $afterEndToken = $this->tokens[$tokenEndPos + 1];\n        return [\n            'startLine' => $startToken->line,\n            'startTokenPos' => $tokenStartPos,\n            'startFilePos' => $startToken->pos,\n            'endLine' => $afterEndToken->line,\n            'endTokenPos' => $tokenEndPos,\n            'endFilePos' => $afterEndToken->pos - 1,\n        ];\n    }\n\n    /**\n     * Get attributes for a single token at the given token position.\n     *\n     * @return array<string, mixed> Attributes\n     */\n    protected function getAttributesForToken(int $tokenPos): array {\n        if ($tokenPos < \\count($this->tokens) - 1) {\n            return $this->getAttributes($tokenPos, $tokenPos);\n        }\n\n        // Get attributes for the sentinel token.\n        $token = $this->tokens[$tokenPos];\n        return [\n            'startLine' => $token->line,\n            'startTokenPos' => $tokenPos,\n            'startFilePos' => $token->pos,\n            'endLine' => $token->line,\n            'endTokenPos' => $tokenPos,\n            'endFilePos' => $token->pos,\n        ];\n    }\n\n    /*\n     * Tracing functions used for debugging the parser.\n     */\n\n    /*\n    protected function traceNewState($state, $symbol): void {\n        echo '% State ' . $state\n            . ', Lookahead ' . ($symbol == self::SYMBOL_NONE ? '--none--' : $this->symbolToName[$symbol]) . \"\\n\";\n    }\n\n    protected function traceRead($symbol): void {\n        echo '% Reading ' . $this->symbolToName[$symbol] . \"\\n\";\n    }\n\n    protected function traceShift($symbol): void {\n        echo '% Shift ' . $this->symbolToName[$symbol] . \"\\n\";\n    }\n\n    protected function traceAccept(): void {\n        echo \"% Accepted.\\n\";\n    }\n\n    protected function traceReduce($n): void {\n        echo '% Reduce by (' . $n . ') ' . $this->productions[$n] . \"\\n\";\n    }\n\n    protected function tracePop($state): void {\n        echo '% Recovering, uncovered state ' . $state . \"\\n\";\n    }\n\n    protected function traceDiscard($symbol): void {\n        echo '% Discard ' . $this->symbolToName[$symbol] . \"\\n\";\n    }\n    */\n\n    /*\n     * Helper functions invoked by semantic actions\n     */\n\n    /**\n     * Moves statements of semicolon-style namespaces into $ns->stmts and checks various error conditions.\n     *\n     * @param Node\\Stmt[] $stmts\n     * @return Node\\Stmt[]\n     */\n    protected function handleNamespaces(array $stmts): array {\n        $hasErrored = false;\n        $style = $this->getNamespacingStyle($stmts);\n        if (null === $style) {\n            // not namespaced, nothing to do\n            return $stmts;\n        }\n        if ('brace' === $style) {\n            // For braced namespaces we only have to check that there are no invalid statements between the namespaces\n            $afterFirstNamespace = false;\n            foreach ($stmts as $stmt) {\n                if ($stmt instanceof Node\\Stmt\\Namespace_) {\n                    $afterFirstNamespace = true;\n                } elseif (!$stmt instanceof Node\\Stmt\\HaltCompiler\n                        && !$stmt instanceof Node\\Stmt\\Nop\n                        && $afterFirstNamespace && !$hasErrored) {\n                    $this->emitError(new Error(\n                        'No code may exist outside of namespace {}', $stmt->getAttributes()));\n                    $hasErrored = true; // Avoid one error for every statement\n                }\n            }\n            return $stmts;\n        } else {\n            // For semicolon namespaces we have to move the statements after a namespace declaration into ->stmts\n            $resultStmts = [];\n            $targetStmts = &$resultStmts;\n            $lastNs = null;\n            foreach ($stmts as $stmt) {\n                if ($stmt instanceof Node\\Stmt\\Namespace_) {\n                    if ($lastNs !== null) {\n                        $this->fixupNamespaceAttributes($lastNs);\n                    }\n                    if ($stmt->stmts === null) {\n                        $stmt->stmts = [];\n                        $targetStmts = &$stmt->stmts;\n                        $resultStmts[] = $stmt;\n                    } else {\n                        // This handles the invalid case of mixed style namespaces\n                        $resultStmts[] = $stmt;\n                        $targetStmts = &$resultStmts;\n                    }\n                    $lastNs = $stmt;\n                } elseif ($stmt instanceof Node\\Stmt\\HaltCompiler) {\n                    // __halt_compiler() is not moved into the namespace\n                    $resultStmts[] = $stmt;\n                } else {\n                    $targetStmts[] = $stmt;\n                }\n            }\n            if ($lastNs !== null) {\n                $this->fixupNamespaceAttributes($lastNs);\n            }\n            return $resultStmts;\n        }\n    }\n\n    private function fixupNamespaceAttributes(Node\\Stmt\\Namespace_ $stmt): void {\n        // We moved the statements into the namespace node, as such the end of the namespace node\n        // needs to be extended to the end of the statements.\n        if (empty($stmt->stmts)) {\n            return;\n        }\n\n        // We only move the builtin end attributes here. This is the best we can do with the\n        // knowledge we have.\n        $endAttributes = ['endLine', 'endFilePos', 'endTokenPos'];\n        $lastStmt = $stmt->stmts[count($stmt->stmts) - 1];\n        foreach ($endAttributes as $endAttribute) {\n            if ($lastStmt->hasAttribute($endAttribute)) {\n                $stmt->setAttribute($endAttribute, $lastStmt->getAttribute($endAttribute));\n            }\n        }\n    }\n\n    /** @return array<string, mixed> */\n    private function getNamespaceErrorAttributes(Namespace_ $node): array {\n        $attrs = $node->getAttributes();\n        // Adjust end attributes to only cover the \"namespace\" keyword, not the whole namespace.\n        if (isset($attrs['startLine'])) {\n            $attrs['endLine'] = $attrs['startLine'];\n        }\n        if (isset($attrs['startTokenPos'])) {\n            $attrs['endTokenPos'] = $attrs['startTokenPos'];\n        }\n        if (isset($attrs['startFilePos'])) {\n            $attrs['endFilePos'] = $attrs['startFilePos'] + \\strlen('namespace') - 1;\n        }\n        return $attrs;\n    }\n\n    /**\n     * Determine namespacing style (semicolon or brace)\n     *\n     * @param Node[] $stmts Top-level statements.\n     *\n     * @return null|string One of \"semicolon\", \"brace\" or null (no namespaces)\n     */\n    private function getNamespacingStyle(array $stmts): ?string {\n        $style = null;\n        $hasNotAllowedStmts = false;\n        foreach ($stmts as $i => $stmt) {\n            if ($stmt instanceof Node\\Stmt\\Namespace_) {\n                $currentStyle = null === $stmt->stmts ? 'semicolon' : 'brace';\n                if (null === $style) {\n                    $style = $currentStyle;\n                    if ($hasNotAllowedStmts) {\n                        $this->emitError(new Error(\n                            'Namespace declaration statement has to be the very first statement in the script',\n                            $this->getNamespaceErrorAttributes($stmt)\n                        ));\n                    }\n                } elseif ($style !== $currentStyle) {\n                    $this->emitError(new Error(\n                        'Cannot mix bracketed namespace declarations with unbracketed namespace declarations',\n                        $this->getNamespaceErrorAttributes($stmt)\n                    ));\n                    // Treat like semicolon style for namespace normalization\n                    return 'semicolon';\n                }\n                continue;\n            }\n\n            /* declare(), __halt_compiler() and nops can be used before a namespace declaration */\n            if ($stmt instanceof Node\\Stmt\\Declare_\n                || $stmt instanceof Node\\Stmt\\HaltCompiler\n                || $stmt instanceof Node\\Stmt\\Nop) {\n                continue;\n            }\n\n            /* There may be a hashbang line at the very start of the file */\n            if ($i === 0 && $stmt instanceof Node\\Stmt\\InlineHTML && preg_match('/\\A#!.*\\r?\\n\\z/', $stmt->value)) {\n                continue;\n            }\n\n            /* Everything else if forbidden before namespace declarations */\n            $hasNotAllowedStmts = true;\n        }\n        return $style;\n    }\n\n    /** @return Name|Identifier */\n    protected function handleBuiltinTypes(Name $name) {\n        if (!$name->isUnqualified()) {\n            return $name;\n        }\n\n        $lowerName = $name->toLowerString();\n        if (!$this->phpVersion->supportsBuiltinType($lowerName)) {\n            return $name;\n        }\n\n        return new Node\\Identifier($lowerName, $name->getAttributes());\n    }\n\n    /**\n     * Get combined start and end attributes at a stack location\n     *\n     * @param int $stackPos Stack location\n     *\n     * @return array<string, mixed> Combined start and end attributes\n     */\n    protected function getAttributesAt(int $stackPos): array {\n        return $this->getAttributes($this->tokenStartStack[$stackPos], $this->tokenEndStack[$stackPos]);\n    }\n\n    protected function getFloatCastKind(string $cast): int {\n        $cast = strtolower($cast);\n        if (strpos($cast, 'float') !== false) {\n            return Double::KIND_FLOAT;\n        }\n\n        if (strpos($cast, 'real') !== false) {\n            return Double::KIND_REAL;\n        }\n\n        return Double::KIND_DOUBLE;\n    }\n\n    protected function getIntCastKind(string $cast): int {\n        $cast = strtolower($cast);\n        if (strpos($cast, 'integer') !== false) {\n            return Expr\\Cast\\Int_::KIND_INTEGER;\n        }\n\n        return Expr\\Cast\\Int_::KIND_INT;\n    }\n\n    protected function getBoolCastKind(string $cast): int {\n        $cast = strtolower($cast);\n        if (strpos($cast, 'boolean') !== false) {\n            return Expr\\Cast\\Bool_::KIND_BOOLEAN;\n        }\n\n        return Expr\\Cast\\Bool_::KIND_BOOL;\n    }\n\n    protected function getStringCastKind(string $cast): int {\n        $cast = strtolower($cast);\n        if (strpos($cast, 'binary') !== false) {\n            return Expr\\Cast\\String_::KIND_BINARY;\n        }\n\n        return Expr\\Cast\\String_::KIND_STRING;\n    }\n\n    /** @param array<string, mixed> $attributes */\n    protected function parseLNumber(string $str, array $attributes, bool $allowInvalidOctal = false): Int_ {\n        try {\n            return Int_::fromString($str, $attributes, $allowInvalidOctal);\n        } catch (Error $error) {\n            $this->emitError($error);\n            // Use dummy value\n            return new Int_(0, $attributes);\n        }\n    }\n\n    /**\n     * Parse a T_NUM_STRING token into either an integer or string node.\n     *\n     * @param string $str Number string\n     * @param array<string, mixed> $attributes Attributes\n     *\n     * @return Int_|String_ Integer or string node.\n     */\n    protected function parseNumString(string $str, array $attributes) {\n        if (!preg_match('/^(?:0|-?[1-9][0-9]*)$/', $str)) {\n            return new String_($str, $attributes);\n        }\n\n        $num = +$str;\n        if (!is_int($num)) {\n            return new String_($str, $attributes);\n        }\n\n        return new Int_($num, $attributes);\n    }\n\n    /** @param array<string, mixed> $attributes */\n    protected function stripIndentation(\n        string $string, int $indentLen, string $indentChar,\n        bool $newlineAtStart, bool $newlineAtEnd, array $attributes\n    ): string {\n        if ($indentLen === 0) {\n            return $string;\n        }\n\n        $start = $newlineAtStart ? '(?:(?<=\\n)|\\A)' : '(?<=\\n)';\n        $end = $newlineAtEnd ? '(?:(?=[\\r\\n])|\\z)' : '(?=[\\r\\n])';\n        $regex = '/' . $start . '([ \\t]*)(' . $end . ')?/';\n        return preg_replace_callback(\n            $regex,\n            function ($matches) use ($indentLen, $indentChar, $attributes) {\n                $prefix = substr($matches[1], 0, $indentLen);\n                if (false !== strpos($prefix, $indentChar === \" \" ? \"\\t\" : \" \")) {\n                    $this->emitError(new Error(\n                        'Invalid indentation - tabs and spaces cannot be mixed', $attributes\n                    ));\n                } elseif (strlen($prefix) < $indentLen && !isset($matches[2])) {\n                    $this->emitError(new Error(\n                        'Invalid body indentation level ' .\n                        '(expecting an indentation level of at least ' . $indentLen . ')',\n                        $attributes\n                    ));\n                }\n                return substr($matches[0], strlen($prefix));\n            },\n            $string\n        );\n    }\n\n    /**\n     * @param string|(Expr|InterpolatedStringPart)[] $contents\n     * @param array<string, mixed> $attributes\n     * @param array<string, mixed> $endTokenAttributes\n     */\n    protected function parseDocString(\n        string $startToken, $contents, string $endToken,\n        array $attributes, array $endTokenAttributes, bool $parseUnicodeEscape\n    ): Expr {\n        $kind = strpos($startToken, \"'\") === false\n            ? String_::KIND_HEREDOC : String_::KIND_NOWDOC;\n\n        $regex = '/\\A[bB]?<<<[ \\t]*[\\'\"]?([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*)[\\'\"]?(?:\\r\\n|\\n|\\r)\\z/';\n        $result = preg_match($regex, $startToken, $matches);\n        assert($result === 1);\n        $label = $matches[1];\n\n        $result = preg_match('/\\A[ \\t]*/', $endToken, $matches);\n        assert($result === 1);\n        $indentation = $matches[0];\n\n        $attributes['kind'] = $kind;\n        $attributes['docLabel'] = $label;\n        $attributes['docIndentation'] = $indentation;\n\n        $indentHasSpaces = false !== strpos($indentation, \" \");\n        $indentHasTabs = false !== strpos($indentation, \"\\t\");\n        if ($indentHasSpaces && $indentHasTabs) {\n            $this->emitError(new Error(\n                'Invalid indentation - tabs and spaces cannot be mixed',\n                $endTokenAttributes\n            ));\n\n            // Proceed processing as if this doc string is not indented\n            $indentation = '';\n        }\n\n        $indentLen = \\strlen($indentation);\n        $indentChar = $indentHasSpaces ? \" \" : \"\\t\";\n\n        if (\\is_string($contents)) {\n            if ($contents === '') {\n                $attributes['rawValue'] = $contents;\n                return new String_('', $attributes);\n            }\n\n            $contents = $this->stripIndentation(\n                $contents, $indentLen, $indentChar, true, true, $attributes\n            );\n            $contents = preg_replace('~(\\r\\n|\\n|\\r)\\z~', '', $contents);\n            $attributes['rawValue'] = $contents;\n\n            if ($kind === String_::KIND_HEREDOC) {\n                $contents = String_::parseEscapeSequences($contents, null, $parseUnicodeEscape);\n            }\n\n            return new String_($contents, $attributes);\n        } else {\n            assert(count($contents) > 0);\n            if (!$contents[0] instanceof Node\\InterpolatedStringPart) {\n                // If there is no leading encapsed string part, pretend there is an empty one\n                $this->stripIndentation(\n                    '', $indentLen, $indentChar, true, false, $contents[0]->getAttributes()\n                );\n            }\n\n            $newContents = [];\n            foreach ($contents as $i => $part) {\n                if ($part instanceof Node\\InterpolatedStringPart) {\n                    $isLast = $i === \\count($contents) - 1;\n                    $part->value = $this->stripIndentation(\n                        $part->value, $indentLen, $indentChar,\n                        $i === 0, $isLast, $part->getAttributes()\n                    );\n                    if ($isLast) {\n                        $part->value = preg_replace('~(\\r\\n|\\n|\\r)\\z~', '', $part->value);\n                    }\n                    $part->setAttribute('rawValue', $part->value);\n                    $part->value = String_::parseEscapeSequences($part->value, null, $parseUnicodeEscape);\n                    if ('' === $part->value) {\n                        continue;\n                    }\n                }\n                $newContents[] = $part;\n            }\n            return new InterpolatedString($newContents, $attributes);\n        }\n    }\n\n    protected function createCommentFromToken(Token $token, int $tokenPos): Comment {\n        assert($token->id === \\T_COMMENT || $token->id == \\T_DOC_COMMENT);\n        return \\T_DOC_COMMENT === $token->id\n            ? new Comment\\Doc($token->text, $token->line, $token->pos, $tokenPos,\n                $token->getEndLine(), $token->getEndPos() - 1, $tokenPos)\n            : new Comment($token->text, $token->line, $token->pos, $tokenPos,\n                $token->getEndLine(), $token->getEndPos() - 1, $tokenPos);\n    }\n\n    /**\n     * Get last comment before the given token position, if any\n     */\n    protected function getCommentBeforeToken(int $tokenPos): ?Comment {\n        while (--$tokenPos >= 0) {\n            $token = $this->tokens[$tokenPos];\n            if (!isset($this->dropTokens[$token->id])) {\n                break;\n            }\n\n            if ($token->id === \\T_COMMENT || $token->id === \\T_DOC_COMMENT) {\n                return $this->createCommentFromToken($token, $tokenPos);\n            }\n        }\n        return null;\n    }\n\n    /**\n     * Create a zero-length nop to capture preceding comments, if any.\n     */\n    protected function maybeCreateZeroLengthNop(int $tokenPos): ?Nop {\n        $comment = $this->getCommentBeforeToken($tokenPos);\n        if ($comment === null) {\n            return null;\n        }\n\n        $commentEndLine = $comment->getEndLine();\n        $commentEndFilePos = $comment->getEndFilePos();\n        $commentEndTokenPos = $comment->getEndTokenPos();\n        $attributes = [\n            'startLine' => $commentEndLine,\n            'endLine' => $commentEndLine,\n            'startFilePos' => $commentEndFilePos + 1,\n            'endFilePos' => $commentEndFilePos,\n            'startTokenPos' => $commentEndTokenPos + 1,\n            'endTokenPos' => $commentEndTokenPos,\n        ];\n        return new Nop($attributes);\n    }\n\n    protected function maybeCreateNop(int $tokenStartPos, int $tokenEndPos): ?Nop {\n        if ($this->getCommentBeforeToken($tokenStartPos) === null) {\n            return null;\n        }\n        return new Nop($this->getAttributes($tokenStartPos, $tokenEndPos));\n    }\n\n    protected function handleHaltCompiler(): string {\n        // Prevent the lexer from returning any further tokens.\n        $nextToken = $this->tokens[$this->tokenPos + 1];\n        $this->tokenPos = \\count($this->tokens) - 2;\n\n        // Return text after __halt_compiler.\n        return $nextToken->id === \\T_INLINE_HTML ? $nextToken->text : '';\n    }\n\n    protected function inlineHtmlHasLeadingNewline(int $stackPos): bool {\n        $tokenPos = $this->tokenStartStack[$stackPos];\n        $token = $this->tokens[$tokenPos];\n        assert($token->id == \\T_INLINE_HTML);\n        if ($tokenPos > 0) {\n            $prevToken = $this->tokens[$tokenPos - 1];\n            assert($prevToken->id == \\T_CLOSE_TAG);\n            return false !== strpos($prevToken->text, \"\\n\")\n                || false !== strpos($prevToken->text, \"\\r\");\n        }\n        return true;\n    }\n\n    /**\n     * @return array<string, mixed>\n     */\n    protected function createEmptyElemAttributes(int $tokenPos): array {\n        return $this->getAttributesForToken($tokenPos);\n    }\n\n    protected function fixupArrayDestructuring(Array_ $node): Expr\\List_ {\n        $this->createdArrays->offsetUnset($node);\n        return new Expr\\List_(array_map(function (Node\\ArrayItem $item) {\n            if ($item->value instanceof Expr\\Error) {\n                // We used Error as a placeholder for empty elements, which are legal for destructuring.\n                return null;\n            }\n            if ($item->value instanceof Array_) {\n                return new Node\\ArrayItem(\n                    $this->fixupArrayDestructuring($item->value),\n                    $item->key, $item->byRef, $item->getAttributes());\n            }\n            return $item;\n        }, $node->items), ['kind' => Expr\\List_::KIND_ARRAY] + $node->getAttributes());\n    }\n\n    protected function postprocessList(Expr\\List_ $node): void {\n        foreach ($node->items as $i => $item) {\n            if ($item->value instanceof Expr\\Error) {\n                // We used Error as a placeholder for empty elements, which are legal for destructuring.\n                $node->items[$i] = null;\n            }\n        }\n    }\n\n    /** @param ElseIf_|Else_ $node */\n    protected function fixupAlternativeElse($node): void {\n        // Make sure a trailing nop statement carrying comments is part of the node.\n        $numStmts = \\count($node->stmts);\n        if ($numStmts !== 0 && $node->stmts[$numStmts - 1] instanceof Nop) {\n            $nopAttrs = $node->stmts[$numStmts - 1]->getAttributes();\n            if (isset($nopAttrs['endLine'])) {\n                $node->setAttribute('endLine', $nopAttrs['endLine']);\n            }\n            if (isset($nopAttrs['endFilePos'])) {\n                $node->setAttribute('endFilePos', $nopAttrs['endFilePos']);\n            }\n            if (isset($nopAttrs['endTokenPos'])) {\n                $node->setAttribute('endTokenPos', $nopAttrs['endTokenPos']);\n            }\n        }\n    }\n\n    protected function checkClassModifier(int $a, int $b, int $modifierPos): void {\n        try {\n            Modifiers::verifyClassModifier($a, $b);\n        } catch (Error $error) {\n            $error->setAttributes($this->getAttributesAt($modifierPos));\n            $this->emitError($error);\n        }\n    }\n\n    protected function checkModifier(int $a, int $b, int $modifierPos): void {\n        // Jumping through some hoops here because verifyModifier() is also used elsewhere\n        try {\n            Modifiers::verifyModifier($a, $b);\n        } catch (Error $error) {\n            $error->setAttributes($this->getAttributesAt($modifierPos));\n            $this->emitError($error);\n        }\n    }\n\n    protected function checkParam(Param $node): void {\n        if ($node->variadic && null !== $node->default) {\n            $this->emitError(new Error(\n                'Variadic parameter cannot have a default value',\n                $node->default->getAttributes()\n            ));\n        }\n\n        if ($node->type instanceof Identifier && $node->type->name === 'void') {\n            $this->emitError(new Error(\n                'void cannot be used as a parameter type',\n                $node->type->getAttributes()\n            ));\n        }\n    }\n\n    protected function checkTryCatch(TryCatch $node): void {\n        if (empty($node->catches) && null === $node->finally) {\n            $this->emitError(new Error(\n                'Cannot use try without catch or finally', $node->getAttributes()\n            ));\n        }\n    }\n\n    protected function checkNamespace(Namespace_ $node): void {\n        if (null !== $node->stmts) {\n            foreach ($node->stmts as $stmt) {\n                if ($stmt instanceof Namespace_) {\n                    $this->emitError(new Error(\n                        'Namespace declarations cannot be nested', $stmt->getAttributes()\n                    ));\n                }\n            }\n        }\n    }\n\n    private function checkClassName(?Identifier $name, int $namePos): void {\n        if (null !== $name && $name->isSpecialClassName()) {\n            $this->emitError(new Error(\n                sprintf('Cannot use \\'%s\\' as class name as it is reserved', $name),\n                $this->getAttributesAt($namePos)\n            ));\n        }\n    }\n\n    /** @param Name[] $interfaces */\n    private function checkImplementedInterfaces(array $interfaces): void {\n        foreach ($interfaces as $interface) {\n            if ($interface->isSpecialClassName()) {\n                $this->emitError(new Error(\n                    sprintf('Cannot use \\'%s\\' as interface name as it is reserved', $interface),\n                    $interface->getAttributes()\n                ));\n            }\n        }\n    }\n\n    protected function checkClass(Class_ $node, int $namePos): void {\n        $this->checkClassName($node->name, $namePos);\n\n        if ($node->extends && $node->extends->isSpecialClassName()) {\n            $this->emitError(new Error(\n                sprintf('Cannot use \\'%s\\' as class name as it is reserved', $node->extends),\n                $node->extends->getAttributes()\n            ));\n        }\n\n        $this->checkImplementedInterfaces($node->implements);\n    }\n\n    protected function checkInterface(Interface_ $node, int $namePos): void {\n        $this->checkClassName($node->name, $namePos);\n        $this->checkImplementedInterfaces($node->extends);\n    }\n\n    protected function checkEnum(Enum_ $node, int $namePos): void {\n        $this->checkClassName($node->name, $namePos);\n        $this->checkImplementedInterfaces($node->implements);\n    }\n\n    protected function checkClassMethod(ClassMethod $node, int $modifierPos): void {\n        if ($node->flags & Modifiers::STATIC) {\n            switch ($node->name->toLowerString()) {\n                case '__construct':\n                    $this->emitError(new Error(\n                        sprintf('Constructor %s() cannot be static', $node->name),\n                        $this->getAttributesAt($modifierPos)));\n                    break;\n                case '__destruct':\n                    $this->emitError(new Error(\n                        sprintf('Destructor %s() cannot be static', $node->name),\n                        $this->getAttributesAt($modifierPos)));\n                    break;\n                case '__clone':\n                    $this->emitError(new Error(\n                        sprintf('Clone method %s() cannot be static', $node->name),\n                        $this->getAttributesAt($modifierPos)));\n                    break;\n            }\n        }\n\n        if ($node->flags & Modifiers::READONLY) {\n            $this->emitError(new Error(\n                sprintf('Method %s() cannot be readonly', $node->name),\n                $this->getAttributesAt($modifierPos)));\n        }\n    }\n\n    protected function checkClassConst(ClassConst $node, int $modifierPos): void {\n        foreach ([Modifiers::STATIC, Modifiers::ABSTRACT, Modifiers::READONLY] as $modifier) {\n            if ($node->flags & $modifier) {\n                $this->emitError(new Error(\n                    \"Cannot use '\" . Modifiers::toString($modifier) . \"' as constant modifier\",\n                    $this->getAttributesAt($modifierPos)));\n            }\n        }\n    }\n\n    protected function checkUseUse(UseItem $node, int $namePos): void {\n        if ($node->alias && $node->alias->isSpecialClassName()) {\n            $this->emitError(new Error(\n                sprintf(\n                    'Cannot use %s as %s because \\'%2$s\\' is a special class name',\n                    $node->name, $node->alias\n                ),\n                $this->getAttributesAt($namePos)\n            ));\n        }\n    }\n\n    protected function checkPropertyHooksForMultiProperty(Property $property, int $hookPos): void {\n        if (count($property->props) > 1) {\n            $this->emitError(new Error(\n                'Cannot use hooks when declaring multiple properties', $this->getAttributesAt($hookPos)));\n        }\n    }\n\n    /** @param PropertyHook[] $hooks */\n    protected function checkEmptyPropertyHookList(array $hooks, int $hookPos): void {\n        if (empty($hooks)) {\n            $this->emitError(new Error(\n                'Property hook list cannot be empty', $this->getAttributesAt($hookPos)));\n        }\n    }\n\n    protected function checkPropertyHook(PropertyHook $hook, ?int $paramListPos): void {\n        $name = $hook->name->toLowerString();\n        if ($name !== 'get' && $name !== 'set') {\n            $this->emitError(new Error(\n                'Unknown hook \"' . $hook->name . '\", expected \"get\" or \"set\"',\n                $hook->name->getAttributes()));\n        }\n        if ($name === 'get' && $paramListPos !== null) {\n            $this->emitError(new Error(\n                'get hook must not have a parameter list', $this->getAttributesAt($paramListPos)));\n        }\n    }\n\n    protected function checkPropertyHookModifiers(int $a, int $b, int $modifierPos): void {\n        try {\n            Modifiers::verifyModifier($a, $b);\n        } catch (Error $error) {\n            $error->setAttributes($this->getAttributesAt($modifierPos));\n            $this->emitError($error);\n        }\n\n        if ($b != Modifiers::FINAL) {\n            $this->emitError(new Error(\n                'Cannot use the ' . Modifiers::toString($b) . ' modifier on a property hook',\n                $this->getAttributesAt($modifierPos)));\n        }\n    }\n\n    protected function checkConstantAttributes(Const_ $node): void {\n        if ($node->attrGroups !== [] && count($node->consts) > 1) {\n            $this->emitError(new Error(\n                'Cannot use attributes on multiple constants at once', $node->getAttributes()));\n        }\n    }\n\n    protected function checkPipeOperatorParentheses(Expr $node): void {\n        if ($node instanceof Expr\\ArrowFunction && !$this->parenthesizedArrowFunctions->offsetExists($node)) {\n            $this->emitError(new Error(\n                'Arrow functions on the right hand side of |> must be parenthesized', $node->getAttributes()));\n        }\n    }\n\n    /**\n     * @param Property|Param $node\n     */\n    protected function addPropertyNameToHooks(Node $node): void {\n        if ($node instanceof Property) {\n            $name = $node->props[0]->name->toString();\n        } else {\n            $name = $node->var->name;\n        }\n        foreach ($node->hooks as $hook) {\n            $hook->setAttribute('propertyName', $name);\n        }\n    }\n\n    /** @param array<Node\\Arg|Node\\VariadicPlaceholder> $args */\n    private function isSimpleExit(array $args): bool {\n        if (\\count($args) === 0) {\n            return true;\n        }\n        if (\\count($args) === 1) {\n            $arg = $args[0];\n            return $arg instanceof Arg && $arg->name === null &&\n                   $arg->byRef === false && $arg->unpack === false;\n        }\n        return false;\n    }\n\n    /**\n     * @param array<Node\\Arg|Node\\VariadicPlaceholder> $args\n     * @param array<string, mixed> $attrs\n     */\n    protected function createExitExpr(string $name, int $namePos, array $args, array $attrs): Expr {\n        if ($this->isSimpleExit($args)) {\n            // Create Exit node for backwards compatibility.\n            $attrs['kind'] = strtolower($name) === 'exit' ? Expr\\Exit_::KIND_EXIT : Expr\\Exit_::KIND_DIE;\n            return new Expr\\Exit_(\\count($args) === 1 ? $args[0]->value : null, $attrs);\n        }\n        return new Expr\\FuncCall(new Name($name, $this->getAttributesAt($namePos)), $args, $attrs);\n    }\n\n    /**\n     * Creates the token map.\n     *\n     * The token map maps the PHP internal token identifiers\n     * to the identifiers used by the Parser. Additionally it\n     * maps T_OPEN_TAG_WITH_ECHO to T_ECHO and T_CLOSE_TAG to ';'.\n     *\n     * @return array<int, int> The token map\n     */\n    protected function createTokenMap(): array {\n        $tokenMap = [];\n\n        // Single-char tokens use an identity mapping.\n        for ($i = 0; $i < 256; ++$i) {\n            $tokenMap[$i] = $i;\n        }\n\n        foreach ($this->symbolToName as $name) {\n            if ($name[0] === 'T') {\n                $tokenMap[\\constant($name)] = constant(static::class . '::' . $name);\n            }\n        }\n\n        // T_OPEN_TAG_WITH_ECHO with dropped T_OPEN_TAG results in T_ECHO\n        $tokenMap[\\T_OPEN_TAG_WITH_ECHO] = static::T_ECHO;\n        // T_CLOSE_TAG is equivalent to ';'\n        $tokenMap[\\T_CLOSE_TAG] = ord(';');\n\n        // We have created a map from PHP token IDs to external symbol IDs.\n        // Now map them to the internal symbol ID.\n        $fullTokenMap = [];\n        foreach ($tokenMap as $phpToken => $extSymbol) {\n            $intSymbol = $this->tokenToSymbol[$extSymbol];\n            if ($intSymbol === $this->invalidSymbol) {\n                continue;\n            }\n            $fullTokenMap[$phpToken] = $intSymbol;\n        }\n\n        return $fullTokenMap;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/ParserFactory.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Parser\\Php7;\nuse PhpParser\\Parser\\Php8;\n\nclass ParserFactory {\n    /**\n     * Create a parser targeting the given version on a best-effort basis. The parser will generally\n     * accept code for the newest supported version, but will try to accommodate code that becomes\n     * invalid in newer versions or changes in interpretation.\n     */\n    public function createForVersion(PhpVersion $version): Parser {\n        if ($version->isHostVersion()) {\n            $lexer = new Lexer();\n        } else {\n            $lexer = new Lexer\\Emulative($version);\n        }\n        if ($version->id >= 80000) {\n            return new Php8($lexer, $version);\n        }\n        return new Php7($lexer, $version);\n    }\n\n    /**\n     * Create a parser targeting the newest version supported by this library. Code for older\n     * versions will be accepted if there have been no relevant backwards-compatibility breaks in\n     * PHP.\n     */\n    public function createForNewestSupportedVersion(): Parser {\n        return $this->createForVersion(PhpVersion::getNewestSupported());\n    }\n\n    /**\n     * Create a parser targeting the host PHP version, that is the PHP version we're currently\n     * running on. This parser will not use any token emulation.\n     */\n    public function createForHostVersion(): Parser {\n        return $this->createForVersion(PhpVersion::getHostVersion());\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/PhpVersion.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\n/**\n * A PHP version, representing only the major and minor version components.\n */\nclass PhpVersion {\n    /** @var int Version ID in PHP_VERSION_ID format */\n    public int $id;\n\n    /** @var int[] Minimum versions for builtin types */\n    private const BUILTIN_TYPE_VERSIONS = [\n        'array'    => 50100,\n        'callable' => 50400,\n        'bool'     => 70000,\n        'int'      => 70000,\n        'float'    => 70000,\n        'string'   => 70000,\n        'iterable' => 70100,\n        'void'     => 70100,\n        'object'   => 70200,\n        'null'     => 80000,\n        'false'    => 80000,\n        'mixed'    => 80000,\n        'never'    => 80100,\n        'true'     => 80200,\n    ];\n\n    private function __construct(int $id) {\n        $this->id = $id;\n    }\n\n    /**\n     * Create a PhpVersion object from major and minor version components.\n     */\n    public static function fromComponents(int $major, int $minor): self {\n        return new self($major * 10000 + $minor * 100);\n    }\n\n    /**\n     * Get the newest PHP version supported by this library. Support for this version may be partial,\n     * if it is still under development.\n     */\n    public static function getNewestSupported(): self {\n        return self::fromComponents(8, 5);\n    }\n\n    /**\n     * Get the host PHP version, that is the PHP version we're currently running on.\n     */\n    public static function getHostVersion(): self {\n        return self::fromComponents(\\PHP_MAJOR_VERSION, \\PHP_MINOR_VERSION);\n    }\n\n    /**\n     * Parse the version from a string like \"8.1\".\n     */\n    public static function fromString(string $version): self {\n        if (!preg_match('/^(\\d+)\\.(\\d+)/', $version, $matches)) {\n            throw new \\LogicException(\"Invalid PHP version \\\"$version\\\"\");\n        }\n        return self::fromComponents((int) $matches[1], (int) $matches[2]);\n    }\n\n    /**\n     * Check whether two versions are the same.\n     */\n    public function equals(PhpVersion $other): bool {\n        return $this->id === $other->id;\n    }\n\n    /**\n     * Check whether this version is greater than or equal to the argument.\n     */\n    public function newerOrEqual(PhpVersion $other): bool {\n        return $this->id >= $other->id;\n    }\n\n    /**\n     * Check whether this version is older than the argument.\n     */\n    public function older(PhpVersion $other): bool {\n        return $this->id < $other->id;\n    }\n\n    /**\n     * Check whether this is the host PHP version.\n     */\n    public function isHostVersion(): bool {\n        return $this->equals(self::getHostVersion());\n    }\n\n    /**\n     * Check whether this PHP version supports the given builtin type. Type name must be lowercase.\n     */\n    public function supportsBuiltinType(string $type): bool {\n        $minVersion = self::BUILTIN_TYPE_VERSIONS[$type] ?? null;\n        return $minVersion !== null && $this->id >= $minVersion;\n    }\n\n    /**\n     * Whether this version supports [] array literals.\n     */\n    public function supportsShortArraySyntax(): bool {\n        return $this->id >= 50400;\n    }\n\n    /**\n     * Whether this version supports [] for destructuring.\n     */\n    public function supportsShortArrayDestructuring(): bool {\n        return $this->id >= 70100;\n    }\n\n    /**\n     * Whether this version supports flexible heredoc/nowdoc.\n     */\n    public function supportsFlexibleHeredoc(): bool {\n        return $this->id >= 70300;\n    }\n\n    /**\n     * Whether this version supports trailing commas in parameter lists.\n     */\n    public function supportsTrailingCommaInParamList(): bool {\n        return $this->id >= 80000;\n    }\n\n    /**\n     * Whether this version allows \"$var =& new Obj\".\n     */\n    public function allowsAssignNewByReference(): bool {\n        return $this->id < 70000;\n    }\n\n    /**\n     * Whether this version allows invalid octals like \"08\".\n     */\n    public function allowsInvalidOctals(): bool {\n        return $this->id < 70000;\n    }\n\n    /**\n     * Whether this version allows DEL (\\x7f) to occur in identifiers.\n     */\n    public function allowsDelInIdentifiers(): bool {\n        return $this->id < 70100;\n    }\n\n    /**\n     * Whether this version supports yield in expression context without parentheses.\n     */\n    public function supportsYieldWithoutParentheses(): bool {\n        return $this->id >= 70000;\n    }\n\n    /**\n     * Whether this version supports unicode escape sequences in strings.\n     */\n    public function supportsUnicodeEscapes(): bool {\n        return $this->id >= 70000;\n    }\n\n    /*\n     * Whether this version supports attributes.\n     */\n    public function supportsAttributes(): bool {\n        return $this->id >= 80000;\n    }\n\n    public function supportsNewDereferenceWithoutParentheses(): bool {\n        return $this->id >= 80400;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/PrettyPrinter/Standard.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\PrettyPrinter;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Expr\\AssignOp;\nuse PhpParser\\Node\\Expr\\BinaryOp;\nuse PhpParser\\Node\\Expr\\Cast;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Scalar\\MagicConst;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\PrettyPrinterAbstract;\n\nclass Standard extends PrettyPrinterAbstract {\n    // Special nodes\n\n    protected function pParam(Node\\Param $node): string {\n        return $this->pAttrGroups($node->attrGroups, $this->phpVersion->supportsAttributes())\n             . $this->pModifiers($node->flags)\n             . ($node->type ? $this->p($node->type) . ' ' : '')\n             . ($node->byRef ? '&' : '')\n             . ($node->variadic ? '...' : '')\n             . $this->p($node->var)\n             . ($node->default ? ' = ' . $this->p($node->default) : '')\n             . ($node->hooks ? ' {' . $this->pStmts($node->hooks) . $this->nl . '}' : '');\n    }\n\n    protected function pArg(Node\\Arg $node): string {\n        return ($node->name ? $node->name->toString() . ': ' : '')\n             . ($node->byRef ? '&' : '') . ($node->unpack ? '...' : '')\n             . $this->p($node->value);\n    }\n\n    protected function pVariadicPlaceholder(Node\\VariadicPlaceholder $node): string {\n        return '...';\n    }\n\n    protected function pConst(Node\\Const_ $node): string {\n        return $node->name . ' = ' . $this->p($node->value);\n    }\n\n    protected function pNullableType(Node\\NullableType $node): string {\n        return '?' . $this->p($node->type);\n    }\n\n    protected function pUnionType(Node\\UnionType $node): string {\n        $types = [];\n        foreach ($node->types as $typeNode) {\n            if ($typeNode instanceof Node\\IntersectionType) {\n                $types[] = '('. $this->p($typeNode) . ')';\n                continue;\n            }\n            $types[] = $this->p($typeNode);\n        }\n        return implode('|', $types);\n    }\n\n    protected function pIntersectionType(Node\\IntersectionType $node): string {\n        return $this->pImplode($node->types, '&');\n    }\n\n    protected function pIdentifier(Node\\Identifier $node): string {\n        return $node->name;\n    }\n\n    protected function pVarLikeIdentifier(Node\\VarLikeIdentifier $node): string {\n        return '$' . $node->name;\n    }\n\n    protected function pAttribute(Node\\Attribute $node): string {\n        return $this->p($node->name)\n             . ($node->args ? '(' . $this->pCommaSeparated($node->args) . ')' : '');\n    }\n\n    protected function pAttributeGroup(Node\\AttributeGroup $node): string {\n        return '#[' . $this->pCommaSeparated($node->attrs) . ']';\n    }\n\n    // Names\n\n    protected function pName(Name $node): string {\n        return $node->name;\n    }\n\n    protected function pName_FullyQualified(Name\\FullyQualified $node): string {\n        return '\\\\' . $node->name;\n    }\n\n    protected function pName_Relative(Name\\Relative $node): string {\n        return 'namespace\\\\' . $node->name;\n    }\n\n    // Magic Constants\n\n    protected function pScalar_MagicConst_Class(MagicConst\\Class_ $node): string {\n        return '__CLASS__';\n    }\n\n    protected function pScalar_MagicConst_Dir(MagicConst\\Dir $node): string {\n        return '__DIR__';\n    }\n\n    protected function pScalar_MagicConst_File(MagicConst\\File $node): string {\n        return '__FILE__';\n    }\n\n    protected function pScalar_MagicConst_Function(MagicConst\\Function_ $node): string {\n        return '__FUNCTION__';\n    }\n\n    protected function pScalar_MagicConst_Line(MagicConst\\Line $node): string {\n        return '__LINE__';\n    }\n\n    protected function pScalar_MagicConst_Method(MagicConst\\Method $node): string {\n        return '__METHOD__';\n    }\n\n    protected function pScalar_MagicConst_Namespace(MagicConst\\Namespace_ $node): string {\n        return '__NAMESPACE__';\n    }\n\n    protected function pScalar_MagicConst_Trait(MagicConst\\Trait_ $node): string {\n        return '__TRAIT__';\n    }\n\n    protected function pScalar_MagicConst_Property(MagicConst\\Property $node): string {\n        return '__PROPERTY__';\n    }\n\n    // Scalars\n\n    private function indentString(string $str): string {\n        return str_replace(\"\\n\", $this->nl, $str);\n    }\n\n    protected function pScalar_String(Scalar\\String_ $node): string {\n        $kind = $node->getAttribute('kind', Scalar\\String_::KIND_SINGLE_QUOTED);\n        switch ($kind) {\n            case Scalar\\String_::KIND_NOWDOC:\n                $label = $node->getAttribute('docLabel');\n                if ($label && !$this->containsEndLabel($node->value, $label)) {\n                    $shouldIdent = $this->phpVersion->supportsFlexibleHeredoc();\n                    $nl = $shouldIdent ? $this->nl : $this->newline;\n                    if ($node->value === '') {\n                        return \"<<<'$label'$nl$label{$this->docStringEndToken}\";\n                    }\n\n                    // Make sure trailing \\r is not combined with following \\n into CRLF.\n                    if ($node->value[strlen($node->value) - 1] !== \"\\r\") {\n                        $value = $shouldIdent ? $this->indentString($node->value) : $node->value;\n                        return \"<<<'$label'$nl$value$nl$label{$this->docStringEndToken}\";\n                    }\n                }\n                /* break missing intentionally */\n                // no break\n            case Scalar\\String_::KIND_SINGLE_QUOTED:\n                return $this->pSingleQuotedString($node->value);\n            case Scalar\\String_::KIND_HEREDOC:\n                $label = $node->getAttribute('docLabel');\n                $escaped = $this->escapeString($node->value, null);\n                if ($label && !$this->containsEndLabel($escaped, $label)) {\n                    $nl = $this->phpVersion->supportsFlexibleHeredoc() ? $this->nl : $this->newline;\n                    if ($escaped === '') {\n                        return \"<<<$label$nl$label{$this->docStringEndToken}\";\n                    }\n\n                    return \"<<<$label$nl$escaped$nl$label{$this->docStringEndToken}\";\n                }\n                /* break missing intentionally */\n                // no break\n            case Scalar\\String_::KIND_DOUBLE_QUOTED:\n                return '\"' . $this->escapeString($node->value, '\"') . '\"';\n        }\n        throw new \\Exception('Invalid string kind');\n    }\n\n    protected function pScalar_InterpolatedString(Scalar\\InterpolatedString $node): string {\n        if ($node->getAttribute('kind') === Scalar\\String_::KIND_HEREDOC) {\n            $label = $node->getAttribute('docLabel');\n            if ($label && !$this->encapsedContainsEndLabel($node->parts, $label)) {\n                $nl = $this->phpVersion->supportsFlexibleHeredoc() ? $this->nl : $this->newline;\n                if (count($node->parts) === 1\n                    && $node->parts[0] instanceof Node\\InterpolatedStringPart\n                    && $node->parts[0]->value === ''\n                ) {\n                    return \"<<<$label$nl$label{$this->docStringEndToken}\";\n                }\n\n                return \"<<<$label$nl\" . $this->pEncapsList($node->parts, null)\n                     . \"$nl$label{$this->docStringEndToken}\";\n            }\n        }\n        return '\"' . $this->pEncapsList($node->parts, '\"') . '\"';\n    }\n\n    protected function pScalar_Int(Scalar\\Int_ $node): string {\n        if ($node->getAttribute('shouldPrintRawValue') === true) {\n            return $node->getAttribute('rawValue');\n        }\n\n        if ($node->value === -\\PHP_INT_MAX - 1) {\n            // PHP_INT_MIN cannot be represented as a literal,\n            // because the sign is not part of the literal\n            return '(-' . \\PHP_INT_MAX . '-1)';\n        }\n\n        $kind = $node->getAttribute('kind', Scalar\\Int_::KIND_DEC);\n\n        if (Scalar\\Int_::KIND_DEC === $kind) {\n            return (string) $node->value;\n        }\n\n        if ($node->value < 0) {\n            $sign = '-';\n            $str = (string) -$node->value;\n        } else {\n            $sign = '';\n            $str = (string) $node->value;\n        }\n        switch ($kind) {\n            case Scalar\\Int_::KIND_BIN:\n                return $sign . '0b' . base_convert($str, 10, 2);\n            case Scalar\\Int_::KIND_OCT:\n                return $sign . '0' . base_convert($str, 10, 8);\n            case Scalar\\Int_::KIND_HEX:\n                return $sign . '0x' . base_convert($str, 10, 16);\n        }\n        throw new \\Exception('Invalid number kind');\n    }\n\n    protected function pScalar_Float(Scalar\\Float_ $node): string {\n        if (!is_finite($node->value)) {\n            if ($node->value === \\INF) {\n                return '1.0E+1000';\n            }\n            if ($node->value === -\\INF) {\n                return '-1.0E+1000';\n            } else {\n                return '\\NAN';\n            }\n        }\n\n        // Try to find a short full-precision representation\n        $stringValue = sprintf('%.16G', $node->value);\n        if ($node->value !== (float) $stringValue) {\n            $stringValue = sprintf('%.17G', $node->value);\n        }\n\n        // %G is locale dependent and there exists no locale-independent alternative. We don't want\n        // mess with switching locales here, so let's assume that a comma is the only non-standard\n        // decimal separator we may encounter...\n        $stringValue = str_replace(',', '.', $stringValue);\n\n        // ensure that number is really printed as float\n        return preg_match('/^-?[0-9]+$/', $stringValue) ? $stringValue . '.0' : $stringValue;\n    }\n\n    // Assignments\n\n    protected function pExpr_Assign(Expr\\Assign $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\Assign::class, $this->p($node->var) . ' = ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignRef(Expr\\AssignRef $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\AssignRef::class, $this->p($node->var) . ' =& ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_Plus(AssignOp\\Plus $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\Plus::class, $this->p($node->var) . ' += ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_Minus(AssignOp\\Minus $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\Minus::class, $this->p($node->var) . ' -= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_Mul(AssignOp\\Mul $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\Mul::class, $this->p($node->var) . ' *= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_Div(AssignOp\\Div $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\Div::class, $this->p($node->var) . ' /= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_Concat(AssignOp\\Concat $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\Concat::class, $this->p($node->var) . ' .= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_Mod(AssignOp\\Mod $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\Mod::class, $this->p($node->var) . ' %= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_BitwiseAnd(AssignOp\\BitwiseAnd $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\BitwiseAnd::class, $this->p($node->var) . ' &= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_BitwiseOr(AssignOp\\BitwiseOr $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\BitwiseOr::class, $this->p($node->var) . ' |= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_BitwiseXor(AssignOp\\BitwiseXor $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\BitwiseXor::class, $this->p($node->var) . ' ^= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_ShiftLeft(AssignOp\\ShiftLeft $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\ShiftLeft::class, $this->p($node->var) . ' <<= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_ShiftRight(AssignOp\\ShiftRight $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\ShiftRight::class, $this->p($node->var) . ' >>= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_Pow(AssignOp\\Pow $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\Pow::class, $this->p($node->var) . ' **= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_AssignOp_Coalesce(AssignOp\\Coalesce $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(AssignOp\\Coalesce::class, $this->p($node->var) . ' ??= ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    // Binary expressions\n\n    protected function pExpr_BinaryOp_Plus(BinaryOp\\Plus $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Plus::class, $node->left, ' + ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Minus(BinaryOp\\Minus $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Minus::class, $node->left, ' - ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Mul(BinaryOp\\Mul $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Mul::class, $node->left, ' * ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Div(BinaryOp\\Div $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Div::class, $node->left, ' / ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Concat(BinaryOp\\Concat $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Concat::class, $node->left, ' . ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Mod(BinaryOp\\Mod $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Mod::class, $node->left, ' % ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_BooleanAnd(BinaryOp\\BooleanAnd $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\BooleanAnd::class, $node->left, ' && ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_BooleanOr(BinaryOp\\BooleanOr $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\BooleanOr::class, $node->left, ' || ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_BitwiseAnd(BinaryOp\\BitwiseAnd $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\BitwiseAnd::class, $node->left, ' & ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_BitwiseOr(BinaryOp\\BitwiseOr $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\BitwiseOr::class, $node->left, ' | ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_BitwiseXor(BinaryOp\\BitwiseXor $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\BitwiseXor::class, $node->left, ' ^ ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_ShiftLeft(BinaryOp\\ShiftLeft $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\ShiftLeft::class, $node->left, ' << ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_ShiftRight(BinaryOp\\ShiftRight $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\ShiftRight::class, $node->left, ' >> ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Pow(BinaryOp\\Pow $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Pow::class, $node->left, ' ** ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_LogicalAnd(BinaryOp\\LogicalAnd $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\LogicalAnd::class, $node->left, ' and ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_LogicalOr(BinaryOp\\LogicalOr $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\LogicalOr::class, $node->left, ' or ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_LogicalXor(BinaryOp\\LogicalXor $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\LogicalXor::class, $node->left, ' xor ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Equal(BinaryOp\\Equal $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Equal::class, $node->left, ' == ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_NotEqual(BinaryOp\\NotEqual $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\NotEqual::class, $node->left, ' != ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Identical(BinaryOp\\Identical $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Identical::class, $node->left, ' === ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_NotIdentical(BinaryOp\\NotIdentical $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\NotIdentical::class, $node->left, ' !== ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Spaceship(BinaryOp\\Spaceship $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Spaceship::class, $node->left, ' <=> ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Greater(BinaryOp\\Greater $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Greater::class, $node->left, ' > ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_GreaterOrEqual(BinaryOp\\GreaterOrEqual $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\GreaterOrEqual::class, $node->left, ' >= ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Smaller(BinaryOp\\Smaller $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Smaller::class, $node->left, ' < ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_SmallerOrEqual(BinaryOp\\SmallerOrEqual $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\SmallerOrEqual::class, $node->left, ' <= ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Coalesce(BinaryOp\\Coalesce $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pInfixOp(BinaryOp\\Coalesce::class, $node->left, ' ?? ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BinaryOp_Pipe(BinaryOp\\Pipe $node, int $precedence, int $lhsPrecedence): string {\n        if ($node->right instanceof Expr\\ArrowFunction) {\n            // Force parentheses around arrow functions.\n            $lhsPrecedence = $this->precedenceMap[Expr\\ArrowFunction::class][0];\n        }\n        return $this->pInfixOp(BinaryOp\\Pipe::class, $node->left, ' |> ', $node->right, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Instanceof(Expr\\Instanceof_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPostfixOp(\n            Expr\\Instanceof_::class, $node->expr,\n            ' instanceof ' . $this->pNewOperand($node->class),\n            $precedence, $lhsPrecedence);\n    }\n\n    // Unary expressions\n\n    protected function pExpr_BooleanNot(Expr\\BooleanNot $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\BooleanNot::class, '!', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_BitwiseNot(Expr\\BitwiseNot $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\BitwiseNot::class, '~', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_UnaryMinus(Expr\\UnaryMinus $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\UnaryMinus::class, '-', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_UnaryPlus(Expr\\UnaryPlus $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\UnaryPlus::class, '+', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_PreInc(Expr\\PreInc $node): string {\n        return '++' . $this->p($node->var);\n    }\n\n    protected function pExpr_PreDec(Expr\\PreDec $node): string {\n        return '--' . $this->p($node->var);\n    }\n\n    protected function pExpr_PostInc(Expr\\PostInc $node): string {\n        return $this->p($node->var) . '++';\n    }\n\n    protected function pExpr_PostDec(Expr\\PostDec $node): string {\n        return $this->p($node->var) . '--';\n    }\n\n    protected function pExpr_ErrorSuppress(Expr\\ErrorSuppress $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\ErrorSuppress::class, '@', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_YieldFrom(Expr\\YieldFrom $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\YieldFrom::class, 'yield from ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Print(Expr\\Print_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\Print_::class, 'print ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    // Casts\n\n    protected function pExpr_Cast_Int(Cast\\Int_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Cast\\Int_::class, '(int) ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Cast_Double(Cast\\Double $node, int $precedence, int $lhsPrecedence): string {\n        $kind = $node->getAttribute('kind', Cast\\Double::KIND_DOUBLE);\n        if ($kind === Cast\\Double::KIND_DOUBLE) {\n            $cast = '(double)';\n        } elseif ($kind === Cast\\Double::KIND_FLOAT) {\n            $cast = '(float)';\n        } else {\n            assert($kind === Cast\\Double::KIND_REAL);\n            $cast = '(real)';\n        }\n        return $this->pPrefixOp(Cast\\Double::class, $cast . ' ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Cast_String(Cast\\String_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Cast\\String_::class, '(string) ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Cast_Array(Cast\\Array_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Cast\\Array_::class, '(array) ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Cast_Object(Cast\\Object_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Cast\\Object_::class, '(object) ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Cast_Bool(Cast\\Bool_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Cast\\Bool_::class, '(bool) ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Cast_Unset(Cast\\Unset_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Cast\\Unset_::class, '(unset) ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Cast_Void(Cast\\Void_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Cast\\Void_::class, '(void) ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    // Function calls and similar constructs\n\n    protected function pExpr_FuncCall(Expr\\FuncCall $node): string {\n        return $this->pCallLhs($node->name)\n             . '(' . $this->pMaybeMultiline($node->args) . ')';\n    }\n\n    protected function pExpr_MethodCall(Expr\\MethodCall $node): string {\n        return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name)\n             . '(' . $this->pMaybeMultiline($node->args) . ')';\n    }\n\n    protected function pExpr_NullsafeMethodCall(Expr\\NullsafeMethodCall $node): string {\n        return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name)\n            . '(' . $this->pMaybeMultiline($node->args) . ')';\n    }\n\n    protected function pExpr_StaticCall(Expr\\StaticCall $node): string {\n        return $this->pStaticDereferenceLhs($node->class) . '::'\n             . ($node->name instanceof Expr\n                ? ($node->name instanceof Expr\\Variable\n                   ? $this->p($node->name)\n                   : '{' . $this->p($node->name) . '}')\n                : $node->name)\n             . '(' . $this->pMaybeMultiline($node->args) . ')';\n    }\n\n    protected function pExpr_Empty(Expr\\Empty_ $node): string {\n        return 'empty(' . $this->p($node->expr) . ')';\n    }\n\n    protected function pExpr_Isset(Expr\\Isset_ $node): string {\n        return 'isset(' . $this->pCommaSeparated($node->vars) . ')';\n    }\n\n    protected function pExpr_Eval(Expr\\Eval_ $node): string {\n        return 'eval(' . $this->p($node->expr) . ')';\n    }\n\n    protected function pExpr_Include(Expr\\Include_ $node, int $precedence, int $lhsPrecedence): string {\n        static $map = [\n            Expr\\Include_::TYPE_INCLUDE      => 'include',\n            Expr\\Include_::TYPE_INCLUDE_ONCE => 'include_once',\n            Expr\\Include_::TYPE_REQUIRE      => 'require',\n            Expr\\Include_::TYPE_REQUIRE_ONCE => 'require_once',\n        ];\n\n        return $this->pPrefixOp(Expr\\Include_::class, $map[$node->type] . ' ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_List(Expr\\List_ $node): string {\n        $syntax = $node->getAttribute('kind',\n            $this->phpVersion->supportsShortArrayDestructuring() ? Expr\\List_::KIND_ARRAY : Expr\\List_::KIND_LIST);\n        if ($syntax === Expr\\List_::KIND_ARRAY) {\n            return '[' . $this->pMaybeMultiline($node->items, true) . ']';\n        } else {\n            return 'list(' . $this->pMaybeMultiline($node->items, true) . ')';\n        }\n    }\n\n    // Other\n\n    protected function pExpr_Error(Expr\\Error $node): string {\n        throw new \\LogicException('Cannot pretty-print AST with Error nodes');\n    }\n\n    protected function pExpr_Variable(Expr\\Variable $node): string {\n        if ($node->name instanceof Expr) {\n            return '${' . $this->p($node->name) . '}';\n        } else {\n            return '$' . $node->name;\n        }\n    }\n\n    protected function pExpr_Array(Expr\\Array_ $node): string {\n        $syntax = $node->getAttribute('kind',\n            $this->shortArraySyntax ? Expr\\Array_::KIND_SHORT : Expr\\Array_::KIND_LONG);\n        if ($syntax === Expr\\Array_::KIND_SHORT) {\n            return '[' . $this->pMaybeMultiline($node->items, true) . ']';\n        } else {\n            return 'array(' . $this->pMaybeMultiline($node->items, true) . ')';\n        }\n    }\n\n    protected function pKey(?Node $node): string {\n        if ($node === null) {\n            return '';\n        }\n\n        // => is not really an operator and does not typically participate in precedence resolution.\n        // However, there is an exception if yield expressions with keys are involved:\n        // [yield $a => $b] is interpreted as [(yield $a => $b)], so we need to ensure that\n        // [(yield $a) => $b] is printed with parentheses. We approximate this by lowering the LHS\n        // precedence to that of yield (which will also print unnecessary parentheses for rare low\n        // precedence unary operators like include).\n        $yieldPrecedence = $this->precedenceMap[Expr\\Yield_::class][0];\n        return $this->p($node, self::MAX_PRECEDENCE, $yieldPrecedence) . ' => ';\n    }\n\n    protected function pArrayItem(Node\\ArrayItem $node): string {\n        return $this->pKey($node->key)\n             . ($node->byRef ? '&' : '')\n             . ($node->unpack ? '...' : '')\n             . $this->p($node->value);\n    }\n\n    protected function pExpr_ArrayDimFetch(Expr\\ArrayDimFetch $node): string {\n        return $this->pDereferenceLhs($node->var)\n             . '[' . (null !== $node->dim ? $this->p($node->dim) : '') . ']';\n    }\n\n    protected function pExpr_ConstFetch(Expr\\ConstFetch $node): string {\n        return $this->p($node->name);\n    }\n\n    protected function pExpr_ClassConstFetch(Expr\\ClassConstFetch $node): string {\n        return $this->pStaticDereferenceLhs($node->class) . '::' . $this->pObjectProperty($node->name);\n    }\n\n    protected function pExpr_PropertyFetch(Expr\\PropertyFetch $node): string {\n        return $this->pDereferenceLhs($node->var) . '->' . $this->pObjectProperty($node->name);\n    }\n\n    protected function pExpr_NullsafePropertyFetch(Expr\\NullsafePropertyFetch $node): string {\n        return $this->pDereferenceLhs($node->var) . '?->' . $this->pObjectProperty($node->name);\n    }\n\n    protected function pExpr_StaticPropertyFetch(Expr\\StaticPropertyFetch $node): string {\n        return $this->pStaticDereferenceLhs($node->class) . '::$' . $this->pObjectProperty($node->name);\n    }\n\n    protected function pExpr_ShellExec(Expr\\ShellExec $node): string {\n        return '`' . $this->pEncapsList($node->parts, '`') . '`';\n    }\n\n    protected function pExpr_Closure(Expr\\Closure $node): string {\n        return $this->pAttrGroups($node->attrGroups, true)\n             . $this->pStatic($node->static)\n             . 'function ' . ($node->byRef ? '&' : '')\n             . '(' . $this->pParams($node->params) . ')'\n             . (!empty($node->uses) ? ' use (' . $this->pCommaSeparated($node->uses) . ')' : '')\n             . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '')\n             . ' {' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pExpr_Match(Expr\\Match_ $node): string {\n        return 'match (' . $this->p($node->cond) . ') {'\n            . $this->pCommaSeparatedMultiline($node->arms, true)\n            . $this->nl\n            . '}';\n    }\n\n    protected function pMatchArm(Node\\MatchArm $node): string {\n        $result = '';\n        if ($node->conds) {\n            for ($i = 0, $c = \\count($node->conds); $i + 1 < $c; $i++) {\n                $result .= $this->p($node->conds[$i]) . ', ';\n            }\n            $result .= $this->pKey($node->conds[$i]);\n        } else {\n            $result = 'default => ';\n        }\n        return $result . $this->p($node->body);\n    }\n\n    protected function pExpr_ArrowFunction(Expr\\ArrowFunction $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(\n            Expr\\ArrowFunction::class,\n            $this->pAttrGroups($node->attrGroups, true)\n            . $this->pStatic($node->static)\n            . 'fn' . ($node->byRef ? '&' : '')\n            . '(' . $this->pParams($node->params) . ')'\n            . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '')\n            . ' => ',\n            $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pClosureUse(Node\\ClosureUse $node): string {\n        return ($node->byRef ? '&' : '') . $this->p($node->var);\n    }\n\n    protected function pExpr_New(Expr\\New_ $node): string {\n        if ($node->class instanceof Stmt\\Class_) {\n            $args = $node->args ? '(' . $this->pMaybeMultiline($node->args) . ')' : '';\n            return 'new ' . $this->pClassCommon($node->class, $args);\n        }\n        return 'new ' . $this->pNewOperand($node->class)\n            . '(' . $this->pMaybeMultiline($node->args) . ')';\n    }\n\n    protected function pExpr_Clone(Expr\\Clone_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\Clone_::class, 'clone ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Ternary(Expr\\Ternary $node, int $precedence, int $lhsPrecedence): string {\n        // a bit of cheating: we treat the ternary as a binary op where the ?...: part is the operator.\n        // this is okay because the part between ? and : never needs parentheses.\n        return $this->pInfixOp(Expr\\Ternary::class,\n            $node->cond, ' ?' . (null !== $node->if ? ' ' . $this->p($node->if) . ' ' : '') . ': ', $node->else,\n            $precedence, $lhsPrecedence\n        );\n    }\n\n    protected function pExpr_Exit(Expr\\Exit_ $node): string {\n        $kind = $node->getAttribute('kind', Expr\\Exit_::KIND_DIE);\n        return ($kind === Expr\\Exit_::KIND_EXIT ? 'exit' : 'die')\n             . (null !== $node->expr ? '(' . $this->p($node->expr) . ')' : '');\n    }\n\n    protected function pExpr_Throw(Expr\\Throw_ $node, int $precedence, int $lhsPrecedence): string {\n        return $this->pPrefixOp(Expr\\Throw_::class, 'throw ', $node->expr, $precedence, $lhsPrecedence);\n    }\n\n    protected function pExpr_Yield(Expr\\Yield_ $node, int $precedence, int $lhsPrecedence): string {\n        if ($node->value === null) {\n            $opPrecedence = $this->precedenceMap[Expr\\Yield_::class][0];\n            return $opPrecedence >= $lhsPrecedence ? '(yield)' : 'yield';\n        } else {\n            if (!$this->phpVersion->supportsYieldWithoutParentheses()) {\n                return '(yield ' . $this->pKey($node->key) . $this->p($node->value) . ')';\n            }\n            return $this->pPrefixOp(\n                Expr\\Yield_::class, 'yield ' . $this->pKey($node->key),\n                $node->value, $precedence, $lhsPrecedence);\n        }\n    }\n\n    // Declarations\n\n    protected function pStmt_Namespace(Stmt\\Namespace_ $node): string {\n        if ($this->canUseSemicolonNamespaces) {\n            return 'namespace ' . $this->p($node->name) . ';'\n                 . $this->nl . $this->pStmts($node->stmts, false);\n        } else {\n            return 'namespace' . (null !== $node->name ? ' ' . $this->p($node->name) : '')\n                 . ' {' . $this->pStmts($node->stmts) . $this->nl . '}';\n        }\n    }\n\n    protected function pStmt_Use(Stmt\\Use_ $node): string {\n        return 'use ' . $this->pUseType($node->type)\n             . $this->pCommaSeparated($node->uses) . ';';\n    }\n\n    protected function pStmt_GroupUse(Stmt\\GroupUse $node): string {\n        return 'use ' . $this->pUseType($node->type) . $this->pName($node->prefix)\n             . '\\{' . $this->pCommaSeparated($node->uses) . '};';\n    }\n\n    protected function pUseItem(Node\\UseItem $node): string {\n        return $this->pUseType($node->type) . $this->p($node->name)\n             . (null !== $node->alias ? ' as ' . $node->alias : '');\n    }\n\n    protected function pUseType(int $type): string {\n        return $type === Stmt\\Use_::TYPE_FUNCTION ? 'function '\n            : ($type === Stmt\\Use_::TYPE_CONSTANT ? 'const ' : '');\n    }\n\n    protected function pStmt_Interface(Stmt\\Interface_ $node): string {\n        return $this->pAttrGroups($node->attrGroups)\n             . 'interface ' . $node->name\n             . (!empty($node->extends) ? ' extends ' . $this->pCommaSeparated($node->extends) : '')\n             . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_Enum(Stmt\\Enum_ $node): string {\n        return $this->pAttrGroups($node->attrGroups)\n             . 'enum ' . $node->name\n             . ($node->scalarType ? ' : ' . $this->p($node->scalarType) : '')\n             . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '')\n             . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_Class(Stmt\\Class_ $node): string {\n        return $this->pClassCommon($node, ' ' . $node->name);\n    }\n\n    protected function pStmt_Trait(Stmt\\Trait_ $node): string {\n        return $this->pAttrGroups($node->attrGroups)\n             . 'trait ' . $node->name\n             . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_EnumCase(Stmt\\EnumCase $node): string {\n        return $this->pAttrGroups($node->attrGroups)\n             . 'case ' . $node->name\n             . ($node->expr ? ' = ' . $this->p($node->expr) : '')\n             . ';';\n    }\n\n    protected function pStmt_TraitUse(Stmt\\TraitUse $node): string {\n        return 'use ' . $this->pCommaSeparated($node->traits)\n             . (empty($node->adaptations)\n                ? ';'\n                : ' {' . $this->pStmts($node->adaptations) . $this->nl . '}');\n    }\n\n    protected function pStmt_TraitUseAdaptation_Precedence(Stmt\\TraitUseAdaptation\\Precedence $node): string {\n        return $this->p($node->trait) . '::' . $node->method\n             . ' insteadof ' . $this->pCommaSeparated($node->insteadof) . ';';\n    }\n\n    protected function pStmt_TraitUseAdaptation_Alias(Stmt\\TraitUseAdaptation\\Alias $node): string {\n        return (null !== $node->trait ? $this->p($node->trait) . '::' : '')\n             . $node->method . ' as'\n             . (null !== $node->newModifier ? ' ' . rtrim($this->pModifiers($node->newModifier), ' ') : '')\n             . (null !== $node->newName ? ' ' . $node->newName : '')\n             . ';';\n    }\n\n    protected function pStmt_Property(Stmt\\Property $node): string {\n        return $this->pAttrGroups($node->attrGroups)\n            . (0 === $node->flags ? 'var ' : $this->pModifiers($node->flags))\n            . ($node->type ? $this->p($node->type) . ' ' : '')\n            . $this->pCommaSeparated($node->props)\n            . ($node->hooks ? ' {' . $this->pStmts($node->hooks) . $this->nl . '}' : ';');\n    }\n\n    protected function pPropertyItem(Node\\PropertyItem $node): string {\n        return '$' . $node->name\n             . (null !== $node->default ? ' = ' . $this->p($node->default) : '');\n    }\n\n    protected function pPropertyHook(Node\\PropertyHook $node): string {\n        return $this->pAttrGroups($node->attrGroups)\n             . $this->pModifiers($node->flags)\n             . ($node->byRef ? '&' : '') . $node->name\n             . ($node->params ? '(' . $this->pParams($node->params) . ')' : '')\n             . (\\is_array($node->body) ? ' {' . $this->pStmts($node->body) . $this->nl . '}'\n                : ($node->body !== null ? ' => ' . $this->p($node->body) : '') . ';');\n    }\n\n    protected function pStmt_ClassMethod(Stmt\\ClassMethod $node): string {\n        return $this->pAttrGroups($node->attrGroups)\n             . $this->pModifiers($node->flags)\n             . 'function ' . ($node->byRef ? '&' : '') . $node->name\n             . '(' . $this->pParams($node->params) . ')'\n             . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '')\n             . (null !== $node->stmts\n                ? $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}'\n                : ';');\n    }\n\n    protected function pStmt_ClassConst(Stmt\\ClassConst $node): string {\n        return $this->pAttrGroups($node->attrGroups)\n             . $this->pModifiers($node->flags)\n             . 'const '\n             . (null !== $node->type ? $this->p($node->type) . ' ' : '')\n             . $this->pCommaSeparated($node->consts) . ';';\n    }\n\n    protected function pStmt_Function(Stmt\\Function_ $node): string {\n        return $this->pAttrGroups($node->attrGroups)\n             . 'function ' . ($node->byRef ? '&' : '') . $node->name\n             . '(' . $this->pParams($node->params) . ')'\n             . (null !== $node->returnType ? ': ' . $this->p($node->returnType) : '')\n             . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_Const(Stmt\\Const_ $node): string {\n        return $this->pAttrGroups($node->attrGroups)\n            . 'const '\n            . $this->pCommaSeparated($node->consts) . ';';\n    }\n\n    protected function pStmt_Declare(Stmt\\Declare_ $node): string {\n        return 'declare (' . $this->pCommaSeparated($node->declares) . ')'\n             . (null !== $node->stmts ? ' {' . $this->pStmts($node->stmts) . $this->nl . '}' : ';');\n    }\n\n    protected function pDeclareItem(Node\\DeclareItem $node): string {\n        return $node->key . '=' . $this->p($node->value);\n    }\n\n    // Control flow\n\n    protected function pStmt_If(Stmt\\If_ $node): string {\n        return 'if (' . $this->p($node->cond) . ') {'\n             . $this->pStmts($node->stmts) . $this->nl . '}'\n             . ($node->elseifs ? ' ' . $this->pImplode($node->elseifs, ' ') : '')\n             . (null !== $node->else ? ' ' . $this->p($node->else) : '');\n    }\n\n    protected function pStmt_ElseIf(Stmt\\ElseIf_ $node): string {\n        return 'elseif (' . $this->p($node->cond) . ') {'\n             . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_Else(Stmt\\Else_ $node): string {\n        if (\\count($node->stmts) === 1 && $node->stmts[0] instanceof Stmt\\If_) {\n            // Print as \"else if\" rather than \"else { if }\"\n            return 'else ' . $this->p($node->stmts[0]);\n        }\n        return 'else {' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_For(Stmt\\For_ $node): string {\n        return 'for ('\n             . $this->pCommaSeparated($node->init) . ';' . (!empty($node->cond) ? ' ' : '')\n             . $this->pCommaSeparated($node->cond) . ';' . (!empty($node->loop) ? ' ' : '')\n             . $this->pCommaSeparated($node->loop)\n             . ') {' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_Foreach(Stmt\\Foreach_ $node): string {\n        return 'foreach (' . $this->p($node->expr) . ' as '\n             . (null !== $node->keyVar ? $this->p($node->keyVar) . ' => ' : '')\n             . ($node->byRef ? '&' : '') . $this->p($node->valueVar) . ') {'\n             . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_While(Stmt\\While_ $node): string {\n        return 'while (' . $this->p($node->cond) . ') {'\n             . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_Do(Stmt\\Do_ $node): string {\n        return 'do {' . $this->pStmts($node->stmts) . $this->nl\n             . '} while (' . $this->p($node->cond) . ');';\n    }\n\n    protected function pStmt_Switch(Stmt\\Switch_ $node): string {\n        return 'switch (' . $this->p($node->cond) . ') {'\n             . $this->pStmts($node->cases) . $this->nl . '}';\n    }\n\n    protected function pStmt_Case(Stmt\\Case_ $node): string {\n        return (null !== $node->cond ? 'case ' . $this->p($node->cond) : 'default') . ':'\n             . $this->pStmts($node->stmts);\n    }\n\n    protected function pStmt_TryCatch(Stmt\\TryCatch $node): string {\n        return 'try {' . $this->pStmts($node->stmts) . $this->nl . '}'\n             . ($node->catches ? ' ' . $this->pImplode($node->catches, ' ') : '')\n             . ($node->finally !== null ? ' ' . $this->p($node->finally) : '');\n    }\n\n    protected function pStmt_Catch(Stmt\\Catch_ $node): string {\n        return 'catch (' . $this->pImplode($node->types, '|')\n             . ($node->var !== null ? ' ' . $this->p($node->var) : '')\n             . ') {' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_Finally(Stmt\\Finally_ $node): string {\n        return 'finally {' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pStmt_Break(Stmt\\Break_ $node): string {\n        return 'break' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';';\n    }\n\n    protected function pStmt_Continue(Stmt\\Continue_ $node): string {\n        return 'continue' . ($node->num !== null ? ' ' . $this->p($node->num) : '') . ';';\n    }\n\n    protected function pStmt_Return(Stmt\\Return_ $node): string {\n        return 'return' . (null !== $node->expr ? ' ' . $this->p($node->expr) : '') . ';';\n    }\n\n    protected function pStmt_Label(Stmt\\Label $node): string {\n        return $node->name . ':';\n    }\n\n    protected function pStmt_Goto(Stmt\\Goto_ $node): string {\n        return 'goto ' . $node->name . ';';\n    }\n\n    // Other\n\n    protected function pStmt_Expression(Stmt\\Expression $node): string {\n        return $this->p($node->expr) . ';';\n    }\n\n    protected function pStmt_Echo(Stmt\\Echo_ $node): string {\n        return 'echo ' . $this->pCommaSeparated($node->exprs) . ';';\n    }\n\n    protected function pStmt_Static(Stmt\\Static_ $node): string {\n        return 'static ' . $this->pCommaSeparated($node->vars) . ';';\n    }\n\n    protected function pStmt_Global(Stmt\\Global_ $node): string {\n        return 'global ' . $this->pCommaSeparated($node->vars) . ';';\n    }\n\n    protected function pStaticVar(Node\\StaticVar $node): string {\n        return $this->p($node->var)\n             . (null !== $node->default ? ' = ' . $this->p($node->default) : '');\n    }\n\n    protected function pStmt_Unset(Stmt\\Unset_ $node): string {\n        return 'unset(' . $this->pCommaSeparated($node->vars) . ');';\n    }\n\n    protected function pStmt_InlineHTML(Stmt\\InlineHTML $node): string {\n        $newline = $node->getAttribute('hasLeadingNewline', true) ? $this->newline : '';\n        return '?>' . $newline . $node->value . '<?php ';\n    }\n\n    protected function pStmt_HaltCompiler(Stmt\\HaltCompiler $node): string {\n        return '__halt_compiler();' . $node->remaining;\n    }\n\n    protected function pStmt_Nop(Stmt\\Nop $node): string {\n        return '';\n    }\n\n    protected function pStmt_Block(Stmt\\Block $node): string {\n        return '{' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    // Helpers\n\n    protected function pClassCommon(Stmt\\Class_ $node, string $afterClassToken): string {\n        return $this->pAttrGroups($node->attrGroups, $node->name === null)\n            . $this->pModifiers($node->flags)\n            . 'class' . $afterClassToken\n            . (null !== $node->extends ? ' extends ' . $this->p($node->extends) : '')\n            . (!empty($node->implements) ? ' implements ' . $this->pCommaSeparated($node->implements) : '')\n            . $this->nl . '{' . $this->pStmts($node->stmts) . $this->nl . '}';\n    }\n\n    protected function pObjectProperty(Node $node): string {\n        if ($node instanceof Expr) {\n            return '{' . $this->p($node) . '}';\n        } else {\n            assert($node instanceof Node\\Identifier);\n            return $node->name;\n        }\n    }\n\n    /** @param (Expr|Node\\InterpolatedStringPart)[] $encapsList */\n    protected function pEncapsList(array $encapsList, ?string $quote): string {\n        $return = '';\n        foreach ($encapsList as $element) {\n            if ($element instanceof Node\\InterpolatedStringPart) {\n                $return .= $this->escapeString($element->value, $quote);\n            } else {\n                $return .= '{' . $this->p($element) . '}';\n            }\n        }\n\n        return $return;\n    }\n\n    protected function pSingleQuotedString(string $string): string {\n        // It is idiomatic to only escape backslashes when necessary, i.e. when followed by ', \\ or\n        // the end of the string ('Foo\\Bar' instead of 'Foo\\\\Bar'). However, we also don't want to\n        // produce an odd number of backslashes, so '\\\\\\\\a' should not get rendered as '\\\\\\a', even\n        // though that would be legal.\n        $regex = '/\\'|\\\\\\\\(?=[\\'\\\\\\\\]|$)|(?<=\\\\\\\\)\\\\\\\\/';\n        return '\\'' . preg_replace($regex, '\\\\\\\\$0', $string) . '\\'';\n    }\n\n    protected function escapeString(string $string, ?string $quote): string {\n        if (null === $quote) {\n            // For doc strings, don't escape newlines\n            $escaped = addcslashes($string, \"\\t\\f\\v$\\\\\");\n            // But do escape isolated \\r. Combined with the terminating newline, it might get\n            // interpreted as \\r\\n and dropped from the string contents.\n            $escaped = preg_replace('/\\r(?!\\n)/', '\\\\r', $escaped);\n            if ($this->phpVersion->supportsFlexibleHeredoc()) {\n                $escaped = $this->indentString($escaped);\n            }\n        } else {\n            $escaped = addcslashes($string, \"\\n\\r\\t\\f\\v$\" . $quote . \"\\\\\");\n        }\n\n        // Escape control characters and non-UTF-8 characters.\n        // Regex based on https://stackoverflow.com/a/11709412/385378.\n        $regex = '/(\n              [\\x00-\\x08\\x0E-\\x1F] # Control characters\n            | [\\xC0-\\xC1] # Invalid UTF-8 Bytes\n            | [\\xF5-\\xFF] # Invalid UTF-8 Bytes\n            | \\xE0(?=[\\x80-\\x9F]) # Overlong encoding of prior code point\n            | \\xF0(?=[\\x80-\\x8F]) # Overlong encoding of prior code point\n            | [\\xC2-\\xDF](?![\\x80-\\xBF]) # Invalid UTF-8 Sequence Start\n            | [\\xE0-\\xEF](?![\\x80-\\xBF]{2}) # Invalid UTF-8 Sequence Start\n            | [\\xF0-\\xF4](?![\\x80-\\xBF]{3}) # Invalid UTF-8 Sequence Start\n            | (?<=[\\x00-\\x7F\\xF5-\\xFF])[\\x80-\\xBF] # Invalid UTF-8 Sequence Middle\n            | (?<![\\xC2-\\xDF]|[\\xE0-\\xEF]|[\\xE0-\\xEF][\\x80-\\xBF]|[\\xF0-\\xF4]|[\\xF0-\\xF4][\\x80-\\xBF]|[\\xF0-\\xF4][\\x80-\\xBF]{2})[\\x80-\\xBF] # Overlong Sequence\n            | (?<=[\\xE0-\\xEF])[\\x80-\\xBF](?![\\x80-\\xBF]) # Short 3 byte sequence\n            | (?<=[\\xF0-\\xF4])[\\x80-\\xBF](?![\\x80-\\xBF]{2}) # Short 4 byte sequence\n            | (?<=[\\xF0-\\xF4][\\x80-\\xBF])[\\x80-\\xBF](?![\\x80-\\xBF]) # Short 4 byte sequence (2)\n        )/x';\n        return preg_replace_callback($regex, function ($matches): string {\n            assert(strlen($matches[0]) === 1);\n            $hex = dechex(ord($matches[0]));\n            return '\\\\x' . str_pad($hex, 2, '0', \\STR_PAD_LEFT);\n        }, $escaped);\n    }\n\n    protected function containsEndLabel(string $string, string $label, bool $atStart = true): bool {\n        $start = $atStart ? '(?:^|[\\r\\n])[ \\t]*' : '[\\r\\n][ \\t]*';\n        return false !== strpos($string, $label)\n            && preg_match('/' . $start . $label . '(?:$|[^_A-Za-z0-9\\x80-\\xff])/', $string);\n    }\n\n    /** @param (Expr|Node\\InterpolatedStringPart)[] $parts */\n    protected function encapsedContainsEndLabel(array $parts, string $label): bool {\n        foreach ($parts as $i => $part) {\n            if ($part instanceof Node\\InterpolatedStringPart\n                && $this->containsEndLabel($this->escapeString($part->value, null), $label, $i === 0)\n            ) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    protected function pDereferenceLhs(Node $node): string {\n        if (!$this->dereferenceLhsRequiresParens($node)) {\n            return $this->p($node);\n        } else {\n            return '(' . $this->p($node) . ')';\n        }\n    }\n\n    protected function pStaticDereferenceLhs(Node $node): string {\n        if (!$this->staticDereferenceLhsRequiresParens($node)) {\n            return $this->p($node);\n        } else {\n            return '(' . $this->p($node) . ')';\n        }\n    }\n\n    protected function pCallLhs(Node $node): string {\n        if (!$this->callLhsRequiresParens($node)) {\n            return $this->p($node);\n        } else {\n            return '(' . $this->p($node) . ')';\n        }\n    }\n\n    protected function pNewOperand(Node $node): string {\n        if (!$this->newOperandRequiresParens($node)) {\n            return $this->p($node);\n        } else {\n            return '(' . $this->p($node) . ')';\n        }\n    }\n\n    /**\n     * @param Node[] $nodes\n     */\n    protected function hasNodeWithComments(array $nodes): bool {\n        foreach ($nodes as $node) {\n            if ($node && $node->getComments()) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /** @param Node[] $nodes */\n    protected function pMaybeMultiline(array $nodes, bool $trailingComma = false): string {\n        if (!$this->hasNodeWithComments($nodes)) {\n            return $this->pCommaSeparated($nodes);\n        } else {\n            return $this->pCommaSeparatedMultiline($nodes, $trailingComma) . $this->nl;\n        }\n    }\n\n    /** @param Node\\Param[] $params\n     */\n    private function hasParamWithAttributes(array $params): bool {\n        foreach ($params as $param) {\n            if ($param->attrGroups) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    /** @param Node\\Param[] $params */\n    protected function pParams(array $params): string {\n        if ($this->hasNodeWithComments($params) ||\n            ($this->hasParamWithAttributes($params) && !$this->phpVersion->supportsAttributes())\n        ) {\n            return $this->pCommaSeparatedMultiline($params, $this->phpVersion->supportsTrailingCommaInParamList()) . $this->nl;\n        }\n        return $this->pCommaSeparated($params);\n    }\n\n    /** @param Node\\AttributeGroup[] $nodes */\n    protected function pAttrGroups(array $nodes, bool $inline = false): string {\n        $result = '';\n        $sep = $inline ? ' ' : $this->nl;\n        foreach ($nodes as $node) {\n            $result .= $this->p($node) . $sep;\n        }\n\n        return $result;\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/PrettyPrinter.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Expr;\n\ninterface PrettyPrinter {\n    /**\n     * Pretty prints an array of statements.\n     *\n     * @param Node[] $stmts Array of statements\n     *\n     * @return string Pretty printed statements\n     */\n    public function prettyPrint(array $stmts): string;\n\n    /**\n     * Pretty prints an expression.\n     *\n     * @param Expr $node Expression node\n     *\n     * @return string Pretty printed node\n     */\n    public function prettyPrintExpr(Expr $node): string;\n\n    /**\n     * Pretty prints a file of statements (includes the opening <?php tag if it is required).\n     *\n     * @param Node[] $stmts Array of statements\n     *\n     * @return string Pretty printed statements\n     */\n    public function prettyPrintFile(array $stmts): string;\n\n    /**\n     * Perform a format-preserving pretty print of an AST.\n     *\n     * The format preservation is best effort. For some changes to the AST the formatting will not\n     * be preserved (at least not locally).\n     *\n     * In order to use this method a number of prerequisites must be satisfied:\n     *  * The startTokenPos and endTokenPos attributes in the lexer must be enabled.\n     *  * The CloningVisitor must be run on the AST prior to modification.\n     *  * The original tokens must be provided, using the getTokens() method on the lexer.\n     *\n     * @param Node[] $stmts Modified AST with links to original AST\n     * @param Node[] $origStmts Original AST with token offset information\n     * @param Token[] $origTokens Tokens of the original code\n     */\n    public function printFormatPreserving(array $stmts, array $origStmts, array $origTokens): string;\n}\n"
  },
  {
    "path": "lib/PhpParser/PrettyPrinterAbstract.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Internal\\DiffElem;\nuse PhpParser\\Internal\\Differ;\nuse PhpParser\\Internal\\PrintableNewAnonClassNode;\nuse PhpParser\\Internal\\TokenStream;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Expr\\AssignOp;\nuse PhpParser\\Node\\Expr\\BinaryOp;\nuse PhpParser\\Node\\Expr\\Cast;\nuse PhpParser\\Node\\IntersectionType;\nuse PhpParser\\Node\\MatchArm;\nuse PhpParser\\Node\\Param;\nuse PhpParser\\Node\\PropertyHook;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\Node\\UnionType;\n\nabstract class PrettyPrinterAbstract implements PrettyPrinter {\n    protected const FIXUP_PREC_LEFT = 0; // LHS operand affected by precedence\n    protected const FIXUP_PREC_RIGHT = 1; // RHS operand affected by precedence\n    protected const FIXUP_PREC_UNARY = 2; // Only operand affected by precedence\n    protected const FIXUP_CALL_LHS = 3; // LHS of call\n    protected const FIXUP_DEREF_LHS = 4; // LHS of dereferencing operation\n    protected const FIXUP_STATIC_DEREF_LHS = 5; // LHS of static dereferencing operation\n    protected const FIXUP_BRACED_NAME  = 6; // Name operand that may require bracing\n    protected const FIXUP_VAR_BRACED_NAME = 7; // Name operand that may require ${} bracing\n    protected const FIXUP_ENCAPSED = 8; // Encapsed string part\n    protected const FIXUP_NEW = 9; // New/instanceof operand\n\n    protected const MAX_PRECEDENCE = 1000;\n\n    /** @var array<class-string, array{int, int, int}> */\n    protected array $precedenceMap = [\n        // [precedence, precedenceLHS, precedenceRHS]\n        // Where the latter two are the precedences to use for the LHS and RHS of a binary operator,\n        // where 1 is added to one of the sides depending on associativity. This information is not\n        // used for unary operators and set to -1.\n        Expr\\Clone_::class             => [-10,   0,   1],\n        BinaryOp\\Pow::class            => [  0,   0,   1],\n        Expr\\BitwiseNot::class         => [ 10,  -1,  -1],\n        Expr\\UnaryPlus::class          => [ 10,  -1,  -1],\n        Expr\\UnaryMinus::class         => [ 10,  -1,  -1],\n        Cast\\Int_::class               => [ 10,  -1,  -1],\n        Cast\\Double::class             => [ 10,  -1,  -1],\n        Cast\\String_::class            => [ 10,  -1,  -1],\n        Cast\\Array_::class             => [ 10,  -1,  -1],\n        Cast\\Object_::class            => [ 10,  -1,  -1],\n        Cast\\Bool_::class              => [ 10,  -1,  -1],\n        Cast\\Unset_::class             => [ 10,  -1,  -1],\n        Expr\\ErrorSuppress::class      => [ 10,  -1,  -1],\n        Expr\\Instanceof_::class        => [ 20,  -1,  -1],\n        Expr\\BooleanNot::class         => [ 30,  -1,  -1],\n        BinaryOp\\Mul::class            => [ 40,  41,  40],\n        BinaryOp\\Div::class            => [ 40,  41,  40],\n        BinaryOp\\Mod::class            => [ 40,  41,  40],\n        BinaryOp\\Plus::class           => [ 50,  51,  50],\n        BinaryOp\\Minus::class          => [ 50,  51,  50],\n        // FIXME: This precedence is incorrect for PHP 8.\n        BinaryOp\\Concat::class         => [ 50,  51,  50],\n        BinaryOp\\ShiftLeft::class      => [ 60,  61,  60],\n        BinaryOp\\ShiftRight::class     => [ 60,  61,  60],\n        BinaryOp\\Pipe::class           => [ 65,  66,  65],\n        BinaryOp\\Smaller::class        => [ 70,  70,  70],\n        BinaryOp\\SmallerOrEqual::class => [ 70,  70,  70],\n        BinaryOp\\Greater::class        => [ 70,  70,  70],\n        BinaryOp\\GreaterOrEqual::class => [ 70,  70,  70],\n        BinaryOp\\Equal::class          => [ 80,  80,  80],\n        BinaryOp\\NotEqual::class       => [ 80,  80,  80],\n        BinaryOp\\Identical::class      => [ 80,  80,  80],\n        BinaryOp\\NotIdentical::class   => [ 80,  80,  80],\n        BinaryOp\\Spaceship::class      => [ 80,  80,  80],\n        BinaryOp\\BitwiseAnd::class     => [ 90,  91,  90],\n        BinaryOp\\BitwiseXor::class     => [100, 101, 100],\n        BinaryOp\\BitwiseOr::class      => [110, 111, 110],\n        BinaryOp\\BooleanAnd::class     => [120, 121, 120],\n        BinaryOp\\BooleanOr::class      => [130, 131, 130],\n        BinaryOp\\Coalesce::class       => [140, 140, 141],\n        Expr\\Ternary::class            => [150, 150, 150],\n        Expr\\Assign::class             => [160,  -1,  -1],\n        Expr\\AssignRef::class          => [160,  -1,  -1],\n        AssignOp\\Plus::class           => [160,  -1,  -1],\n        AssignOp\\Minus::class          => [160,  -1,  -1],\n        AssignOp\\Mul::class            => [160,  -1,  -1],\n        AssignOp\\Div::class            => [160,  -1,  -1],\n        AssignOp\\Concat::class         => [160,  -1,  -1],\n        AssignOp\\Mod::class            => [160,  -1,  -1],\n        AssignOp\\BitwiseAnd::class     => [160,  -1,  -1],\n        AssignOp\\BitwiseOr::class      => [160,  -1,  -1],\n        AssignOp\\BitwiseXor::class     => [160,  -1,  -1],\n        AssignOp\\ShiftLeft::class      => [160,  -1,  -1],\n        AssignOp\\ShiftRight::class     => [160,  -1,  -1],\n        AssignOp\\Pow::class            => [160,  -1,  -1],\n        AssignOp\\Coalesce::class       => [160,  -1,  -1],\n        Expr\\YieldFrom::class          => [170,  -1,  -1],\n        Expr\\Yield_::class             => [175,  -1,  -1],\n        Expr\\Print_::class             => [180,  -1,  -1],\n        BinaryOp\\LogicalAnd::class     => [190, 191, 190],\n        BinaryOp\\LogicalXor::class     => [200, 201, 200],\n        BinaryOp\\LogicalOr::class      => [210, 211, 210],\n        Expr\\Include_::class           => [220,  -1,  -1],\n        Expr\\ArrowFunction::class      => [230,  -1,  -1],\n        Expr\\Throw_::class             => [240,  -1,  -1],\n        Expr\\Cast\\Void_::class         => [250,  -1,  -1],\n    ];\n\n    /** @var int Current indentation level. */\n    protected int $indentLevel;\n    /** @var string String for single level of indentation */\n    private string $indent;\n    /** @var int Width in spaces to indent by. */\n    private int $indentWidth;\n    /** @var bool Whether to use tab indentation. */\n    private bool $useTabs;\n    /** @var int Width in spaces of one tab. */\n    private int $tabWidth = 4;\n\n    /** @var string Newline style. Does not include current indentation. */\n    protected string $newline;\n    /** @var string Newline including current indentation. */\n    protected string $nl;\n    /** @var string|null Token placed at end of doc string to ensure it is followed by a newline.\n     *                   Null if flexible doc strings are used. */\n    protected ?string $docStringEndToken;\n    /** @var bool Whether semicolon namespaces can be used (i.e. no global namespace is used) */\n    protected bool $canUseSemicolonNamespaces;\n    /** @var bool Whether to use short array syntax if the node specifies no preference */\n    protected bool $shortArraySyntax;\n    /** @var PhpVersion PHP version to target */\n    protected PhpVersion $phpVersion;\n\n    /** @var TokenStream|null Original tokens for use in format-preserving pretty print */\n    protected ?TokenStream $origTokens;\n    /** @var Internal\\Differ<Node> Differ for node lists */\n    protected Differ $nodeListDiffer;\n    /** @var array<string, bool> Map determining whether a certain character is a label character */\n    protected array $labelCharMap;\n    /**\n     * @var array<string, array<string, int>> Map from token classes and subnode names to FIXUP_* constants.\n     *                                        This is used during format-preserving prints to place additional parens/braces if necessary.\n     */\n    protected array $fixupMap;\n    /**\n     * @var array<string, array{left?: int|string, right?: int|string}> Map from \"{$node->getType()}->{$subNode}\"\n     *                                                                  to ['left' => $l, 'right' => $r], where $l and $r specify the token type that needs to be stripped\n     *                                                                  when removing this node.\n     */\n    protected array $removalMap;\n    /**\n     * @var array<string, array{int|string|null, bool, string|null, string|null}> Map from\n     *                                                                            \"{$node->getType()}->{$subNode}\" to [$find, $beforeToken, $extraLeft, $extraRight].\n     *                                                                            $find is an optional token after which the insertion occurs. $extraLeft/Right\n     *                                                                            are optionally added before/after the main insertions.\n     */\n    protected array $insertionMap;\n    /**\n     * @var array<string, string> Map From \"{$class}->{$subNode}\" to string that should be inserted\n     *                            between elements of this list subnode.\n     */\n    protected array $listInsertionMap;\n\n    /**\n     * @var array<string, array{int|string|null, string, string}>\n     */\n    protected array $emptyListInsertionMap;\n    /** @var array<string, array{string, int, int}>\n     *       Map from \"{$class}->{$subNode}\" to [$printFn, $skipToken, $findToken] where $printFn is the function to\n     *       print the modifiers, $skipToken is the token to skip at the start and $findToken is the token before which\n     *       the modifiers should be reprinted. */\n    protected array $modifierChangeMap;\n\n    /**\n     * Creates a pretty printer instance using the given options.\n     *\n     * Supported options:\n     *  * PhpVersion $phpVersion: The PHP version to target (default to PHP 7.4). This option\n     *                            controls compatibility of the generated code with older PHP\n     *                            versions in cases where a simple stylistic choice exists (e.g.\n     *                            array() vs []). It is safe to pretty-print an AST for a newer\n     *                            PHP version while specifying an older target (but the result will\n     *                            of course not be compatible with the older version in that case).\n     *  * string $newline:        The newline style to use. Should be \"\\n\" (default) or \"\\r\\n\".\n     *  * string $indent:         The indentation to use. Should either be all spaces or a single\n     *                            tab. Defaults to four spaces (\"    \").\n     *  * bool $shortArraySyntax: Whether to use [] instead of array() as the default array\n     *                            syntax, if the node does not specify a format. Defaults to whether\n     *                            the phpVersion support short array syntax.\n     *\n     * @param array{\n     *     phpVersion?: PhpVersion, newline?: string, indent?: string, shortArraySyntax?: bool\n     * } $options Dictionary of formatting options\n     */\n    public function __construct(array $options = []) {\n        $this->phpVersion = $options['phpVersion'] ?? PhpVersion::fromComponents(7, 4);\n\n        $this->newline = $options['newline'] ?? \"\\n\";\n        if ($this->newline !== \"\\n\" && $this->newline != \"\\r\\n\") {\n            throw new \\LogicException('Option \"newline\" must be one of \"\\n\" or \"\\r\\n\"');\n        }\n\n        $this->shortArraySyntax =\n            $options['shortArraySyntax'] ?? $this->phpVersion->supportsShortArraySyntax();\n        $this->docStringEndToken =\n            $this->phpVersion->supportsFlexibleHeredoc() ? null : '_DOC_STRING_END_' . mt_rand();\n\n        $this->indent = $indent = $options['indent'] ?? '    ';\n        if ($indent === \"\\t\") {\n            $this->useTabs = true;\n            $this->indentWidth = $this->tabWidth;\n        } elseif ($indent === \\str_repeat(' ', \\strlen($indent))) {\n            $this->useTabs = false;\n            $this->indentWidth = \\strlen($indent);\n        } else {\n            throw new \\LogicException('Option \"indent\" must either be all spaces or a single tab');\n        }\n    }\n\n    /**\n     * Reset pretty printing state.\n     */\n    protected function resetState(): void {\n        $this->indentLevel = 0;\n        $this->nl = $this->newline;\n        $this->origTokens = null;\n    }\n\n    /**\n     * Set indentation level\n     *\n     * @param int $level Level in number of spaces\n     */\n    protected function setIndentLevel(int $level): void {\n        $this->indentLevel = $level;\n        if ($this->useTabs) {\n            $tabs = \\intdiv($level, $this->tabWidth);\n            $spaces = $level % $this->tabWidth;\n            $this->nl = $this->newline . \\str_repeat(\"\\t\", $tabs) . \\str_repeat(' ', $spaces);\n        } else {\n            $this->nl = $this->newline . \\str_repeat(' ', $level);\n        }\n    }\n\n    /**\n     * Increase indentation level.\n     */\n    protected function indent(): void {\n        $this->indentLevel += $this->indentWidth;\n        $this->nl .= $this->indent;\n    }\n\n    /**\n     * Decrease indentation level.\n     */\n    protected function outdent(): void {\n        assert($this->indentLevel >= $this->indentWidth);\n        $this->setIndentLevel($this->indentLevel - $this->indentWidth);\n    }\n\n    /**\n     * Pretty prints an array of statements.\n     *\n     * @param Node[] $stmts Array of statements\n     *\n     * @return string Pretty printed statements\n     */\n    public function prettyPrint(array $stmts): string {\n        $this->resetState();\n        $this->preprocessNodes($stmts);\n\n        return ltrim($this->handleMagicTokens($this->pStmts($stmts, false)));\n    }\n\n    /**\n     * Pretty prints an expression.\n     *\n     * @param Expr $node Expression node\n     *\n     * @return string Pretty printed node\n     */\n    public function prettyPrintExpr(Expr $node): string {\n        $this->resetState();\n        return $this->handleMagicTokens($this->p($node));\n    }\n\n    /**\n     * Pretty prints a file of statements (includes the opening <?php tag if it is required).\n     *\n     * @param Node[] $stmts Array of statements\n     *\n     * @return string Pretty printed statements\n     */\n    public function prettyPrintFile(array $stmts): string {\n        if (!$stmts) {\n            return \"<?php\" . $this->newline . $this->newline;\n        }\n\n        $p = \"<?php\" . $this->newline . $this->newline . $this->prettyPrint($stmts);\n\n        if ($stmts[0] instanceof Stmt\\InlineHTML) {\n            $p = preg_replace('/^<\\?php\\s+\\?>\\r?\\n?/', '', $p);\n        }\n        if ($stmts[count($stmts) - 1] instanceof Stmt\\InlineHTML) {\n            $p = preg_replace('/<\\?php$/', '', rtrim($p));\n        }\n\n        return $p;\n    }\n\n    /**\n     * Preprocesses the top-level nodes to initialize pretty printer state.\n     *\n     * @param Node[] $nodes Array of nodes\n     */\n    protected function preprocessNodes(array $nodes): void {\n        /* We can use semicolon-namespaces unless there is a global namespace declaration */\n        $this->canUseSemicolonNamespaces = true;\n        foreach ($nodes as $node) {\n            if ($node instanceof Stmt\\Namespace_ && null === $node->name) {\n                $this->canUseSemicolonNamespaces = false;\n                break;\n            }\n        }\n    }\n\n    /**\n     * Handles (and removes) doc-string-end tokens.\n     */\n    protected function handleMagicTokens(string $str): string {\n        if ($this->docStringEndToken !== null) {\n            // Replace doc-string-end tokens with nothing or a newline\n            $str = str_replace(\n                $this->docStringEndToken . ';' . $this->newline,\n                ';' . $this->newline,\n                $str);\n            $str = str_replace($this->docStringEndToken, $this->newline, $str);\n        }\n\n        return $str;\n    }\n\n    /**\n     * Pretty prints an array of nodes (statements) and indents them optionally.\n     *\n     * @param Node[] $nodes Array of nodes\n     * @param bool $indent Whether to indent the printed nodes\n     *\n     * @return string Pretty printed statements\n     */\n    protected function pStmts(array $nodes, bool $indent = true): string {\n        if ($indent) {\n            $this->indent();\n        }\n\n        $result = '';\n        foreach ($nodes as $node) {\n            $comments = $node->getComments();\n            if ($comments) {\n                $result .= $this->nl . $this->pComments($comments);\n                if ($node instanceof Stmt\\Nop) {\n                    continue;\n                }\n            }\n\n            $result .= $this->nl . $this->p($node);\n        }\n\n        if ($indent) {\n            $this->outdent();\n        }\n\n        return $result;\n    }\n\n    /**\n     * Pretty-print an infix operation while taking precedence into account.\n     *\n     * @param string $class Node class of operator\n     * @param Node $leftNode Left-hand side node\n     * @param string $operatorString String representation of the operator\n     * @param Node $rightNode Right-hand side node\n     * @param int $precedence Precedence of parent operator\n     * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator\n     *\n     * @return string Pretty printed infix operation\n     */\n    protected function pInfixOp(\n        string $class, Node $leftNode, string $operatorString, Node $rightNode,\n        int $precedence, int $lhsPrecedence\n    ): string {\n        list($opPrecedence, $newPrecedenceLHS, $newPrecedenceRHS) = $this->precedenceMap[$class];\n        $prefix = '';\n        $suffix = '';\n        if ($opPrecedence >= $precedence) {\n            $prefix = '(';\n            $suffix = ')';\n            $lhsPrecedence = self::MAX_PRECEDENCE;\n        }\n        return $prefix . $this->p($leftNode, $newPrecedenceLHS, $newPrecedenceLHS)\n            . $operatorString . $this->p($rightNode, $newPrecedenceRHS, $lhsPrecedence) . $suffix;\n    }\n\n    /**\n     * Pretty-print a prefix operation while taking precedence into account.\n     *\n     * @param string $class Node class of operator\n     * @param string $operatorString String representation of the operator\n     * @param Node $node Node\n     * @param int $precedence Precedence of parent operator\n     * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator\n     *\n     * @return string Pretty printed prefix operation\n     */\n    protected function pPrefixOp(string $class, string $operatorString, Node $node, int $precedence, int $lhsPrecedence): string {\n        $opPrecedence = $this->precedenceMap[$class][0];\n        $prefix = '';\n        $suffix = '';\n        if ($opPrecedence >= $lhsPrecedence) {\n            $prefix = '(';\n            $suffix = ')';\n            $lhsPrecedence = self::MAX_PRECEDENCE;\n        }\n        $printedArg = $this->p($node, $opPrecedence, $lhsPrecedence);\n        if (($operatorString === '+' && $printedArg[0] === '+') ||\n            ($operatorString === '-' && $printedArg[0] === '-')\n        ) {\n            // Avoid printing +(+$a) as ++$a and similar.\n            $printedArg = '(' . $printedArg . ')';\n        }\n        return $prefix . $operatorString . $printedArg . $suffix;\n    }\n\n    /**\n     * Pretty-print a postfix operation while taking precedence into account.\n     *\n     * @param string $class Node class of operator\n     * @param string $operatorString String representation of the operator\n     * @param Node $node Node\n     * @param int $precedence Precedence of parent operator\n     * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator\n     *\n     * @return string Pretty printed postfix operation\n     */\n    protected function pPostfixOp(string $class, Node $node, string $operatorString, int $precedence, int $lhsPrecedence): string {\n        $opPrecedence = $this->precedenceMap[$class][0];\n        $prefix = '';\n        $suffix = '';\n        if ($opPrecedence >= $precedence) {\n            $prefix = '(';\n            $suffix = ')';\n            $lhsPrecedence = self::MAX_PRECEDENCE;\n        }\n        if ($opPrecedence < $lhsPrecedence) {\n            $lhsPrecedence = $opPrecedence;\n        }\n        return $prefix . $this->p($node, $opPrecedence, $lhsPrecedence) . $operatorString . $suffix;\n    }\n\n    /**\n     * Pretty prints an array of nodes and implodes the printed values.\n     *\n     * @param Node[] $nodes Array of Nodes to be printed\n     * @param string $glue Character to implode with\n     *\n     * @return string Imploded pretty printed nodes> $pre\n     */\n    protected function pImplode(array $nodes, string $glue = ''): string {\n        $pNodes = [];\n        foreach ($nodes as $node) {\n            if (null === $node) {\n                $pNodes[] = '';\n            } else {\n                $pNodes[] = $this->p($node);\n            }\n        }\n\n        return implode($glue, $pNodes);\n    }\n\n    /**\n     * Pretty prints an array of nodes and implodes the printed values with commas.\n     *\n     * @param Node[] $nodes Array of Nodes to be printed\n     *\n     * @return string Comma separated pretty printed nodes\n     */\n    protected function pCommaSeparated(array $nodes): string {\n        return $this->pImplode($nodes, ', ');\n    }\n\n    /**\n     * Pretty prints a comma-separated list of nodes in multiline style, including comments.\n     *\n     * The result includes a leading newline and one level of indentation (same as pStmts).\n     *\n     * @param Node[] $nodes Array of Nodes to be printed\n     * @param bool $trailingComma Whether to use a trailing comma\n     *\n     * @return string Comma separated pretty printed nodes in multiline style\n     */\n    protected function pCommaSeparatedMultiline(array $nodes, bool $trailingComma): string {\n        $this->indent();\n\n        $result = '';\n        $lastIdx = count($nodes) - 1;\n        foreach ($nodes as $idx => $node) {\n            if ($node !== null) {\n                $comments = $node->getComments();\n                if ($comments) {\n                    $result .= $this->nl . $this->pComments($comments);\n                }\n\n                $result .= $this->nl . $this->p($node);\n            } else {\n                $result .= $this->nl;\n            }\n            if ($trailingComma || $idx !== $lastIdx) {\n                $result .= ',';\n            }\n        }\n\n        $this->outdent();\n        return $result;\n    }\n\n    /**\n     * Prints reformatted text of the passed comments.\n     *\n     * @param Comment[] $comments List of comments\n     *\n     * @return string Reformatted text of comments\n     */\n    protected function pComments(array $comments): string {\n        $formattedComments = [];\n\n        foreach ($comments as $comment) {\n            $formattedComments[] = str_replace(\"\\n\", $this->nl, $comment->getReformattedText());\n        }\n\n        return implode($this->nl, $formattedComments);\n    }\n\n    /**\n     * Perform a format-preserving pretty print of an AST.\n     *\n     * The format preservation is best effort. For some changes to the AST the formatting will not\n     * be preserved (at least not locally).\n     *\n     * In order to use this method a number of prerequisites must be satisfied:\n     *  * The startTokenPos and endTokenPos attributes in the lexer must be enabled.\n     *  * The CloningVisitor must be run on the AST prior to modification.\n     *  * The original tokens must be provided, using the getTokens() method on the lexer.\n     *\n     * @param Node[] $stmts Modified AST with links to original AST\n     * @param Node[] $origStmts Original AST with token offset information\n     * @param Token[] $origTokens Tokens of the original code\n     */\n    public function printFormatPreserving(array $stmts, array $origStmts, array $origTokens): string {\n        $this->initializeNodeListDiffer();\n        $this->initializeLabelCharMap();\n        $this->initializeFixupMap();\n        $this->initializeRemovalMap();\n        $this->initializeInsertionMap();\n        $this->initializeListInsertionMap();\n        $this->initializeEmptyListInsertionMap();\n        $this->initializeModifierChangeMap();\n\n        $this->resetState();\n        $this->origTokens = new TokenStream($origTokens, $this->tabWidth);\n\n        $this->preprocessNodes($stmts);\n\n        $pos = 0;\n        $result = $this->pArray($stmts, $origStmts, $pos, 0, 'File', 'stmts', null);\n        if (null !== $result) {\n            $result .= $this->origTokens->getTokenCode($pos, count($origTokens) - 1, 0);\n        } else {\n            // Fallback\n            // TODO Add <?php properly\n            $result = \"<?php\" . $this->newline . $this->pStmts($stmts, false);\n        }\n\n        return $this->handleMagicTokens($result);\n    }\n\n    protected function pFallback(Node $node, int $precedence, int $lhsPrecedence): string {\n        return $this->{'p' . $node->getType()}($node, $precedence, $lhsPrecedence);\n    }\n\n    /**\n     * Pretty prints a node.\n     *\n     * This method also handles formatting preservation for nodes.\n     *\n     * @param Node $node Node to be pretty printed\n     * @param int $precedence Precedence of parent operator\n     * @param int $lhsPrecedence Precedence for unary operator on LHS of binary operator\n     * @param bool $parentFormatPreserved Whether parent node has preserved formatting\n     *\n     * @return string Pretty printed node\n     */\n    protected function p(\n        Node $node, int $precedence = self::MAX_PRECEDENCE, int $lhsPrecedence = self::MAX_PRECEDENCE,\n        bool $parentFormatPreserved = false\n    ): string {\n        // No orig tokens means this is a normal pretty print without preservation of formatting\n        if (!$this->origTokens) {\n            return $this->{'p' . $node->getType()}($node, $precedence, $lhsPrecedence);\n        }\n\n        /** @var Node|null $origNode */\n        $origNode = $node->getAttribute('origNode');\n        if (null === $origNode) {\n            return $this->pFallback($node, $precedence, $lhsPrecedence);\n        }\n\n        $class = \\get_class($node);\n        \\assert($class === \\get_class($origNode));\n\n        $startPos = $origNode->getStartTokenPos();\n        $endPos = $origNode->getEndTokenPos();\n        \\assert($startPos >= 0 && $endPos >= 0);\n\n        $fallbackNode = $node;\n        if ($node instanceof Expr\\New_ && $node->class instanceof Stmt\\Class_) {\n            // Normalize node structure of anonymous classes\n            assert($origNode instanceof Expr\\New_);\n            $node = PrintableNewAnonClassNode::fromNewNode($node);\n            $origNode = PrintableNewAnonClassNode::fromNewNode($origNode);\n            $class = PrintableNewAnonClassNode::class;\n        }\n\n        // InlineHTML node does not contain closing and opening PHP tags. If the parent formatting\n        // is not preserved, then we need to use the fallback code to make sure the tags are\n        // printed.\n        if ($node instanceof Stmt\\InlineHTML && !$parentFormatPreserved) {\n            return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence);\n        }\n\n        $indentAdjustment = $this->indentLevel - $this->origTokens->getIndentationBefore($startPos);\n\n        $type = $node->getType();\n        $fixupInfo = $this->fixupMap[$class] ?? null;\n\n        $result = '';\n        $pos = $startPos;\n        foreach ($node->getSubNodeNames() as $subNodeName) {\n            $subNode = $node->$subNodeName;\n            $origSubNode = $origNode->$subNodeName;\n\n            if ((!$subNode instanceof Node && $subNode !== null)\n                || (!$origSubNode instanceof Node && $origSubNode !== null)\n            ) {\n                if ($subNode === $origSubNode) {\n                    // Unchanged, can reuse old code\n                    continue;\n                }\n\n                if (is_array($subNode) && is_array($origSubNode)) {\n                    // Array subnode changed, we might be able to reconstruct it\n                    $listResult = $this->pArray(\n                        $subNode, $origSubNode, $pos, $indentAdjustment, $class, $subNodeName,\n                        $fixupInfo[$subNodeName] ?? null\n                    );\n                    if (null === $listResult) {\n                        return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence);\n                    }\n\n                    $result .= $listResult;\n                    continue;\n                }\n\n                // Check if this is a modifier change\n                $key = $class . '->' . $subNodeName;\n                if (!isset($this->modifierChangeMap[$key])) {\n                    return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence);\n                }\n\n                [$printFn, $skipToken, $findToken] = $this->modifierChangeMap[$key];\n                $skipWSPos = $this->origTokens->skipRight($pos, $skipToken);\n                $result .= $this->origTokens->getTokenCode($pos, $skipWSPos, $indentAdjustment);\n                $result .= $this->$printFn($subNode);\n                $pos = $this->origTokens->findRight($skipWSPos, $findToken);\n                continue;\n            }\n\n            $extraLeft = '';\n            $extraRight = '';\n            if ($origSubNode !== null) {\n                $subStartPos = $origSubNode->getStartTokenPos();\n                $subEndPos = $origSubNode->getEndTokenPos();\n                \\assert($subStartPos >= 0 && $subEndPos >= 0);\n            } else {\n                if ($subNode === null) {\n                    // Both null, nothing to do\n                    continue;\n                }\n\n                // A node has been inserted, check if we have insertion information for it\n                $key = $type . '->' . $subNodeName;\n                if (!isset($this->insertionMap[$key])) {\n                    return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence);\n                }\n\n                list($findToken, $beforeToken, $extraLeft, $extraRight) = $this->insertionMap[$key];\n                if (null !== $findToken) {\n                    $subStartPos = $this->origTokens->findRight($pos, $findToken)\n                        + (int) !$beforeToken;\n                } else {\n                    $subStartPos = $pos;\n                }\n\n                if (null === $extraLeft && null !== $extraRight) {\n                    // If inserting on the right only, skipping whitespace looks better\n                    $subStartPos = $this->origTokens->skipRightWhitespace($subStartPos);\n                }\n                $subEndPos = $subStartPos - 1;\n            }\n\n            if (null === $subNode) {\n                // A node has been removed, check if we have removal information for it\n                $key = $type . '->' . $subNodeName;\n                if (!isset($this->removalMap[$key])) {\n                    return $this->pFallback($fallbackNode, $precedence, $lhsPrecedence);\n                }\n\n                // Adjust positions to account for additional tokens that must be skipped\n                $removalInfo = $this->removalMap[$key];\n                if (isset($removalInfo['left'])) {\n                    $subStartPos = $this->origTokens->skipLeft($subStartPos - 1, $removalInfo['left']) + 1;\n                }\n                if (isset($removalInfo['right'])) {\n                    $subEndPos = $this->origTokens->skipRight($subEndPos + 1, $removalInfo['right']) - 1;\n                }\n            }\n\n            $result .= $this->origTokens->getTokenCode($pos, $subStartPos, $indentAdjustment);\n\n            if (null !== $subNode) {\n                $result .= $extraLeft;\n\n                $origIndentLevel = $this->indentLevel;\n                $this->setIndentLevel(max($this->origTokens->getIndentationBefore($subStartPos) + $indentAdjustment, 0));\n\n                // If it's the same node that was previously in this position, it certainly doesn't\n                // need fixup. It's important to check this here, because our fixup checks are more\n                // conservative than strictly necessary.\n                if (isset($fixupInfo[$subNodeName])\n                    && $subNode->getAttribute('origNode') !== $origSubNode\n                ) {\n                    $fixup = $fixupInfo[$subNodeName];\n                    $res = $this->pFixup($fixup, $subNode, $class, $subStartPos, $subEndPos);\n                } else {\n                    $res = $this->p($subNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true);\n                }\n\n                $this->safeAppend($result, $res);\n                $this->setIndentLevel($origIndentLevel);\n\n                $result .= $extraRight;\n            }\n\n            $pos = $subEndPos + 1;\n        }\n\n        $result .= $this->origTokens->getTokenCode($pos, $endPos + 1, $indentAdjustment);\n        return $result;\n    }\n\n    /**\n     * Perform a format-preserving pretty print of an array.\n     *\n     * @param Node[] $nodes New nodes\n     * @param Node[] $origNodes Original nodes\n     * @param int $pos Current token position (updated by reference)\n     * @param int $indentAdjustment Adjustment for indentation\n     * @param string $parentNodeClass Class of the containing node.\n     * @param string $subNodeName Name of array subnode.\n     * @param null|int $fixup Fixup information for array item nodes\n     *\n     * @return null|string Result of pretty print or null if cannot preserve formatting\n     */\n    protected function pArray(\n        array  $nodes, array $origNodes, int &$pos, int $indentAdjustment,\n        string $parentNodeClass, string $subNodeName, ?int $fixup\n    ): ?string {\n        $diff = $this->nodeListDiffer->diffWithReplacements($origNodes, $nodes);\n\n        $mapKey = $parentNodeClass . '->' . $subNodeName;\n        $insertStr = $this->listInsertionMap[$mapKey] ?? null;\n        $isStmtList = $subNodeName === 'stmts';\n\n        $beforeFirstKeepOrReplace = true;\n        $skipRemovedNode = false;\n        $delayedAdd = [];\n        $lastElemIndentLevel = $this->indentLevel;\n\n        $insertNewline = false;\n        if ($insertStr === \"\\n\") {\n            $insertStr = '';\n            $insertNewline = true;\n        }\n\n        if ($isStmtList && \\count($origNodes) === 1 && \\count($nodes) !== 1) {\n            $startPos = $origNodes[0]->getStartTokenPos();\n            $endPos = $origNodes[0]->getEndTokenPos();\n            \\assert($startPos >= 0 && $endPos >= 0);\n            if (!$this->origTokens->haveBraces($startPos, $endPos)) {\n                // This was a single statement without braces, but either additional statements\n                // have been added, or the single statement has been removed. This requires the\n                // addition of braces. For now fall back.\n                // TODO: Try to preserve formatting\n                return null;\n            }\n        }\n\n        $result = '';\n        foreach ($diff as $i => $diffElem) {\n            $diffType = $diffElem->type;\n            /** @var Node|string|null $arrItem */\n            $arrItem = $diffElem->new;\n            /** @var Node|string|null $origArrItem */\n            $origArrItem = $diffElem->old;\n\n            if ($diffType === DiffElem::TYPE_KEEP || $diffType === DiffElem::TYPE_REPLACE) {\n                $beforeFirstKeepOrReplace = false;\n\n                if ($origArrItem === null || $arrItem === null) {\n                    // We can only handle the case where both are null\n                    if ($origArrItem === $arrItem) {\n                        continue;\n                    }\n                    return null;\n                }\n\n                if (!$arrItem instanceof Node || !$origArrItem instanceof Node) {\n                    // We can only deal with nodes. This can occur for Names, which use string arrays.\n                    return null;\n                }\n\n                $itemStartPos = $origArrItem->getStartTokenPos();\n                $itemEndPos = $origArrItem->getEndTokenPos();\n                \\assert($itemStartPos >= 0 && $itemEndPos >= 0 && $itemStartPos >= $pos);\n\n                $origIndentLevel = $this->indentLevel;\n                $lastElemIndentLevel = max($this->origTokens->getIndentationBefore($itemStartPos) + $indentAdjustment, 0);\n                $this->setIndentLevel($lastElemIndentLevel);\n\n                $comments = $arrItem->getComments();\n                $origComments = $origArrItem->getComments();\n                $commentStartPos = $origComments ? $origComments[0]->getStartTokenPos() : $itemStartPos;\n                \\assert($commentStartPos >= 0);\n\n                if ($commentStartPos < $pos) {\n                    // Comments may be assigned to multiple nodes if they start at the same position.\n                    // Make sure we don't try to print them multiple times.\n                    $commentStartPos = $itemStartPos;\n                }\n\n                if ($skipRemovedNode) {\n                    if ($isStmtList && $this->origTokens->haveTagInRange($pos, $itemStartPos)) {\n                        // We'd remove an opening/closing PHP tag.\n                        // TODO: Preserve formatting.\n                        $this->setIndentLevel($origIndentLevel);\n                        return null;\n                    }\n                } else {\n                    $result .= $this->origTokens->getTokenCode(\n                        $pos, $commentStartPos, $indentAdjustment);\n                }\n\n                if (!empty($delayedAdd)) {\n                    /** @var Node $delayedAddNode */\n                    foreach ($delayedAdd as $delayedAddNode) {\n                        if ($insertNewline) {\n                            $delayedAddComments = $delayedAddNode->getComments();\n                            if ($delayedAddComments) {\n                                $result .= $this->pComments($delayedAddComments) . $this->nl;\n                            }\n                        }\n\n                        $this->safeAppend($result, $this->p($delayedAddNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true));\n\n                        if ($insertNewline) {\n                            $result .= $insertStr . $this->nl;\n                        } else {\n                            $result .= $insertStr;\n                        }\n                    }\n\n                    $delayedAdd = [];\n                }\n\n                if ($comments !== $origComments) {\n                    if ($comments) {\n                        $result .= $this->pComments($comments) . $this->nl;\n                    }\n                } else {\n                    $result .= $this->origTokens->getTokenCode(\n                        $commentStartPos, $itemStartPos, $indentAdjustment);\n                }\n\n                // If we had to remove anything, we have done so now.\n                $skipRemovedNode = false;\n            } elseif ($diffType === DiffElem::TYPE_ADD) {\n                if (null === $insertStr) {\n                    // We don't have insertion information for this list type\n                    return null;\n                }\n\n                if (!$arrItem instanceof Node) {\n                    // We only support list insertion of nodes.\n                    return null;\n                }\n\n                // We go multiline if the original code was multiline,\n                // or if it's an array item with a comment above it.\n                // Match always uses multiline formatting.\n                if ($insertStr === ', ' &&\n                    ($this->isMultiline($origNodes) || $arrItem->getComments() ||\n                     $parentNodeClass === Expr\\Match_::class)\n                ) {\n                    $insertStr = ',';\n                    $insertNewline = true;\n                }\n\n                if ($beforeFirstKeepOrReplace) {\n                    // Will be inserted at the next \"replace\" or \"keep\" element\n                    $delayedAdd[] = $arrItem;\n                    continue;\n                }\n\n                $itemStartPos = $pos;\n                $itemEndPos = $pos - 1;\n\n                $origIndentLevel = $this->indentLevel;\n                $this->setIndentLevel($lastElemIndentLevel);\n\n                if ($insertNewline) {\n                    $result .= $insertStr . $this->nl;\n                    $comments = $arrItem->getComments();\n                    if ($comments) {\n                        $result .= $this->pComments($comments) . $this->nl;\n                    }\n                } else {\n                    $result .= $insertStr;\n                }\n            } elseif ($diffType === DiffElem::TYPE_REMOVE) {\n                if (!$origArrItem instanceof Node) {\n                    // We only support removal for nodes\n                    return null;\n                }\n\n                $itemStartPos = $origArrItem->getStartTokenPos();\n                $itemEndPos = $origArrItem->getEndTokenPos();\n                \\assert($itemStartPos >= 0 && $itemEndPos >= 0);\n\n                // Consider comments part of the node.\n                $origComments = $origArrItem->getComments();\n                if ($origComments) {\n                    $itemStartPos = $origComments[0]->getStartTokenPos();\n                }\n\n                if ($i === 0) {\n                    // If we're removing from the start, keep the tokens before the node and drop those after it,\n                    // instead of the other way around.\n                    $result .= $this->origTokens->getTokenCode(\n                        $pos, $itemStartPos, $indentAdjustment);\n                    $skipRemovedNode = true;\n                } else {\n                    if ($isStmtList && $this->origTokens->haveTagInRange($pos, $itemStartPos)) {\n                        // We'd remove an opening/closing PHP tag.\n                        // TODO: Preserve formatting.\n                        return null;\n                    }\n                }\n\n                $pos = $itemEndPos + 1;\n                continue;\n            } else {\n                throw new \\Exception(\"Shouldn't happen\");\n            }\n\n            if (null !== $fixup && $arrItem->getAttribute('origNode') !== $origArrItem) {\n                $res = $this->pFixup($fixup, $arrItem, null, $itemStartPos, $itemEndPos);\n            } else {\n                $res = $this->p($arrItem, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true);\n            }\n            $this->safeAppend($result, $res);\n\n            $this->setIndentLevel($origIndentLevel);\n            $pos = $itemEndPos + 1;\n        }\n\n        if ($skipRemovedNode) {\n            // TODO: Support removing single node.\n            return null;\n        }\n\n        if (!empty($delayedAdd)) {\n            if (!isset($this->emptyListInsertionMap[$mapKey])) {\n                return null;\n            }\n\n            list($findToken, $extraLeft, $extraRight) = $this->emptyListInsertionMap[$mapKey];\n            if (null !== $findToken) {\n                // For anon classes skip to the class keyword.\n                $isAnonClassArgs = $mapKey === PrintableNewAnonClassNode::class . '->args';\n                if ($isAnonClassArgs) {\n                    $insertPos = $this->origTokens->findRight($pos, \\T_CLASS) + 1;\n                    $result .= $this->origTokens->getTokenCode($pos, $insertPos, $indentAdjustment);\n                    $pos = $insertPos;\n                }\n\n                // If \"new Foo\" was used without arguments, we need to convert to \"new Foo()\".\n                if (($mapKey === Expr\\New_::class . '->args' || $isAnonClassArgs) &&\n                    !$this->origTokens->haveTokenImmediatelyAfter($pos - 1, '(')\n                ) {\n                    $extraLeft = '(';\n                    $extraRight = ')';\n                } else {\n                    $insertPos = $this->origTokens->findRight($pos, $findToken) + 1;\n                    $result .= $this->origTokens->getTokenCode($pos, $insertPos, $indentAdjustment);\n                    $pos = $insertPos;\n                }\n            }\n\n            $first = true;\n            $result .= $extraLeft;\n            foreach ($delayedAdd as $delayedAddNode) {\n                if (!$first) {\n                    $result .= $insertStr;\n                    if ($insertNewline) {\n                        $result .= $this->nl;\n                    }\n                }\n                $result .= $this->p($delayedAddNode, self::MAX_PRECEDENCE, self::MAX_PRECEDENCE, true);\n                $first = false;\n            }\n            $result .= $extraRight === \"\\n\" ? $this->nl : $extraRight;\n        }\n\n        return $result;\n    }\n\n    /**\n     * Print node with fixups.\n     *\n     * Fixups here refer to the addition of extra parentheses, braces or other characters, that\n     * are required to preserve program semantics in a certain context (e.g. to maintain precedence\n     * or because only certain expressions are allowed in certain places).\n     *\n     * @param int $fixup Fixup type\n     * @param Node $subNode Subnode to print\n     * @param string|null $parentClass Class of parent node\n     * @param int $subStartPos Original start pos of subnode\n     * @param int $subEndPos Original end pos of subnode\n     *\n     * @return string Result of fixed-up print of subnode\n     */\n    protected function pFixup(int $fixup, Node $subNode, ?string $parentClass, int $subStartPos, int $subEndPos): string {\n        switch ($fixup) {\n            case self::FIXUP_PREC_LEFT:\n                // We use a conservative approximation where lhsPrecedence == precedence.\n                if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) {\n                    $precedence = $this->precedenceMap[$parentClass][1];\n                    return $this->p($subNode, $precedence, $precedence);\n                }\n                break;\n            case self::FIXUP_PREC_RIGHT:\n                if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) {\n                    $precedence = $this->precedenceMap[$parentClass][2];\n                    return $this->p($subNode, $precedence, $precedence);\n                }\n                break;\n            case self::FIXUP_PREC_UNARY:\n                if (!$this->origTokens->haveParens($subStartPos, $subEndPos)) {\n                    $precedence = $this->precedenceMap[$parentClass][0];\n                    return $this->p($subNode, $precedence, $precedence);\n                }\n                break;\n            case self::FIXUP_CALL_LHS:\n                if ($this->callLhsRequiresParens($subNode)\n                    && !$this->origTokens->haveParens($subStartPos, $subEndPos)\n                ) {\n                    return '(' . $this->p($subNode) . ')';\n                }\n                break;\n            case self::FIXUP_DEREF_LHS:\n                if ($this->dereferenceLhsRequiresParens($subNode)\n                    && !$this->origTokens->haveParens($subStartPos, $subEndPos)\n                ) {\n                    return '(' . $this->p($subNode) . ')';\n                }\n                break;\n            case self::FIXUP_STATIC_DEREF_LHS:\n                if ($this->staticDereferenceLhsRequiresParens($subNode)\n                    && !$this->origTokens->haveParens($subStartPos, $subEndPos)\n                ) {\n                    return '(' . $this->p($subNode) . ')';\n                }\n                break;\n            case self::FIXUP_NEW:\n                if ($this->newOperandRequiresParens($subNode)\n                    && !$this->origTokens->haveParens($subStartPos, $subEndPos)) {\n                    return '(' . $this->p($subNode) . ')';\n                }\n                break;\n            case self::FIXUP_BRACED_NAME:\n            case self::FIXUP_VAR_BRACED_NAME:\n                if ($subNode instanceof Expr\n                    && !$this->origTokens->haveBraces($subStartPos, $subEndPos)\n                ) {\n                    return ($fixup === self::FIXUP_VAR_BRACED_NAME ? '$' : '')\n                        . '{' . $this->p($subNode) . '}';\n                }\n                break;\n            case self::FIXUP_ENCAPSED:\n                if (!$subNode instanceof Node\\InterpolatedStringPart\n                    && !$this->origTokens->haveBraces($subStartPos, $subEndPos)\n                ) {\n                    return '{' . $this->p($subNode) . '}';\n                }\n                break;\n            default:\n                throw new \\Exception('Cannot happen');\n        }\n\n        // Nothing special to do\n        return $this->p($subNode);\n    }\n\n    /**\n     * Appends to a string, ensuring whitespace between label characters.\n     *\n     * Example: \"echo\" and \"$x\" result in \"echo$x\", but \"echo\" and \"x\" result in \"echo x\".\n     * Without safeAppend the result would be \"echox\", which does not preserve semantics.\n     */\n    protected function safeAppend(string &$str, string $append): void {\n        if ($str === \"\") {\n            $str = $append;\n            return;\n        }\n\n        if ($append === \"\") {\n            return;\n        }\n\n        if (!$this->labelCharMap[$append[0]]\n                || !$this->labelCharMap[$str[\\strlen($str) - 1]]) {\n            $str .= $append;\n        } else {\n            $str .= \" \" . $append;\n        }\n    }\n\n    /**\n     * Determines whether the LHS of a call must be wrapped in parenthesis.\n     *\n     * @param Node $node LHS of a call\n     *\n     * @return bool Whether parentheses are required\n     */\n    protected function callLhsRequiresParens(Node $node): bool {\n        if ($node instanceof Expr\\New_) {\n            return !$this->phpVersion->supportsNewDereferenceWithoutParentheses();\n        }\n        return !($node instanceof Node\\Name\n            || $node instanceof Expr\\Variable\n            || $node instanceof Expr\\ArrayDimFetch\n            || $node instanceof Expr\\FuncCall\n            || $node instanceof Expr\\MethodCall\n            || $node instanceof Expr\\NullsafeMethodCall\n            || $node instanceof Expr\\StaticCall\n            || $node instanceof Expr\\Array_);\n    }\n\n    /**\n     * Determines whether the LHS of an array/object operation must be wrapped in parentheses.\n     *\n     * @param Node $node LHS of dereferencing operation\n     *\n     * @return bool Whether parentheses are required\n     */\n    protected function dereferenceLhsRequiresParens(Node $node): bool {\n        // A constant can occur on the LHS of an array/object deref, but not a static deref.\n        return $this->staticDereferenceLhsRequiresParens($node)\n            && !$node instanceof Expr\\ConstFetch;\n    }\n\n    /**\n     * Determines whether the LHS of a static operation must be wrapped in parentheses.\n     *\n     * @param Node $node LHS of dereferencing operation\n     *\n     * @return bool Whether parentheses are required\n     */\n    protected function staticDereferenceLhsRequiresParens(Node $node): bool {\n        if ($node instanceof Expr\\New_) {\n            return !$this->phpVersion->supportsNewDereferenceWithoutParentheses();\n        }\n        return !($node instanceof Expr\\Variable\n            || $node instanceof Node\\Name\n            || $node instanceof Expr\\ArrayDimFetch\n            || $node instanceof Expr\\PropertyFetch\n            || $node instanceof Expr\\NullsafePropertyFetch\n            || $node instanceof Expr\\StaticPropertyFetch\n            || $node instanceof Expr\\FuncCall\n            || $node instanceof Expr\\MethodCall\n            || $node instanceof Expr\\NullsafeMethodCall\n            || $node instanceof Expr\\StaticCall\n            || $node instanceof Expr\\Array_\n            || $node instanceof Scalar\\String_\n            || $node instanceof Expr\\ClassConstFetch);\n    }\n\n    /**\n     * Determines whether an expression used in \"new\" or \"instanceof\" requires parentheses.\n     *\n     * @param Node $node New or instanceof operand\n     *\n     * @return bool Whether parentheses are required\n     */\n    protected function newOperandRequiresParens(Node $node): bool {\n        if ($node instanceof Node\\Name || $node instanceof Expr\\Variable) {\n            return false;\n        }\n        if ($node instanceof Expr\\ArrayDimFetch || $node instanceof Expr\\PropertyFetch ||\n            $node instanceof Expr\\NullsafePropertyFetch\n        ) {\n            return $this->newOperandRequiresParens($node->var);\n        }\n        if ($node instanceof Expr\\StaticPropertyFetch) {\n            return $this->newOperandRequiresParens($node->class);\n        }\n        return true;\n    }\n\n    /**\n     * Print modifiers, including trailing whitespace.\n     *\n     * @param int $modifiers Modifier mask to print\n     *\n     * @return string Printed modifiers\n     */\n    protected function pModifiers(int $modifiers): string {\n        return ($modifiers & Modifiers::FINAL ? 'final ' : '')\n             . ($modifiers & Modifiers::ABSTRACT ? 'abstract ' : '')\n             . ($modifiers & Modifiers::PUBLIC ? 'public ' : '')\n             . ($modifiers & Modifiers::PROTECTED ? 'protected ' : '')\n             . ($modifiers & Modifiers::PRIVATE ? 'private ' : '')\n             . ($modifiers & Modifiers::PUBLIC_SET ? 'public(set) ' : '')\n             . ($modifiers & Modifiers::PROTECTED_SET ? 'protected(set) ' : '')\n             . ($modifiers & Modifiers::PRIVATE_SET ? 'private(set) ' : '')\n             . ($modifiers & Modifiers::STATIC ? 'static ' : '')\n             . ($modifiers & Modifiers::READONLY ? 'readonly ' : '');\n    }\n\n    protected function pStatic(bool $static): string {\n        return $static ? 'static ' : '';\n    }\n\n    /**\n     * Determine whether a list of nodes uses multiline formatting.\n     *\n     * @param (Node|null)[] $nodes Node list\n     *\n     * @return bool Whether multiline formatting is used\n     */\n    protected function isMultiline(array $nodes): bool {\n        if (\\count($nodes) < 2) {\n            return false;\n        }\n\n        $pos = -1;\n        foreach ($nodes as $node) {\n            if (null === $node) {\n                continue;\n            }\n\n            $endPos = $node->getEndTokenPos() + 1;\n            if ($pos >= 0) {\n                $text = $this->origTokens->getTokenCode($pos, $endPos, 0);\n                if (false === strpos($text, \"\\n\")) {\n                    // We require that a newline is present between *every* item. If the formatting\n                    // is inconsistent, with only some items having newlines, we don't consider it\n                    // as multiline\n                    return false;\n                }\n            }\n            $pos = $endPos;\n        }\n\n        return true;\n    }\n\n    /**\n     * Lazily initializes label char map.\n     *\n     * The label char map determines whether a certain character may occur in a label.\n     */\n    protected function initializeLabelCharMap(): void {\n        if (isset($this->labelCharMap)) {\n            return;\n        }\n\n        $this->labelCharMap = [];\n        for ($i = 0; $i < 256; $i++) {\n            $chr = chr($i);\n            $this->labelCharMap[$chr] = $i >= 0x80 || ctype_alnum($chr);\n        }\n\n        if ($this->phpVersion->allowsDelInIdentifiers()) {\n            $this->labelCharMap[\"\\x7f\"] = true;\n        }\n    }\n\n    /**\n     * Lazily initializes node list differ.\n     *\n     * The node list differ is used to determine differences between two array subnodes.\n     */\n    protected function initializeNodeListDiffer(): void {\n        if (isset($this->nodeListDiffer)) {\n            return;\n        }\n\n        $this->nodeListDiffer = new Internal\\Differ(function ($a, $b) {\n            if ($a instanceof Node && $b instanceof Node) {\n                return $a === $b->getAttribute('origNode');\n            }\n            // Can happen for array destructuring\n            return $a === null && $b === null;\n        });\n    }\n\n    /**\n     * Lazily initializes fixup map.\n     *\n     * The fixup map is used to determine whether a certain subnode of a certain node may require\n     * some kind of \"fixup\" operation, e.g. the addition of parenthesis or braces.\n     */\n    protected function initializeFixupMap(): void {\n        if (isset($this->fixupMap)) {\n            return;\n        }\n\n        $this->fixupMap = [\n            Expr\\Instanceof_::class => [\n                'expr' => self::FIXUP_PREC_UNARY,\n                'class' => self::FIXUP_NEW,\n            ],\n            Expr\\Ternary::class => [\n                'cond' => self::FIXUP_PREC_LEFT,\n                'else' => self::FIXUP_PREC_RIGHT,\n            ],\n            Expr\\Yield_::class => ['value' => self::FIXUP_PREC_UNARY],\n\n            Expr\\FuncCall::class => ['name' => self::FIXUP_CALL_LHS],\n            Expr\\StaticCall::class => ['class' => self::FIXUP_STATIC_DEREF_LHS],\n            Expr\\ArrayDimFetch::class => ['var' => self::FIXUP_DEREF_LHS],\n            Expr\\ClassConstFetch::class => [\n                'class' => self::FIXUP_STATIC_DEREF_LHS,\n                'name' => self::FIXUP_BRACED_NAME,\n            ],\n            Expr\\New_::class => ['class' => self::FIXUP_NEW],\n            Expr\\MethodCall::class => [\n                'var' => self::FIXUP_DEREF_LHS,\n                'name' => self::FIXUP_BRACED_NAME,\n            ],\n            Expr\\NullsafeMethodCall::class => [\n                'var' => self::FIXUP_DEREF_LHS,\n                'name' => self::FIXUP_BRACED_NAME,\n            ],\n            Expr\\StaticPropertyFetch::class => [\n                'class' => self::FIXUP_STATIC_DEREF_LHS,\n                'name' => self::FIXUP_VAR_BRACED_NAME,\n            ],\n            Expr\\PropertyFetch::class => [\n                'var' => self::FIXUP_DEREF_LHS,\n                'name' => self::FIXUP_BRACED_NAME,\n            ],\n            Expr\\NullsafePropertyFetch::class => [\n                'var' => self::FIXUP_DEREF_LHS,\n                'name' => self::FIXUP_BRACED_NAME,\n            ],\n            Scalar\\InterpolatedString::class => [\n                'parts' => self::FIXUP_ENCAPSED,\n            ],\n        ];\n\n        $binaryOps = [\n            BinaryOp\\Pow::class, BinaryOp\\Mul::class, BinaryOp\\Div::class, BinaryOp\\Mod::class,\n            BinaryOp\\Plus::class, BinaryOp\\Minus::class, BinaryOp\\Concat::class,\n            BinaryOp\\ShiftLeft::class, BinaryOp\\ShiftRight::class, BinaryOp\\Smaller::class,\n            BinaryOp\\SmallerOrEqual::class, BinaryOp\\Greater::class, BinaryOp\\GreaterOrEqual::class,\n            BinaryOp\\Equal::class, BinaryOp\\NotEqual::class, BinaryOp\\Identical::class,\n            BinaryOp\\NotIdentical::class, BinaryOp\\Spaceship::class, BinaryOp\\BitwiseAnd::class,\n            BinaryOp\\BitwiseXor::class, BinaryOp\\BitwiseOr::class, BinaryOp\\BooleanAnd::class,\n            BinaryOp\\BooleanOr::class, BinaryOp\\Coalesce::class, BinaryOp\\LogicalAnd::class,\n            BinaryOp\\LogicalXor::class, BinaryOp\\LogicalOr::class, BinaryOp\\Pipe::class,\n        ];\n        foreach ($binaryOps as $binaryOp) {\n            $this->fixupMap[$binaryOp] = [\n                'left' => self::FIXUP_PREC_LEFT,\n                'right' => self::FIXUP_PREC_RIGHT\n            ];\n        }\n\n        $prefixOps = [\n            Expr\\Clone_::class, Expr\\BitwiseNot::class, Expr\\BooleanNot::class, Expr\\UnaryPlus::class, Expr\\UnaryMinus::class,\n            Cast\\Int_::class, Cast\\Double::class, Cast\\String_::class, Cast\\Array_::class,\n            Cast\\Object_::class, Cast\\Bool_::class, Cast\\Unset_::class, Expr\\ErrorSuppress::class,\n            Expr\\YieldFrom::class, Expr\\Print_::class, Expr\\Include_::class,\n            Expr\\Assign::class, Expr\\AssignRef::class, AssignOp\\Plus::class, AssignOp\\Minus::class,\n            AssignOp\\Mul::class, AssignOp\\Div::class, AssignOp\\Concat::class, AssignOp\\Mod::class,\n            AssignOp\\BitwiseAnd::class, AssignOp\\BitwiseOr::class, AssignOp\\BitwiseXor::class,\n            AssignOp\\ShiftLeft::class, AssignOp\\ShiftRight::class, AssignOp\\Pow::class, AssignOp\\Coalesce::class,\n            Expr\\ArrowFunction::class, Expr\\Throw_::class,\n        ];\n        foreach ($prefixOps as $prefixOp) {\n            $this->fixupMap[$prefixOp] = ['expr' => self::FIXUP_PREC_UNARY];\n        }\n    }\n\n    /**\n     * Lazily initializes the removal map.\n     *\n     * The removal map is used to determine which additional tokens should be removed when a\n     * certain node is replaced by null.\n     */\n    protected function initializeRemovalMap(): void {\n        if (isset($this->removalMap)) {\n            return;\n        }\n\n        $stripBoth = ['left' => \\T_WHITESPACE, 'right' => \\T_WHITESPACE];\n        $stripLeft = ['left' => \\T_WHITESPACE];\n        $stripRight = ['right' => \\T_WHITESPACE];\n        $stripDoubleArrow = ['right' => \\T_DOUBLE_ARROW];\n        $stripColon = ['left' => ':'];\n        $stripEquals = ['left' => '='];\n        $this->removalMap = [\n            'Expr_ArrayDimFetch->dim' => $stripBoth,\n            'ArrayItem->key' => $stripDoubleArrow,\n            'Expr_ArrowFunction->returnType' => $stripColon,\n            'Expr_Closure->returnType' => $stripColon,\n            'Expr_Exit->expr' => $stripBoth,\n            'Expr_Ternary->if' => $stripBoth,\n            'Expr_Yield->key' => $stripDoubleArrow,\n            'Expr_Yield->value' => $stripBoth,\n            'Param->type' => $stripRight,\n            'Param->default' => $stripEquals,\n            'Stmt_Break->num' => $stripBoth,\n            'Stmt_Catch->var' => $stripLeft,\n            'Stmt_ClassConst->type' => $stripRight,\n            'Stmt_ClassMethod->returnType' => $stripColon,\n            'Stmt_Class->extends' => ['left' => \\T_EXTENDS],\n            'Stmt_Enum->scalarType' => $stripColon,\n            'Stmt_EnumCase->expr' => $stripEquals,\n            'Expr_PrintableNewAnonClass->extends' => ['left' => \\T_EXTENDS],\n            'Stmt_Continue->num' => $stripBoth,\n            'Stmt_Foreach->keyVar' => $stripDoubleArrow,\n            'Stmt_Function->returnType' => $stripColon,\n            'Stmt_If->else' => $stripLeft,\n            'Stmt_Namespace->name' => $stripLeft,\n            'Stmt_Property->type' => $stripRight,\n            'PropertyItem->default' => $stripEquals,\n            'Stmt_Return->expr' => $stripBoth,\n            'Stmt_StaticVar->default' => $stripEquals,\n            'Stmt_TraitUseAdaptation_Alias->newName' => $stripLeft,\n            'Stmt_TryCatch->finally' => $stripLeft,\n            // 'Stmt_Case->cond': Replace with \"default\"\n            // 'Stmt_Class->name': Unclear what to do\n            // 'Stmt_Declare->stmts': Not a plain node\n            // 'Stmt_TraitUseAdaptation_Alias->newModifier': Not a plain node\n        ];\n    }\n\n    protected function initializeInsertionMap(): void {\n        if (isset($this->insertionMap)) {\n            return;\n        }\n\n        // TODO: \"yield\" where both key and value are inserted doesn't work\n        // [$find, $beforeToken, $extraLeft, $extraRight]\n        $this->insertionMap = [\n            'Expr_ArrayDimFetch->dim' => ['[', false, null, null],\n            'ArrayItem->key' => [null, false, null, ' => '],\n            'Expr_ArrowFunction->returnType' => [')', false, ': ', null],\n            'Expr_Closure->returnType' => [')', false, ': ', null],\n            'Expr_Ternary->if' => ['?', false, ' ', ' '],\n            'Expr_Yield->key' => [\\T_YIELD, false, null, ' => '],\n            'Expr_Yield->value' => [\\T_YIELD, false, ' ', null],\n            'Param->type' => [null, false, null, ' '],\n            'Param->default' => [null, false, ' = ', null],\n            'Stmt_Break->num' => [\\T_BREAK, false, ' ', null],\n            'Stmt_Catch->var' => [null, false, ' ', null],\n            'Stmt_ClassMethod->returnType' => [')', false, ': ', null],\n            'Stmt_ClassConst->type' => [\\T_CONST, false, ' ', null],\n            'Stmt_Class->extends' => [null, false, ' extends ', null],\n            'Stmt_Enum->scalarType' => [null, false, ' : ', null],\n            'Stmt_EnumCase->expr' => [null, false, ' = ', null],\n            'Expr_PrintableNewAnonClass->extends' => [null, false, ' extends ', null],\n            'Stmt_Continue->num' => [\\T_CONTINUE, false, ' ', null],\n            'Stmt_Foreach->keyVar' => [\\T_AS, false, null, ' => '],\n            'Stmt_Function->returnType' => [')', false, ': ', null],\n            'Stmt_If->else' => [null, false, ' ', null],\n            'Stmt_Namespace->name' => [\\T_NAMESPACE, false, ' ', null],\n            'Stmt_Property->type' => [\\T_VARIABLE, true, null, ' '],\n            'PropertyItem->default' => [null, false, ' = ', null],\n            'Stmt_Return->expr' => [\\T_RETURN, false, ' ', null],\n            'Stmt_StaticVar->default' => [null, false, ' = ', null],\n            //'Stmt_TraitUseAdaptation_Alias->newName' => [T_AS, false, ' ', null], // TODO\n            'Stmt_TryCatch->finally' => [null, false, ' ', null],\n\n            // 'Expr_Exit->expr': Complicated due to optional ()\n            // 'Stmt_Case->cond': Conversion from default to case\n            // 'Stmt_Class->name': Unclear\n            // 'Stmt_Declare->stmts': Not a proper node\n            // 'Stmt_TraitUseAdaptation_Alias->newModifier': Not a proper node\n        ];\n    }\n\n    protected function initializeListInsertionMap(): void {\n        if (isset($this->listInsertionMap)) {\n            return;\n        }\n\n        $this->listInsertionMap = [\n            // special\n            //'Expr_ShellExec->parts' => '', // TODO These need to be treated more carefully\n            //'Scalar_InterpolatedString->parts' => '',\n            Stmt\\Catch_::class . '->types' => '|',\n            UnionType::class . '->types' => '|',\n            IntersectionType::class . '->types' => '&',\n            Stmt\\If_::class . '->elseifs' => ' ',\n            Stmt\\TryCatch::class . '->catches' => ' ',\n\n            // comma-separated lists\n            Expr\\Array_::class . '->items' => ', ',\n            Expr\\ArrowFunction::class . '->params' => ', ',\n            Expr\\Closure::class . '->params' => ', ',\n            Expr\\Closure::class . '->uses' => ', ',\n            Expr\\FuncCall::class . '->args' => ', ',\n            Expr\\Isset_::class . '->vars' => ', ',\n            Expr\\List_::class . '->items' => ', ',\n            Expr\\MethodCall::class . '->args' => ', ',\n            Expr\\NullsafeMethodCall::class . '->args' => ', ',\n            Expr\\New_::class . '->args' => ', ',\n            PrintableNewAnonClassNode::class . '->args' => ', ',\n            Expr\\StaticCall::class . '->args' => ', ',\n            Stmt\\ClassConst::class . '->consts' => ', ',\n            Stmt\\ClassMethod::class . '->params' => ', ',\n            Stmt\\Class_::class . '->implements' => ', ',\n            Stmt\\Enum_::class . '->implements' => ', ',\n            PrintableNewAnonClassNode::class . '->implements' => ', ',\n            Stmt\\Const_::class . '->consts' => ', ',\n            Stmt\\Declare_::class . '->declares' => ', ',\n            Stmt\\Echo_::class . '->exprs' => ', ',\n            Stmt\\For_::class . '->init' => ', ',\n            Stmt\\For_::class . '->cond' => ', ',\n            Stmt\\For_::class . '->loop' => ', ',\n            Stmt\\Function_::class . '->params' => ', ',\n            Stmt\\Global_::class . '->vars' => ', ',\n            Stmt\\GroupUse::class . '->uses' => ', ',\n            Stmt\\Interface_::class . '->extends' => ', ',\n            Expr\\Match_::class . '->arms' => ', ',\n            Stmt\\Property::class . '->props' => ', ',\n            Stmt\\StaticVar::class . '->vars' => ', ',\n            Stmt\\TraitUse::class . '->traits' => ', ',\n            Stmt\\TraitUseAdaptation\\Precedence::class . '->insteadof' => ', ',\n            Stmt\\Unset_::class .  '->vars' => ', ',\n            Stmt\\UseUse::class . '->uses' => ', ',\n            MatchArm::class . '->conds' => ', ',\n            AttributeGroup::class . '->attrs' => ', ',\n            PropertyHook::class . '->params' => ', ',\n\n            // statement lists\n            Expr\\Closure::class . '->stmts' => \"\\n\",\n            Stmt\\Case_::class . '->stmts' => \"\\n\",\n            Stmt\\Catch_::class . '->stmts' => \"\\n\",\n            Stmt\\Class_::class . '->stmts' => \"\\n\",\n            Stmt\\Enum_::class . '->stmts' => \"\\n\",\n            PrintableNewAnonClassNode::class . '->stmts' => \"\\n\",\n            Stmt\\Interface_::class . '->stmts' => \"\\n\",\n            Stmt\\Trait_::class . '->stmts' => \"\\n\",\n            Stmt\\ClassMethod::class . '->stmts' => \"\\n\",\n            Stmt\\Declare_::class . '->stmts' => \"\\n\",\n            Stmt\\Do_::class . '->stmts' => \"\\n\",\n            Stmt\\ElseIf_::class . '->stmts' => \"\\n\",\n            Stmt\\Else_::class . '->stmts' => \"\\n\",\n            Stmt\\Finally_::class . '->stmts' => \"\\n\",\n            Stmt\\Foreach_::class . '->stmts' => \"\\n\",\n            Stmt\\For_::class . '->stmts' => \"\\n\",\n            Stmt\\Function_::class . '->stmts' => \"\\n\",\n            Stmt\\If_::class . '->stmts' => \"\\n\",\n            Stmt\\Namespace_::class . '->stmts' => \"\\n\",\n            Stmt\\Block::class . '->stmts' => \"\\n\",\n\n            // Attribute groups\n            Stmt\\Class_::class . '->attrGroups' => \"\\n\",\n            Stmt\\Enum_::class . '->attrGroups' => \"\\n\",\n            Stmt\\EnumCase::class . '->attrGroups' => \"\\n\",\n            Stmt\\Interface_::class . '->attrGroups' => \"\\n\",\n            Stmt\\Trait_::class . '->attrGroups' => \"\\n\",\n            Stmt\\Function_::class . '->attrGroups' => \"\\n\",\n            Stmt\\ClassMethod::class . '->attrGroups' => \"\\n\",\n            Stmt\\ClassConst::class . '->attrGroups' => \"\\n\",\n            Stmt\\Property::class . '->attrGroups' => \"\\n\",\n            PrintableNewAnonClassNode::class . '->attrGroups' => ' ',\n            Expr\\Closure::class . '->attrGroups' => ' ',\n            Expr\\ArrowFunction::class . '->attrGroups' => ' ',\n            Param::class . '->attrGroups' => ' ',\n            PropertyHook::class . '->attrGroups' => ' ',\n\n            Stmt\\Switch_::class . '->cases' => \"\\n\",\n            Stmt\\TraitUse::class . '->adaptations' => \"\\n\",\n            Stmt\\TryCatch::class . '->stmts' => \"\\n\",\n            Stmt\\While_::class . '->stmts' => \"\\n\",\n            PropertyHook::class . '->body' => \"\\n\",\n            Stmt\\Property::class . '->hooks' => \"\\n\",\n            Param::class . '->hooks' => \"\\n\",\n\n            // dummy for top-level context\n            'File->stmts' => \"\\n\",\n        ];\n    }\n\n    protected function initializeEmptyListInsertionMap(): void {\n        if (isset($this->emptyListInsertionMap)) {\n            return;\n        }\n\n        // TODO Insertion into empty statement lists.\n\n        // [$find, $extraLeft, $extraRight]\n        $this->emptyListInsertionMap = [\n            Expr\\ArrowFunction::class . '->params' => ['(', '', ''],\n            Expr\\Closure::class . '->uses' => [')', ' use (', ')'],\n            Expr\\Closure::class . '->params' => ['(', '', ''],\n            Expr\\FuncCall::class . '->args' => ['(', '', ''],\n            Expr\\MethodCall::class . '->args' => ['(', '', ''],\n            Expr\\NullsafeMethodCall::class . '->args' => ['(', '', ''],\n            Expr\\New_::class . '->args' => ['(', '', ''],\n            PrintableNewAnonClassNode::class . '->args' => ['(', '', ''],\n            PrintableNewAnonClassNode::class . '->implements' => [null, ' implements ', ''],\n            Expr\\StaticCall::class . '->args' => ['(', '', ''],\n            Stmt\\Class_::class . '->implements' => [null, ' implements ', ''],\n            Stmt\\Enum_::class . '->implements' => [null, ' implements ', ''],\n            Stmt\\ClassMethod::class . '->params' => ['(', '', ''],\n            Stmt\\Interface_::class . '->extends' => [null, ' extends ', ''],\n            Stmt\\Function_::class . '->params' => ['(', '', ''],\n            Stmt\\Interface_::class . '->attrGroups' => [null, '', \"\\n\"],\n            Stmt\\Class_::class . '->attrGroups' => [null, '', \"\\n\"],\n            Stmt\\ClassConst::class . '->attrGroups' => [null, '', \"\\n\"],\n            Stmt\\ClassMethod::class . '->attrGroups' => [null, '', \"\\n\"],\n            Stmt\\Function_::class . '->attrGroups' => [null, '', \"\\n\"],\n            Stmt\\Property::class . '->attrGroups' => [null, '', \"\\n\"],\n            Stmt\\Trait_::class . '->attrGroups' => [null, '', \"\\n\"],\n            Expr\\ArrowFunction::class . '->attrGroups' => [null, '', ' '],\n            Expr\\Closure::class . '->attrGroups' => [null, '', ' '],\n            Stmt\\Const_::class . '->attrGroups' => [null, '', \"\\n\"],\n            PrintableNewAnonClassNode::class . '->attrGroups' => [\\T_NEW, ' ', ''],\n\n            /* These cannot be empty to start with:\n             * Expr_Isset->vars\n             * Stmt_Catch->types\n             * Stmt_Const->consts\n             * Stmt_ClassConst->consts\n             * Stmt_Declare->declares\n             * Stmt_Echo->exprs\n             * Stmt_Global->vars\n             * Stmt_GroupUse->uses\n             * Stmt_Property->props\n             * Stmt_StaticVar->vars\n             * Stmt_TraitUse->traits\n             * Stmt_TraitUseAdaptation_Precedence->insteadof\n             * Stmt_Unset->vars\n             * Stmt_Use->uses\n             * UnionType->types\n             */\n\n            /* TODO\n             * Stmt_If->elseifs\n             * Stmt_TryCatch->catches\n             * Expr_Array->items\n             * Expr_List->items\n             * Stmt_For->init\n             * Stmt_For->cond\n             * Stmt_For->loop\n             */\n        ];\n    }\n\n    protected function initializeModifierChangeMap(): void {\n        if (isset($this->modifierChangeMap)) {\n            return;\n        }\n\n        $this->modifierChangeMap = [\n            Stmt\\ClassConst::class . '->flags' => ['pModifiers', \\T_WHITESPACE, \\T_CONST],\n            Stmt\\ClassMethod::class . '->flags' => ['pModifiers', \\T_WHITESPACE, \\T_FUNCTION],\n            Stmt\\Class_::class . '->flags' => ['pModifiers', \\T_WHITESPACE, \\T_CLASS],\n            Stmt\\Property::class . '->flags' => ['pModifiers', \\T_WHITESPACE, \\T_VARIABLE],\n            PrintableNewAnonClassNode::class . '->flags' => ['pModifiers', \\T_NEW, \\T_CLASS],\n            Param::class . '->flags' => ['pModifiers', \\T_WHITESPACE, \\T_VARIABLE],\n            PropertyHook::class . '->flags' => ['pModifiers', \\T_WHITESPACE, \\T_STRING],\n            Expr\\Closure::class . '->static' => ['pStatic', \\T_WHITESPACE, \\T_FUNCTION],\n            Expr\\ArrowFunction::class . '->static' => ['pStatic', \\T_WHITESPACE, \\T_FN],\n            //Stmt\\TraitUseAdaptation\\Alias::class . '->newModifier' => 0, // TODO\n        ];\n\n        // List of integer subnodes that are not modifiers:\n        // Expr_Include->type\n        // Stmt_GroupUse->type\n        // Stmt_Use->type\n        // UseItem->type\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/Token.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\n/**\n * A PHP token. On PHP 8.0 this extends from PhpToken.\n */\nclass Token extends Internal\\TokenPolyfill {\n    /** Get (exclusive) zero-based end position of the token. */\n    public function getEndPos(): int {\n        return $this->pos + \\strlen($this->text);\n    }\n\n    /** Get 1-based end line number of the token. */\n    public function getEndLine(): int {\n        return $this->line + \\substr_count($this->text, \"\\n\");\n    }\n}\n"
  },
  {
    "path": "lib/PhpParser/compatibility_tokens.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nif (!\\function_exists('PhpParser\\defineCompatibilityTokens')) {\n    function defineCompatibilityTokens(): void {\n        $compatTokens = [\n            // PHP 8.0\n            'T_NAME_QUALIFIED',\n            'T_NAME_FULLY_QUALIFIED',\n            'T_NAME_RELATIVE',\n            'T_MATCH',\n            'T_NULLSAFE_OBJECT_OPERATOR',\n            'T_ATTRIBUTE',\n            // PHP 8.1\n            'T_ENUM',\n            'T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG',\n            'T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG',\n            'T_READONLY',\n            // PHP 8.4\n            'T_PROPERTY_C',\n            'T_PUBLIC_SET',\n            'T_PROTECTED_SET',\n            'T_PRIVATE_SET',\n            // PHP 8.5\n            'T_PIPE',\n            'T_VOID_CAST',\n        ];\n\n        // PHP-Parser might be used together with another library that also emulates some or all\n        // of these tokens. Perform a sanity-check that all already defined tokens have been\n        // assigned a unique ID.\n        $usedTokenIds = [];\n        foreach ($compatTokens as $token) {\n            if (\\defined($token)) {\n                $tokenId = \\constant($token);\n                if (!\\is_int($tokenId)) {\n                    throw new \\Error(sprintf(\n                        'Token %s has ID of type %s, should be int. ' .\n                        'You may be using a library with broken token emulation',\n                        $token, \\gettype($tokenId)\n                    ));\n                }\n                $clashingToken = $usedTokenIds[$tokenId] ?? null;\n                if ($clashingToken !== null) {\n                    throw new \\Error(sprintf(\n                        'Token %s has same ID as token %s, ' .\n                        'you may be using a library with broken token emulation',\n                        $token, $clashingToken\n                    ));\n                }\n                $usedTokenIds[$tokenId] = $token;\n            }\n        }\n\n        // Now define any tokens that have not yet been emulated. Try to assign IDs from -1\n        // downwards, but skip any IDs that may already be in use.\n        $newTokenId = -1;\n        foreach ($compatTokens as $token) {\n            if (!\\defined($token)) {\n                while (isset($usedTokenIds[$newTokenId])) {\n                    $newTokenId--;\n                }\n                \\define($token, $newTokenId);\n                $newTokenId--;\n            }\n        }\n    }\n\n    defineCompatibilityTokens();\n}\n"
  },
  {
    "path": "phpstan-baseline.neon",
    "content": "parameters:\n\tignoreErrors:\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\Builder\\\\ClassConst\\:\\:__construct\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Builder/ClassConst.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\Builder\\\\ClassConst\\:\\:addConst\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Builder/ClassConst.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\BuilderFactory\\:\\:args\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/BuilderFactory.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\BuilderFactory\\:\\:attribute\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/BuilderFactory.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\BuilderFactory\\:\\:classConst\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/BuilderFactory.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\BuilderFactory\\:\\:funcCall\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/BuilderFactory.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\BuilderFactory\\:\\:methodCall\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/BuilderFactory.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\BuilderFactory\\:\\:new\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/BuilderFactory.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\BuilderFactory\\:\\:staticCall\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/BuilderFactory.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\BuilderFactory\\:\\:val\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/BuilderFactory.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\BuilderHelpers\\:\\:normalizeValue\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/BuilderHelpers.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\ConstExprEvaluator\\:\\:evaluateArray\\(\\) return type has no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/ConstExprEvaluator.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\JsonDecoder\\:\\:decodeArray\\(\\) has parameter \\$array with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/JsonDecoder.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\JsonDecoder\\:\\:decodeArray\\(\\) return type has no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/JsonDecoder.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\JsonDecoder\\:\\:decodeComment\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/JsonDecoder.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\JsonDecoder\\:\\:decodeNode\\(\\) has parameter \\$value with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/JsonDecoder.php\n\n\t\t-\n\t\t\tmessage: '#^Call to function assert\\(\\) with false will always evaluate to false\\.$#'\n\t\t\tidentifier: function.impossibleType\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Lexer/Emulative.php\n\n\t\t-\n\t\t\tmessage: '#^If condition is always false\\.$#'\n\t\t\tidentifier: if.alwaysFalse\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Node/Expr/ArrayItem.php\n\n\t\t-\n\t\t\tmessage: '#^If condition is always false\\.$#'\n\t\t\tidentifier: if.alwaysFalse\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Node/Expr/ClosureUse.php\n\n\t\t-\n\t\t\tmessage: '#^If condition is always false\\.$#'\n\t\t\tidentifier: if.alwaysFalse\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Node/Scalar/DNumber.php\n\n\t\t-\n\t\t\tmessage: '#^If condition is always false\\.$#'\n\t\t\tidentifier: if.alwaysFalse\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Node/Scalar/Encapsed.php\n\n\t\t-\n\t\t\tmessage: '#^If condition is always false\\.$#'\n\t\t\tidentifier: if.alwaysFalse\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Node/Scalar/EncapsedStringPart.php\n\n\t\t-\n\t\t\tmessage: '#^If condition is always false\\.$#'\n\t\t\tidentifier: if.alwaysFalse\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Node/Scalar/LNumber.php\n\n\t\t-\n\t\t\tmessage: '#^If condition is always false\\.$#'\n\t\t\tidentifier: if.alwaysFalse\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Node/Stmt/DeclareDeclare.php\n\n\t\t-\n\t\t\tmessage: '#^If condition is always false\\.$#'\n\t\t\tidentifier: if.alwaysFalse\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Node/Stmt/PropertyProperty.php\n\n\t\t-\n\t\t\tmessage: '#^If condition is always false\\.$#'\n\t\t\tidentifier: if.alwaysFalse\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Node/Stmt/StaticVar.php\n\n\t\t-\n\t\t\tmessage: '#^If condition is always false\\.$#'\n\t\t\tidentifier: if.alwaysFalse\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/Node/Stmt/UseUse.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\NodeDumper\\:\\:__construct\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeDumper.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\NodeDumper\\:\\:dump\\(\\) has parameter \\$node with no value type specified in iterable type array\\.$#'\n\t\t\tidentifier: missingType.iterableValue\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeDumper.php\n\n\t\t-\n\t\t\tmessage: '#^Access to an undefined property PhpParser\\\\Node\\:\\:\\$attrGroups\\.$#'\n\t\t\tidentifier: property.notFound\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeVisitor/NameResolver.php\n\n\t\t-\n\t\t\tmessage: '#^Access to an undefined property PhpParser\\\\Node\\:\\:\\$name\\.$#'\n\t\t\tidentifier: property.notFound\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeVisitor/NameResolver.php\n\n\t\t-\n\t\t\tmessage: '#^Access to an undefined property PhpParser\\\\Node\\:\\:\\$namespacedName\\.$#'\n\t\t\tidentifier: property.notFound\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeVisitor/NameResolver.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\NodeVisitor\\\\NodeConnectingVisitor\\:\\:beforeTraverse\\(\\) should return array\\<PhpParser\\\\Node\\>\\|null but return statement is missing\\.$#'\n\t\t\tidentifier: return.missing\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\NodeVisitor\\\\NodeConnectingVisitor\\:\\:enterNode\\(\\) should return array\\<PhpParser\\\\Node\\>\\|int\\|PhpParser\\\\Node\\|null but return statement is missing\\.$#'\n\t\t\tidentifier: return.missing\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\NodeVisitor\\\\NodeConnectingVisitor\\:\\:leaveNode\\(\\) should return array\\<PhpParser\\\\Node\\>\\|int\\|PhpParser\\\\Node\\|null but return statement is missing\\.$#'\n\t\t\tidentifier: return.missing\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeVisitor/NodeConnectingVisitor.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\NodeVisitor\\\\ParentConnectingVisitor\\:\\:beforeTraverse\\(\\) should return array\\<PhpParser\\\\Node\\>\\|null but return statement is missing\\.$#'\n\t\t\tidentifier: return.missing\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\NodeVisitor\\\\ParentConnectingVisitor\\:\\:enterNode\\(\\) should return array\\<PhpParser\\\\Node\\>\\|int\\|PhpParser\\\\Node\\|null but return statement is missing\\.$#'\n\t\t\tidentifier: return.missing\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php\n\n\t\t-\n\t\t\tmessage: '#^Method PhpParser\\\\NodeVisitor\\\\ParentConnectingVisitor\\:\\:leaveNode\\(\\) should return array\\<PhpParser\\\\Node\\>\\|int\\|PhpParser\\\\Node\\|null but return statement is missing\\.$#'\n\t\t\tidentifier: return.missing\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/NodeVisitor/ParentConnectingVisitor.php\n\n\t\t-\n\t\t\tmessage: '#^Access to undefined constant static\\(PhpParser\\\\ParserAbstract\\)\\:\\:T_ECHO\\.$#'\n\t\t\tidentifier: classConstant.notFound\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/ParserAbstract.php\n\n\t\t-\n\t\t\tmessage: '#^Unary operation \"\\+\" on string results in an error\\.$#'\n\t\t\tidentifier: unaryOp.invalid\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/ParserAbstract.php\n\n\t\t-\n\t\t\tmessage: '#^Variable \\$action might not be defined\\.$#'\n\t\t\tidentifier: variable.undefined\n\t\t\tcount: 1\n\t\t\tpath: lib/PhpParser/ParserAbstract.php\n"
  },
  {
    "path": "phpstan.neon.dist",
    "content": "includes:\n    - phpstan-baseline.neon\n\nparameters:\n    level: 6\n    paths:\n        - lib\n    treatPhpDocTypesAsCertain: false\n"
  },
  {
    "path": "phpunit.xml.dist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:noNamespaceSchemaLocation=\"vendor/phpunit/phpunit/phpunit.xsd\"\n         backupGlobals=\"false\"\n         colors=\"true\"\n         convertDeprecationsToExceptions=\"true\"\n         beStrictAboutTestsThatDoNotTestAnything=\"false\"\n         bootstrap=\"./test/bootstrap.php\">\n    <testsuites>\n        <testsuite name=\"PHPParser Test Suite\">\n            <directory>./test/</directory>\n        </testsuite>\n    </testsuites>\n\n    <coverage>\n        <include>\n            <directory suffix=\".php\">./lib/PhpParser/</directory>\n        </include>\n    </coverage>\n</phpunit>\n"
  },
  {
    "path": "test/PhpParser/Builder/ClassConstTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Comment;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Const_;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Stmt;\n\nclass ClassConstTest extends \\PHPUnit\\Framework\\TestCase {\n    public function createClassConstBuilder($name, $value) {\n        return new ClassConst($name, $value);\n    }\n\n    public function testModifiers(): void {\n        $node = $this->createClassConstBuilder(\"TEST\", 1)\n            ->makePrivate()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\ClassConst(\n                [\n                    new Const_(\"TEST\", new Int_(1))\n                ],\n                Modifiers::PRIVATE\n            ),\n            $node\n        );\n\n        $node = $this->createClassConstBuilder(\"TEST\", 1)\n            ->makeProtected()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\ClassConst(\n                [\n                    new Const_(\"TEST\", new Int_(1))\n                ],\n                Modifiers::PROTECTED\n            ),\n            $node\n        );\n\n        $node = $this->createClassConstBuilder(\"TEST\", 1)\n            ->makePublic()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\ClassConst(\n                [\n                    new Const_(\"TEST\", new Int_(1))\n                ],\n                Modifiers::PUBLIC\n            ),\n            $node\n        );\n\n        $node = $this->createClassConstBuilder(\"TEST\", 1)\n            ->makeFinal()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\ClassConst(\n                [\n                    new Const_(\"TEST\", new Int_(1))\n                ],\n                Modifiers::FINAL\n            ),\n            $node\n        );\n    }\n\n    public function testDocComment(): void {\n        $node = $this->createClassConstBuilder('TEST', 1)\n            ->setDocComment('/** Test */')\n            ->makePublic()\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\ClassConst(\n                [\n                    new Const_(\"TEST\", new Int_(1))\n                ],\n                Modifiers::PUBLIC,\n                [\n                    'comments' => [new Comment\\Doc('/** Test */')]\n                ]\n            ),\n            $node\n        );\n    }\n\n    public function testAddConst(): void {\n        $node = $this->createClassConstBuilder('FIRST_TEST', 1)\n            ->addConst(\"SECOND_TEST\", 2)\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\ClassConst(\n                [\n                    new Const_(\"FIRST_TEST\", new Int_(1)),\n                    new Const_(\"SECOND_TEST\", new Int_(2))\n                ]\n            ),\n            $node\n        );\n    }\n\n    public function testAddAttribute(): void {\n        $attribute = new Attribute(\n            new Name('Attr'),\n            [new Arg(new Int_(1), false, false, [], new Identifier('name'))]\n        );\n        $attributeGroup = new AttributeGroup([$attribute]);\n\n        $node = $this->createClassConstBuilder('ATTR_GROUP', 1)\n            ->addAttribute($attributeGroup)\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\ClassConst(\n                [\n                    new Const_(\"ATTR_GROUP\", new Int_(1))\n                ],\n                0,\n                [],\n                [$attributeGroup]\n            ),\n            $node\n        );\n    }\n\n    public function testType(): void {\n        $node = $this->createClassConstBuilder('TYPE', 1)\n            ->setType('int')\n            ->getNode();\n        $this->assertEquals(\n            new Stmt\\ClassConst(\n                [new Const_('TYPE', new Int_(1))],\n                0, [], [], new Identifier('int')),\n            $node\n        );\n    }\n\n    /**\n     * @dataProvider provideTestDefaultValues\n     */\n    public function testValues($value, $expectedValueNode): void {\n        $node = $this->createClassConstBuilder('TEST', $value)\n            ->getNode()\n        ;\n\n        $this->assertEquals($expectedValueNode, $node->consts[0]->value);\n    }\n\n    public static function provideTestDefaultValues() {\n        return [\n            [\n                null,\n                new Expr\\ConstFetch(new Name('null'))\n            ],\n            [\n                true,\n                new Expr\\ConstFetch(new Name('true'))\n            ],\n            [\n                false,\n                new Expr\\ConstFetch(new Name('false'))\n            ],\n            [\n                31415,\n                new Scalar\\Int_(31415)\n            ],\n            [\n                3.1415,\n                new Scalar\\Float_(3.1415)\n            ],\n            [\n                'Hallo World',\n                new Scalar\\String_('Hallo World')\n            ],\n            [\n                [1, 2, 3],\n                new Expr\\Array_([\n                    new \\PhpParser\\Node\\ArrayItem(new Scalar\\Int_(1)),\n                    new \\PhpParser\\Node\\ArrayItem(new Scalar\\Int_(2)),\n                    new \\PhpParser\\Node\\ArrayItem(new Scalar\\Int_(3)),\n                ])\n            ],\n            [\n                ['foo' => 'bar', 'bar' => 'foo'],\n                new Expr\\Array_([\n                    new \\PhpParser\\Node\\ArrayItem(\n                        new Scalar\\String_('bar'),\n                        new Scalar\\String_('foo')\n                    ),\n                    new \\PhpParser\\Node\\ArrayItem(\n                        new Scalar\\String_('foo'),\n                        new Scalar\\String_('bar')\n                    ),\n                ])\n            ],\n            [\n                new Scalar\\MagicConst\\Dir(),\n                new Scalar\\MagicConst\\Dir()\n            ]\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/ClassTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Comment;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Stmt;\n\nclass ClassTest extends \\PHPUnit\\Framework\\TestCase {\n    protected function createClassBuilder($class) {\n        return new Class_($class);\n    }\n\n    public function testExtendsImplements(): void {\n        $node = $this->createClassBuilder('SomeLogger')\n            ->extend('BaseLogger')\n            ->implement('Namespaced\\Logger', new Name('SomeInterface'))\n            ->implement('\\Fully\\Qualified', 'namespace\\NamespaceRelative')\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Class_('SomeLogger', [\n                'extends' => new Name('BaseLogger'),\n                'implements' => [\n                    new Name('Namespaced\\Logger'),\n                    new Name('SomeInterface'),\n                    new Name\\FullyQualified('Fully\\Qualified'),\n                    new Name\\Relative('NamespaceRelative'),\n                ],\n            ]),\n            $node\n        );\n    }\n\n    public function testAbstract(): void {\n        $node = $this->createClassBuilder('Test')\n            ->makeAbstract()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Class_('Test', [\n                'flags' => Modifiers::ABSTRACT\n            ]),\n            $node\n        );\n    }\n\n    public function testFinal(): void {\n        $node = $this->createClassBuilder('Test')\n            ->makeFinal()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Class_('Test', [\n                'flags' => Modifiers::FINAL\n            ]),\n            $node\n        );\n    }\n\n    public function testReadonly(): void {\n        $node = $this->createClassBuilder('Test')\n            ->makeReadonly()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Class_('Test', [\n                'flags' => Modifiers::READONLY\n            ]),\n            $node\n        );\n    }\n\n    public function testStatementOrder(): void {\n        $method = new Stmt\\ClassMethod('testMethod');\n        $property = new Stmt\\Property(\n            Modifiers::PUBLIC,\n            [new Node\\PropertyItem('testProperty')]\n        );\n        $const = new Stmt\\ClassConst([\n            new Node\\Const_('TEST_CONST', new Node\\Scalar\\String_('ABC'))\n        ]);\n        $use = new Stmt\\TraitUse([new Name('SomeTrait')]);\n\n        $node = $this->createClassBuilder('Test')\n            ->addStmt($method)\n            ->addStmt($property)\n            ->addStmts([$const, $use])\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Class_('Test', [\n                'stmts' => [$use, $const, $property, $method]\n            ]),\n            $node\n        );\n    }\n\n    public function testDocComment(): void {\n        $docComment = <<<'DOC'\n/**\n * Test\n */\nDOC;\n        $class = $this->createClassBuilder('Test')\n            ->setDocComment($docComment)\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\Class_('Test', [], [\n                'comments' => [\n                    new Comment\\Doc($docComment)\n                ]\n            ]),\n            $class\n        );\n\n        $class = $this->createClassBuilder('Test')\n            ->setDocComment(new Comment\\Doc($docComment))\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\Class_('Test', [], [\n                'comments' => [\n                    new Comment\\Doc($docComment)\n                ]\n            ]),\n            $class\n        );\n    }\n\n    public function testAddAttribute(): void {\n        $attribute = new Attribute(\n            new Name('Attr'),\n            [new Arg(new Int_(1), false, false, [], new Identifier('name'))]\n        );\n        $attributeGroup = new AttributeGroup([$attribute]);\n\n        $class = $this->createClassBuilder('ATTR_GROUP')\n            ->addAttribute($attributeGroup)\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\Class_('ATTR_GROUP', [\n                'attrGroups' => [\n                    $attributeGroup,\n                ]\n            ], []),\n            $class\n        );\n    }\n\n    public function testInvalidStmtError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Unexpected node of type \"Stmt_Echo\"');\n        $this->createClassBuilder('Test')\n            ->addStmt(new Stmt\\Echo_([]))\n        ;\n    }\n\n    public function testInvalidDocComment(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Doc comment must be a string or an instance of PhpParser\\Comment\\Doc');\n        $this->createClassBuilder('Test')\n            ->setDocComment(new Comment('Test'));\n    }\n\n    public function testEmptyName(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Name cannot be empty');\n        $this->createClassBuilder('Test')\n            ->extend('');\n    }\n\n    public function testInvalidName(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Name must be a string or an instance of Node\\Name');\n        $this->createClassBuilder('Test')\n            ->extend(['Foo']);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/EnumCaseTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Comment;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Stmt;\n\nclass EnumCaseTest extends \\PHPUnit\\Framework\\TestCase {\n    public function createEnumCaseBuilder($name) {\n        return new EnumCase($name);\n    }\n\n    public function testDocComment(): void {\n        $node = $this->createEnumCaseBuilder('TEST')\n            ->setDocComment('/** Test */')\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\EnumCase(\n                \"TEST\",\n                null,\n                [],\n                [\n                    'comments' => [new Comment\\Doc('/** Test */')]\n                ]\n            ),\n            $node\n        );\n    }\n\n    public function testAddAttribute(): void {\n        $attribute = new Attribute(\n            new Name('Attr'),\n            [new Arg(new Int_(1), false, false, [], new Identifier('name'))]\n        );\n        $attributeGroup = new AttributeGroup([$attribute]);\n\n        $node = $this->createEnumCaseBuilder('ATTR_GROUP')\n            ->addAttribute($attributeGroup)\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\EnumCase(\n                \"ATTR_GROUP\",\n                null,\n                [$attributeGroup]\n            ),\n            $node\n        );\n    }\n\n    /**\n     * @dataProvider provideTestDefaultValues\n     */\n    public function testValues($value, $expectedValueNode): void {\n        $node = $this->createEnumCaseBuilder('TEST')\n            ->setValue($value)\n            ->getNode()\n        ;\n\n        $this->assertEquals($expectedValueNode, $node->expr);\n    }\n\n    public static function provideTestDefaultValues() {\n        return [\n            [\n                31415,\n                new Scalar\\Int_(31415)\n            ],\n            [\n                'Hallo World',\n                new Scalar\\String_('Hallo World')\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/EnumTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Comment;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Stmt;\n\nclass EnumTest extends \\PHPUnit\\Framework\\TestCase {\n    protected function createEnumBuilder($class) {\n        return new Enum_($class);\n    }\n\n    public function testImplements(): void {\n        $node = $this->createEnumBuilder('SomeEnum')\n            ->implement('Namespaced\\SomeInterface', new Name('OtherInterface'))\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Enum_('SomeEnum', [\n                'implements' => [\n                    new Name('Namespaced\\SomeInterface'),\n                    new Name('OtherInterface'),\n                ],\n            ]),\n            $node\n        );\n    }\n\n    public function testSetScalarType(): void {\n        $node = $this->createEnumBuilder('Test')\n            ->setScalarType('int')\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Enum_('Test', [\n                'scalarType' => new Identifier('int'),\n            ]),\n            $node\n        );\n    }\n\n    public function testStatementOrder(): void {\n        $method = new Stmt\\ClassMethod('testMethod');\n        $enumCase = new Stmt\\EnumCase(\n            'TEST_ENUM_CASE'\n        );\n        $const = new Stmt\\ClassConst([\n            new Node\\Const_('TEST_CONST', new Node\\Scalar\\String_('ABC'))\n        ]);\n        $use = new Stmt\\TraitUse([new Name('SomeTrait')]);\n\n        $node = $this->createEnumBuilder('Test')\n            ->addStmt($method)\n            ->addStmt($enumCase)\n            ->addStmts([$const, $use])\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Enum_('Test', [\n                'stmts' => [$use, $enumCase, $const, $method]\n            ]),\n            $node\n        );\n    }\n\n    public function testDocComment(): void {\n        $docComment = <<<'DOC'\n/**\n * Test\n */\nDOC;\n        $enum = $this->createEnumBuilder('Test')\n            ->setDocComment($docComment)\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\Enum_('Test', [], [\n                'comments' => [\n                    new Comment\\Doc($docComment)\n                ]\n            ]),\n            $enum\n        );\n\n        $enum = $this->createEnumBuilder('Test')\n            ->setDocComment(new Comment\\Doc($docComment))\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\Enum_('Test', [], [\n                'comments' => [\n                    new Comment\\Doc($docComment)\n                ]\n            ]),\n            $enum\n        );\n    }\n\n    public function testAddAttribute(): void {\n        $attribute = new Attribute(\n            new Name('Attr'),\n            [new Arg(new Int_(1), false, false, [], new Identifier('name'))]\n        );\n        $attributeGroup = new AttributeGroup([$attribute]);\n\n        $enum = $this->createEnumBuilder('ATTR_GROUP')\n            ->addAttribute($attributeGroup)\n            ->getNode();\n\n        $this->assertEquals(\n            new Stmt\\Enum_('ATTR_GROUP', [\n                'attrGroups' => [\n                    $attributeGroup,\n                ]\n            ], []),\n            $enum\n        );\n    }\n\n    public function testInvalidStmtError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Unexpected node of type \"PropertyItem\"');\n        $this->createEnumBuilder('Test')\n            ->addStmt(new Node\\PropertyItem('property'))\n        ;\n    }\n\n    public function testInvalidDocComment(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Doc comment must be a string or an instance of PhpParser\\Comment\\Doc');\n        $this->createEnumBuilder('Test')\n            ->setDocComment(new Comment('Test'));\n    }\n\n    public function testEmptyName(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Name cannot be empty');\n        $this->createEnumBuilder('Test')\n            ->implement('');\n    }\n\n    public function testInvalidName(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Name must be a string or an instance of Node\\Name');\n        $this->createEnumBuilder('Test')\n            ->implement(['Foo']);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/FunctionTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Comment;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Expr\\Print_;\nuse PhpParser\\Node\\Expr\\Variable;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Scalar\\String_;\nuse PhpParser\\Node\\Stmt;\n\nclass FunctionTest extends \\PHPUnit\\Framework\\TestCase {\n    public function createFunctionBuilder($name) {\n        return new Function_($name);\n    }\n\n    public function testReturnByRef(): void {\n        $node = $this->createFunctionBuilder('test')\n            ->makeReturnByRef()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Function_('test', [\n                'byRef' => true\n            ]),\n            $node\n        );\n    }\n\n    public function testParams(): void {\n        $param1 = new Node\\Param(new Variable('test1'));\n        $param2 = new Node\\Param(new Variable('test2'));\n        $param3 = new Node\\Param(new Variable('test3'));\n\n        $node = $this->createFunctionBuilder('test')\n            ->addParam($param1)\n            ->addParams([$param2, $param3])\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Function_('test', [\n                'params' => [$param1, $param2, $param3]\n            ]),\n            $node\n        );\n    }\n\n    public function testStmts(): void {\n        $stmt1 = new Print_(new String_('test1'));\n        $stmt2 = new Print_(new String_('test2'));\n        $stmt3 = new Print_(new String_('test3'));\n\n        $node = $this->createFunctionBuilder('test')\n            ->addStmt($stmt1)\n            ->addStmts([$stmt2, $stmt3])\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Function_('test', [\n                'stmts' => [\n                    new Stmt\\Expression($stmt1),\n                    new Stmt\\Expression($stmt2),\n                    new Stmt\\Expression($stmt3),\n                ]\n            ]),\n            $node\n        );\n    }\n\n    public function testDocComment(): void {\n        $node = $this->createFunctionBuilder('test')\n            ->setDocComment('/** Test */')\n            ->getNode();\n\n        $this->assertEquals(new Stmt\\Function_('test', [], [\n            'comments' => [new Comment\\Doc('/** Test */')]\n        ]), $node);\n    }\n\n    public function testAddAttribute(): void {\n        $attribute = new Attribute(\n            new Name('Attr'),\n            [new Arg(new Int_(1), false, false, [], new Identifier('name'))]\n        );\n        $attributeGroup = new AttributeGroup([$attribute]);\n\n        $node = $this->createFunctionBuilder('attrGroup')\n            ->addAttribute($attributeGroup)\n            ->getNode();\n\n        $this->assertEquals(new Stmt\\Function_('attrGroup', [\n            'attrGroups' => [$attributeGroup],\n        ], []), $node);\n    }\n\n    public function testReturnType(): void {\n        $node = $this->createFunctionBuilder('test')\n            ->setReturnType('void')\n            ->getNode();\n\n        $this->assertEquals(new Stmt\\Function_('test', [\n            'returnType' => new Identifier('void'),\n        ], []), $node);\n    }\n\n    public function testInvalidNullableVoidType(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('void type cannot be nullable');\n        $this->createFunctionBuilder('test')->setReturnType('?void');\n    }\n\n    public function testInvalidParamError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected parameter node, got \"Name\"');\n        $this->createFunctionBuilder('test')\n            ->addParam(new Node\\Name('foo'))\n        ;\n    }\n\n    public function testAddNonStmt(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected statement or expression node');\n        $this->createFunctionBuilder('test')\n            ->addStmt(new Node\\Name('Test'));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/InterfaceTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Comment;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar\\Float_;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Stmt;\n\nclass InterfaceTest extends \\PHPUnit\\Framework\\TestCase {\n    protected function createInterfaceBuilder() {\n        return new Interface_('Contract');\n    }\n\n    private function dump($node) {\n        $pp = new \\PhpParser\\PrettyPrinter\\Standard();\n        return $pp->prettyPrint([$node]);\n    }\n\n    public function testEmpty(): void {\n        $contract = $this->createInterfaceBuilder()->getNode();\n        $this->assertInstanceOf(Stmt\\Interface_::class, $contract);\n        $this->assertEquals(new Node\\Identifier('Contract'), $contract->name);\n    }\n\n    public function testExtending(): void {\n        $contract = $this->createInterfaceBuilder()\n            ->extend('Space\\Root1', 'Root2')->getNode();\n        $this->assertEquals(\n            new Stmt\\Interface_('Contract', [\n                'extends' => [\n                    new Node\\Name('Space\\Root1'),\n                    new Node\\Name('Root2')\n                ],\n            ]), $contract\n        );\n    }\n\n    public function testAddMethod(): void {\n        $method = new Stmt\\ClassMethod('doSomething');\n        $contract = $this->createInterfaceBuilder()->addStmt($method)->getNode();\n        $this->assertSame([$method], $contract->stmts);\n    }\n\n    public function testAddConst(): void {\n        $const = new Stmt\\ClassConst([\n            new Node\\Const_('SPEED_OF_LIGHT', new Float_(299792458.0))\n        ]);\n        $contract = $this->createInterfaceBuilder()->addStmt($const)->getNode();\n        $this->assertSame(299792458.0, $contract->stmts[0]->consts[0]->value->value);\n    }\n\n    public function testOrder(): void {\n        $const = new Stmt\\ClassConst([\n            new Node\\Const_('SPEED_OF_LIGHT', new Float_(299792458))\n        ]);\n        $method = new Stmt\\ClassMethod('doSomething');\n        $contract = $this->createInterfaceBuilder()\n            ->addStmt($method)\n            ->addStmt($const)\n            ->getNode()\n        ;\n\n        $this->assertInstanceOf(Stmt\\ClassConst::class, $contract->stmts[0]);\n        $this->assertInstanceOf(Stmt\\ClassMethod::class, $contract->stmts[1]);\n    }\n\n    public function testDocComment(): void {\n        $node = $this->createInterfaceBuilder()\n            ->setDocComment('/** Test */')\n            ->getNode();\n\n        $this->assertEquals(new Stmt\\Interface_('Contract', [], [\n            'comments' => [new Comment\\Doc('/** Test */')]\n        ]), $node);\n    }\n\n    public function testAddAttribute(): void {\n        $attribute = new Attribute(\n            new Name('Attr'),\n            [new Arg(new Int_(1), false, false, [], new Identifier('name'))]\n        );\n        $attributeGroup = new AttributeGroup([$attribute]);\n\n        $node = $this->createInterfaceBuilder()\n            ->addAttribute($attributeGroup)\n            ->getNode();\n\n        $this->assertEquals(new Stmt\\Interface_('Contract', [\n            'attrGroups' => [$attributeGroup],\n        ], []), $node);\n    }\n\n    public function testInvalidStmtError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Unexpected node of type \"PropertyItem\"');\n        $this->createInterfaceBuilder()->addStmt(new Node\\PropertyItem('invalid'));\n    }\n\n    public function testFullFunctional(): void {\n        $const = new Stmt\\ClassConst([\n            new Node\\Const_('SPEED_OF_LIGHT', new Float_(299792458))\n        ]);\n        $method = new Stmt\\ClassMethod('doSomething');\n        $contract = $this->createInterfaceBuilder()\n            ->addStmt($method)\n            ->addStmt($const)\n            ->getNode()\n        ;\n\n        eval($this->dump($contract));\n\n        $this->assertTrue(interface_exists('Contract', false));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/MethodTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Comment;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Expr\\Print_;\nuse PhpParser\\Node\\Expr\\Variable;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Scalar\\String_;\nuse PhpParser\\Node\\Stmt;\n\nclass MethodTest extends \\PHPUnit\\Framework\\TestCase {\n    public function createMethodBuilder($name) {\n        return new Method($name);\n    }\n\n    public function testModifiers(): void {\n        $node = $this->createMethodBuilder('test')\n            ->makePublic()\n            ->makeAbstract()\n            ->makeStatic()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\ClassMethod('test', [\n                'flags' => Modifiers::PUBLIC | Modifiers::ABSTRACT | Modifiers::STATIC,\n                'stmts' => null,\n            ]),\n            $node\n        );\n\n        $node = $this->createMethodBuilder('test')\n            ->makeProtected()\n            ->makeFinal()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\ClassMethod('test', [\n                'flags' => Modifiers::PROTECTED | Modifiers::FINAL\n            ]),\n            $node\n        );\n\n        $node = $this->createMethodBuilder('test')\n            ->makePrivate()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\ClassMethod('test', [\n                'type' => Modifiers::PRIVATE\n            ]),\n            $node\n        );\n    }\n\n    public function testReturnByRef(): void {\n        $node = $this->createMethodBuilder('test')\n            ->makeReturnByRef()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\ClassMethod('test', [\n                'byRef' => true\n            ]),\n            $node\n        );\n    }\n\n    public function testParams(): void {\n        $param1 = new Node\\Param(new Variable('test1'));\n        $param2 = new Node\\Param(new Variable('test2'));\n        $param3 = new Node\\Param(new Variable('test3'));\n\n        $node = $this->createMethodBuilder('test')\n            ->addParam($param1)\n            ->addParams([$param2, $param3])\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\ClassMethod('test', [\n                'params' => [$param1, $param2, $param3]\n            ]),\n            $node\n        );\n    }\n\n    public function testStmts(): void {\n        $stmt1 = new Print_(new String_('test1'));\n        $stmt2 = new Print_(new String_('test2'));\n        $stmt3 = new Print_(new String_('test3'));\n\n        $node = $this->createMethodBuilder('test')\n            ->addStmt($stmt1)\n            ->addStmts([$stmt2, $stmt3])\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\ClassMethod('test', [\n                'stmts' => [\n                    new Stmt\\Expression($stmt1),\n                    new Stmt\\Expression($stmt2),\n                    new Stmt\\Expression($stmt3),\n                ]\n            ]),\n            $node\n        );\n    }\n    public function testDocComment(): void {\n        $node = $this->createMethodBuilder('test')\n            ->setDocComment('/** Test */')\n            ->getNode();\n\n        $this->assertEquals(new Stmt\\ClassMethod('test', [], [\n            'comments' => [new Comment\\Doc('/** Test */')]\n        ]), $node);\n    }\n\n    public function testAddAttribute(): void {\n        $attribute = new Attribute(\n            new Name('Attr'),\n            [new Arg(new Int_(1), false, false, [], new Identifier('name'))]\n        );\n        $attributeGroup = new AttributeGroup([$attribute]);\n\n        $node = $this->createMethodBuilder('attributeGroup')\n            ->addAttribute($attributeGroup)\n            ->getNode();\n\n        $this->assertEquals(new Stmt\\ClassMethod('attributeGroup', [\n            'attrGroups' => [$attributeGroup],\n        ], []), $node);\n    }\n\n    public function testReturnType(): void {\n        $node = $this->createMethodBuilder('test')\n            ->setReturnType('bool')\n            ->getNode();\n        $this->assertEquals(new Stmt\\ClassMethod('test', [\n            'returnType' => new Identifier('bool'),\n        ], []), $node);\n    }\n\n    public function testAddStmtToAbstractMethodError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Cannot add statements to an abstract method');\n        $this->createMethodBuilder('test')\n            ->makeAbstract()\n            ->addStmt(new Print_(new String_('test')))\n        ;\n    }\n\n    public function testMakeMethodWithStmtsAbstractError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Cannot make method with statements abstract');\n        $this->createMethodBuilder('test')\n            ->addStmt(new Print_(new String_('test')))\n            ->makeAbstract()\n        ;\n    }\n\n    public function testInvalidParamError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected parameter node, got \"Name\"');\n        $this->createMethodBuilder('test')\n            ->addParam(new Node\\Name('foo'))\n        ;\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/NamespaceTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Comment\\Doc;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Stmt;\n\nclass NamespaceTest extends \\PHPUnit\\Framework\\TestCase {\n    protected function createNamespaceBuilder($fqn) {\n        return new Namespace_($fqn);\n    }\n\n    public function testCreation(): void {\n        $stmt1 = new Stmt\\Class_('SomeClass');\n        $stmt2 = new Stmt\\Interface_('SomeInterface');\n        $stmt3 = new Stmt\\Function_('someFunction');\n        $docComment = new Doc('/** Test */');\n        $expected = new Stmt\\Namespace_(\n            new Node\\Name('Name\\Space'),\n            [$stmt1, $stmt2, $stmt3],\n            ['comments' => [$docComment]]\n        );\n\n        $node = $this->createNamespaceBuilder('Name\\Space')\n            ->addStmt($stmt1)\n            ->addStmts([$stmt2, $stmt3])\n            ->setDocComment($docComment)\n            ->getNode()\n        ;\n        $this->assertEquals($expected, $node);\n\n        $node = $this->createNamespaceBuilder(new Node\\Name(['Name', 'Space']))\n            ->setDocComment($docComment)\n            ->addStmts([$stmt1, $stmt2])\n            ->addStmt($stmt3)\n            ->getNode()\n        ;\n        $this->assertEquals($expected, $node);\n\n        $node = $this->createNamespaceBuilder(null)->getNode();\n        $this->assertNull($node->name);\n        $this->assertEmpty($node->stmts);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/ParamTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Scalar\\Int_;\n\nclass ParamTest extends \\PHPUnit\\Framework\\TestCase {\n    public function createParamBuilder($name) {\n        return new Param($name);\n    }\n\n    /**\n     * @dataProvider provideTestDefaultValues\n     */\n    public function testDefaultValues($value, $expectedValueNode): void {\n        $node = $this->createParamBuilder('test')\n            ->setDefault($value)\n            ->getNode()\n        ;\n\n        $this->assertEquals($expectedValueNode, $node->default);\n    }\n\n    public static function provideTestDefaultValues() {\n        return [\n            [\n                null,\n                new Expr\\ConstFetch(new Node\\Name('null'))\n            ],\n            [\n                true,\n                new Expr\\ConstFetch(new Node\\Name('true'))\n            ],\n            [\n                false,\n                new Expr\\ConstFetch(new Node\\Name('false'))\n            ],\n            [\n                31415,\n                new Scalar\\Int_(31415)\n            ],\n            [\n                3.1415,\n                new Scalar\\Float_(3.1415)\n            ],\n            [\n                'Hallo World',\n                new Scalar\\String_('Hallo World')\n            ],\n            [\n                [1, 2, 3],\n                new Expr\\Array_([\n                    new Node\\ArrayItem(new Scalar\\Int_(1)),\n                    new Node\\ArrayItem(new Scalar\\Int_(2)),\n                    new Node\\ArrayItem(new Scalar\\Int_(3)),\n                ])\n            ],\n            [\n                ['foo' => 'bar', 'bar' => 'foo'],\n                new Expr\\Array_([\n                    new Node\\ArrayItem(\n                        new Scalar\\String_('bar'),\n                        new Scalar\\String_('foo')\n                    ),\n                    new Node\\ArrayItem(\n                        new Scalar\\String_('foo'),\n                        new Scalar\\String_('bar')\n                    ),\n                ])\n            ],\n            [\n                new Scalar\\MagicConst\\Dir(),\n                new Scalar\\MagicConst\\Dir()\n            ]\n        ];\n    }\n\n    /**\n     * @dataProvider provideTestTypes\n     * @dataProvider provideTestNullableTypes\n     * @dataProvider provideTestUnionTypes\n     */\n    public function testTypes($typeHint, $expectedType): void {\n        $node = $this->createParamBuilder('test')\n            ->setType($typeHint)\n            ->getNode()\n        ;\n        $type = $node->type;\n\n        /* Manually implement comparison to avoid __toString stupidity */\n        if ($expectedType instanceof Node\\NullableType) {\n            $this->assertInstanceOf(get_class($expectedType), $type);\n            $expectedType = $expectedType->type;\n            $type = $type->type;\n        }\n\n        $this->assertInstanceOf(get_class($expectedType), $type);\n        $this->assertEquals($expectedType, $type);\n    }\n\n    public static function provideTestTypes() {\n        return [\n            ['array', new Node\\Identifier('array')],\n            ['callable', new Node\\Identifier('callable')],\n            ['bool', new Node\\Identifier('bool')],\n            ['int', new Node\\Identifier('int')],\n            ['float', new Node\\Identifier('float')],\n            ['string', new Node\\Identifier('string')],\n            ['iterable', new Node\\Identifier('iterable')],\n            ['object', new Node\\Identifier('object')],\n            ['Array', new Node\\Identifier('array')],\n            ['CALLABLE', new Node\\Identifier('callable')],\n            ['mixed', new Node\\Identifier('mixed')],\n            ['Some\\Class', new Node\\Name('Some\\Class')],\n            ['\\Foo', new Node\\Name\\FullyQualified('Foo')],\n            ['self', new Node\\Name('self')],\n            [new Node\\Name('Some\\Class'), new Node\\Name('Some\\Class')],\n        ];\n    }\n\n    public static function provideTestNullableTypes() {\n        return [\n            ['?array', new Node\\NullableType(new Node\\Identifier('array'))],\n            ['?Some\\Class', new Node\\NullableType(new Node\\Name('Some\\Class'))],\n            [\n                new Node\\NullableType(new Node\\Identifier('int')),\n                new Node\\NullableType(new Node\\Identifier('int'))\n            ],\n            [\n                new Node\\NullableType(new Node\\Name('Some\\Class')),\n                new Node\\NullableType(new Node\\Name('Some\\Class'))\n            ],\n        ];\n    }\n\n    public static function provideTestUnionTypes() {\n        return [\n            [\n                new Node\\UnionType([\n                    new Node\\Name('Some\\Class'),\n                    new Node\\Identifier('array'),\n                ]),\n                new Node\\UnionType([\n                    new Node\\Name('Some\\Class'),\n                    new Node\\Identifier('array'),\n                ]),\n            ],\n            [\n                new Node\\UnionType([\n                    new Node\\Identifier('self'),\n                    new Node\\Identifier('array'),\n                    new Node\\Name\\FullyQualified('Foo')\n                ]),\n                new Node\\UnionType([\n                    new Node\\Identifier('self'),\n                    new Node\\Identifier('array'),\n                    new Node\\Name\\FullyQualified('Foo')\n                ]),\n            ],\n        ];\n    }\n\n    public function testVoidTypeError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Parameter type cannot be void');\n        $this->createParamBuilder('test')->setType('void');\n    }\n\n    public function testInvalidTypeError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Type must be a string, or an instance of Name, Identifier or ComplexType');\n        $this->createParamBuilder('test')->setType(new \\stdClass());\n    }\n\n    public function testByRef(): void {\n        $node = $this->createParamBuilder('test')\n            ->makeByRef()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Node\\Param(new Expr\\Variable('test'), null, null, true),\n            $node\n        );\n    }\n\n    public function testVariadic(): void {\n        $node = $this->createParamBuilder('test')\n            ->makeVariadic()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Node\\Param(new Expr\\Variable('test'), null, null, false, true),\n            $node\n        );\n    }\n\n    public function testMakePublic(): void {\n        $node = $this->createParamBuilder('test')\n            ->makePublic()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Node\\Param(new Expr\\Variable('test'), null, null, false, false, [], Modifiers::PUBLIC),\n            $node\n        );\n    }\n\n    public function testMakeProtected(): void {\n        $node = $this->createParamBuilder('test')\n            ->makeProtected()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Node\\Param(new Expr\\Variable('test'), null, null, false, false, [], Modifiers::PROTECTED),\n            $node\n        );\n\n        $node = $this->createParamBuilder('test')\n            ->makeProtectedSet()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Node\\Param(new Expr\\Variable('test'), null, null, false, false, [], Modifiers::PROTECTED_SET),\n            $node\n        );\n    }\n\n    public function testMakePrivate(): void {\n        $node = $this->createParamBuilder('test')\n            ->makePrivate()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Node\\Param(new Expr\\Variable('test'), null, null, false, false, [], Modifiers::PRIVATE),\n            $node\n        );\n\n        $node = $this->createParamBuilder('test')\n            ->makePrivateSet()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Node\\Param(new Expr\\Variable('test'), null, null, false, false, [], Modifiers::PRIVATE_SET),\n            $node\n        );\n    }\n\n    public function testMakeReadonly(): void {\n        $node = $this->createParamBuilder('test')\n            ->makeReadonly()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Node\\Param(new Expr\\Variable('test'), null, null, false, false, [], Modifiers::READONLY),\n            $node\n        );\n    }\n\n    public function testAddAttribute(): void {\n        $attribute = new Attribute(\n            new Name('Attr'),\n            [new Arg(new Int_(1), false, false, [], new Identifier('name'))]\n        );\n        $attributeGroup = new AttributeGroup([$attribute]);\n\n        $node = $this->createParamBuilder('attributeGroup')\n            ->addAttribute($attributeGroup)\n            ->getNode();\n\n        $this->assertEquals(\n            new Node\\Param(new Expr\\Variable('attributeGroup'), null, null, false, false, [], 0, [$attributeGroup]),\n            $node\n        );\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/PropertyTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Comment;\nuse PhpParser\\Error;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\PropertyHook;\nuse PhpParser\\Node\\PropertyItem;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Stmt;\n\nclass PropertyTest extends \\PHPUnit\\Framework\\TestCase {\n    public function createPropertyBuilder($name) {\n        return new Property($name);\n    }\n\n    public function testModifiers(): void {\n        $node = $this->createPropertyBuilder('test')\n            ->makePrivate()\n            ->makeStatic()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Property(\n                Modifiers::PRIVATE | Modifiers::STATIC,\n                [new PropertyItem('test')]\n            ),\n            $node\n        );\n\n        $node = $this->createPropertyBuilder('test')\n            ->makeProtected()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Property(\n                Modifiers::PROTECTED,\n                [new PropertyItem('test')]\n            ),\n            $node\n        );\n\n        $node = $this->createPropertyBuilder('test')\n            ->makePublic()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Property(\n                Modifiers::PUBLIC,\n                [new PropertyItem('test')]\n            ),\n            $node\n        );\n\n        $node = $this->createPropertyBuilder('test')\n            ->makeReadonly()\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Property(\n                Modifiers::READONLY,\n                [new PropertyItem('test')]\n            ),\n            $node\n        );\n\n        $node = $this->createPropertyBuilder('test')\n            ->makeFinal()\n            ->getNode();\n        $this->assertEquals(\n            new Stmt\\Property(Modifiers::FINAL, [new PropertyItem('test')]),\n            $node);\n\n        $node = $this->createPropertyBuilder('test')\n            ->makePrivateSet()\n            ->getNode();\n        $this->assertEquals(\n            new Stmt\\Property(Modifiers::PRIVATE_SET, [new PropertyItem('test')]),\n            $node);\n\n        $node = $this->createPropertyBuilder('test')\n            ->makeProtectedSet()\n            ->getNode();\n        $this->assertEquals(\n            new Stmt\\Property(Modifiers::PROTECTED_SET, [new PropertyItem('test')]),\n            $node);\n    }\n\n    public function testAbstractWithoutHook() {\n        $this->expectException(Error::class);\n        $this->expectExceptionMessage('Only hooked properties may be declared abstract');\n        $this->createPropertyBuilder('test')->makeAbstract()->getNode();\n    }\n\n    public function testDocComment(): void {\n        $node = $this->createPropertyBuilder('test')\n            ->setDocComment('/** Test */')\n            ->getNode();\n\n        $this->assertEquals(new Stmt\\Property(\n            Modifiers::PUBLIC,\n            [\n                new \\PhpParser\\Node\\PropertyItem('test')\n            ],\n            [\n                'comments' => [new Comment\\Doc('/** Test */')]\n            ]\n        ), $node);\n    }\n\n    /**\n     * @dataProvider provideTestDefaultValues\n     */\n    public function testDefaultValues($value, $expectedValueNode): void {\n        $node = $this->createPropertyBuilder('test')\n            ->setDefault($value)\n            ->getNode()\n        ;\n\n        $this->assertEquals($expectedValueNode, $node->props[0]->default);\n    }\n\n    public function testAddAttribute(): void {\n        $attribute = new Attribute(\n            new Name('Attr'),\n            [new Arg(new Int_(1), false, false, [], new Identifier('name'))]\n        );\n        $attributeGroup = new AttributeGroup([$attribute]);\n\n        $node = $this->createPropertyBuilder('test')\n            ->addAttribute($attributeGroup)\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Property(\n                Modifiers::PUBLIC,\n                [\n                    new \\PhpParser\\Node\\PropertyItem('test')\n                ],\n                [],\n                null,\n                [$attributeGroup]\n            ),\n            $node\n        );\n    }\n\n    public function testAddHook(): void {\n        $get = new PropertyHook('get', null);\n        $set = new PropertyHook('set', null);\n        $node = $this->createPropertyBuilder('test')\n            ->addHook($get)\n            ->addHook($set)\n            ->makeAbstract()\n            ->getNode();\n        $this->assertEquals(\n            new Stmt\\Property(\n                Modifiers::ABSTRACT,\n                [new PropertyItem('test')],\n                [], null, [],\n                [$get, $set]),\n            $node);\n    }\n\n    public static function provideTestDefaultValues() {\n        return [\n            [\n                null,\n                new Expr\\ConstFetch(new Name('null'))\n            ],\n            [\n                true,\n                new Expr\\ConstFetch(new Name('true'))\n            ],\n            [\n                false,\n                new Expr\\ConstFetch(new Name('false'))\n            ],\n            [\n                31415,\n                new Scalar\\Int_(31415)\n            ],\n            [\n                3.1415,\n                new Scalar\\Float_(3.1415)\n            ],\n            [\n                'Hallo World',\n                new Scalar\\String_('Hallo World')\n            ],\n            [\n                [1, 2, 3],\n                new Expr\\Array_([\n                    new \\PhpParser\\Node\\ArrayItem(new Scalar\\Int_(1)),\n                    new \\PhpParser\\Node\\ArrayItem(new Scalar\\Int_(2)),\n                    new \\PhpParser\\Node\\ArrayItem(new Scalar\\Int_(3)),\n                ])\n            ],\n            [\n                ['foo' => 'bar', 'bar' => 'foo'],\n                new Expr\\Array_([\n                    new \\PhpParser\\Node\\ArrayItem(\n                        new Scalar\\String_('bar'),\n                        new Scalar\\String_('foo')\n                    ),\n                    new \\PhpParser\\Node\\ArrayItem(\n                        new Scalar\\String_('foo'),\n                        new Scalar\\String_('bar')\n                    ),\n                ])\n            ],\n            [\n                new Scalar\\MagicConst\\Dir(),\n                new Scalar\\MagicConst\\Dir()\n            ]\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/TraitTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Comment;\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\AttributeGroup;\nuse PhpParser\\Node\\Const_;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\Node\\Stmt\\ClassConst;\nuse PhpParser\\Node\\Stmt\\ClassMethod;\nuse PhpParser\\Node\\Stmt\\Property;\nuse PhpParser\\Node\\PropertyItem;\nuse PhpParser\\Node\\Stmt\\TraitUse;\n\nclass TraitTest extends \\PHPUnit\\Framework\\TestCase {\n    protected function createTraitBuilder($class) {\n        return new Trait_($class);\n    }\n\n    public function testStmtAddition(): void {\n        $method1 = new Stmt\\ClassMethod('test1');\n        $method2 = new Stmt\\ClassMethod('test2');\n        $method3 = new Stmt\\ClassMethod('test3');\n        $prop = new Stmt\\Property(Modifiers::PUBLIC, [\n            new PropertyItem('test')\n        ]);\n        $const = new ClassConst([new Const_('FOO', new Int_(0))]);\n        $use = new Stmt\\TraitUse([new Name('OtherTrait')]);\n        $trait = $this->createTraitBuilder('TestTrait')\n            ->setDocComment('/** Nice trait */')\n            ->addStmt($method1)\n            ->addStmts([$method2, $method3])\n            ->addStmt($prop)\n            ->addStmt($use)\n            ->addStmt($const)\n            ->getNode();\n        $this->assertEquals(new Stmt\\Trait_('TestTrait', [\n            'stmts' => [$use, $const, $prop, $method1, $method2, $method3]\n        ], [\n            'comments' => [\n                new Comment\\Doc('/** Nice trait */')\n            ]\n        ]), $trait);\n    }\n\n    public function testInvalidStmtError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Unexpected node of type \"Stmt_Echo\"');\n        $this->createTraitBuilder('Test')\n            ->addStmt(new Stmt\\Echo_([]))\n        ;\n    }\n\n    public function testGetMethods(): void {\n        $methods = [\n            new ClassMethod('foo'),\n            new ClassMethod('bar'),\n            new ClassMethod('fooBar'),\n        ];\n        $trait = new Stmt\\Trait_('Foo', [\n            'stmts' => [\n                new TraitUse([]),\n                $methods[0],\n                new ClassConst([]),\n                $methods[1],\n                new Property(0, []),\n                $methods[2],\n            ]\n        ]);\n\n        $this->assertSame($methods, $trait->getMethods());\n    }\n\n    public function testGetProperties(): void {\n        $properties = [\n            new Property(Modifiers::PUBLIC, [new PropertyItem('foo')]),\n            new Property(Modifiers::PUBLIC, [new PropertyItem('bar')]),\n        ];\n        $trait = new Stmt\\Trait_('Foo', [\n            'stmts' => [\n                new TraitUse([]),\n                $properties[0],\n                new ClassConst([]),\n                $properties[1],\n                new ClassMethod('fooBar'),\n            ]\n        ]);\n\n        $this->assertSame($properties, $trait->getProperties());\n    }\n\n    public function testAddAttribute(): void {\n        $attribute = new Attribute(\n            new Name('Attr'),\n            [new Arg(new Int_(1), false, false, [], new Identifier('name'))]\n        );\n        $attributeGroup = new AttributeGroup([$attribute]);\n\n        $node = $this->createTraitBuilder('AttributeGroup')\n            ->addAttribute($attributeGroup)\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\Trait_(\n                'AttributeGroup',\n                [\n                    'attrGroups' => [$attributeGroup],\n                ]\n            ),\n            $node\n        );\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/TraitUseAdaptationTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\Node\\Stmt\\Class_;\n\nclass TraitUseAdaptationTest extends \\PHPUnit\\Framework\\TestCase {\n    protected function createTraitUseAdaptationBuilder($trait, $method) {\n        return new TraitUseAdaptation($trait, $method);\n    }\n\n    public function testAsMake(): void {\n        $builder = $this->createTraitUseAdaptationBuilder(null, 'foo');\n\n        $this->assertEquals(\n            new Stmt\\TraitUseAdaptation\\Alias(null, 'foo', null, 'bar'),\n            (clone $builder)->as('bar')->getNode()\n        );\n\n        $this->assertEquals(\n            new Stmt\\TraitUseAdaptation\\Alias(null, 'foo', Modifiers::PUBLIC, null),\n            (clone $builder)->makePublic()->getNode()\n        );\n\n        $this->assertEquals(\n            new Stmt\\TraitUseAdaptation\\Alias(null, 'foo', Modifiers::PROTECTED, null),\n            (clone $builder)->makeProtected()->getNode()\n        );\n\n        $this->assertEquals(\n            new Stmt\\TraitUseAdaptation\\Alias(null, 'foo', Modifiers::PRIVATE, null),\n            (clone $builder)->makePrivate()->getNode()\n        );\n    }\n\n    public function testInsteadof(): void {\n        $node = $this->createTraitUseAdaptationBuilder('SomeTrait', 'foo')\n            ->insteadof('AnotherTrait')\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\TraitUseAdaptation\\Precedence(\n                new Name('SomeTrait'),\n                'foo',\n                [new Name('AnotherTrait')]\n            ),\n            $node\n        );\n    }\n\n    public function testAsOnNotAlias(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Cannot set alias for not alias adaptation buider');\n        $this->createTraitUseAdaptationBuilder('Test', 'foo')\n            ->insteadof('AnotherTrait')\n            ->as('bar')\n        ;\n    }\n\n    public function testInsteadofOnNotPrecedence(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Cannot add overwritten traits for not precedence adaptation buider');\n        $this->createTraitUseAdaptationBuilder('Test', 'foo')\n            ->as('bar')\n            ->insteadof('AnotherTrait')\n        ;\n    }\n\n    public function testInsteadofWithoutTrait(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Precedence adaptation must have trait');\n        $this->createTraitUseAdaptationBuilder(null, 'foo')\n            ->insteadof('AnotherTrait')\n        ;\n    }\n\n    public function testMakeOnNotAlias(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Cannot set access modifier for not alias adaptation buider');\n        $this->createTraitUseAdaptationBuilder('Test', 'foo')\n            ->insteadof('AnotherTrait')\n            ->makePublic()\n        ;\n    }\n\n    public function testMultipleMake(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Multiple access type modifiers are not allowed');\n        $this->createTraitUseAdaptationBuilder(null, 'foo')\n            ->makePrivate()\n            ->makePublic()\n        ;\n    }\n\n    public function testUndefinedType(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Type of adaptation is not defined');\n        $this->createTraitUseAdaptationBuilder(null, 'foo')\n            ->getNode()\n        ;\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/TraitUseTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Stmt;\n\nclass TraitUseTest extends \\PHPUnit\\Framework\\TestCase {\n    protected function createTraitUseBuilder(...$traits) {\n        return new TraitUse(...$traits);\n    }\n\n    public function testAnd(): void {\n        $node = $this->createTraitUseBuilder('SomeTrait')\n            ->and('AnotherTrait')\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\TraitUse([\n                new Name('SomeTrait'),\n                new Name('AnotherTrait')\n            ]),\n            $node\n        );\n    }\n\n    public function testWith(): void {\n        $node = $this->createTraitUseBuilder('SomeTrait')\n            ->with(new Stmt\\TraitUseAdaptation\\Alias(null, 'foo', null, 'bar'))\n            ->with((new TraitUseAdaptation(null, 'test'))->as('baz'))\n            ->getNode()\n        ;\n\n        $this->assertEquals(\n            new Stmt\\TraitUse([new Name('SomeTrait')], [\n                new Stmt\\TraitUseAdaptation\\Alias(null, 'foo', null, 'bar'),\n                new Stmt\\TraitUseAdaptation\\Alias(null, 'test', null, 'baz')\n            ]),\n            $node\n        );\n    }\n\n    public function testInvalidAdaptationNode(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Adaptation must have type TraitUseAdaptation');\n        $this->createTraitUseBuilder('Test')\n            ->with(new Stmt\\Echo_([]))\n        ;\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Builder/UseTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Builder;\n\nuse PhpParser\\Builder;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Stmt;\n\nclass UseTest extends \\PHPUnit\\Framework\\TestCase {\n    protected function createUseBuilder($name, $type = Stmt\\Use_::TYPE_NORMAL) {\n        return new Builder\\Use_($name, $type);\n    }\n\n    public function testCreation(): void {\n        $node = $this->createUseBuilder('Foo\\Bar')->getNode();\n        $this->assertEquals(new Stmt\\Use_([\n            new \\PhpParser\\Node\\UseItem(new Name('Foo\\Bar'), null)\n        ]), $node);\n\n        $node = $this->createUseBuilder(new Name('Foo\\Bar'))->as('XYZ')->getNode();\n        $this->assertEquals(new Stmt\\Use_([\n            new \\PhpParser\\Node\\UseItem(new Name('Foo\\Bar'), 'XYZ')\n        ]), $node);\n\n        $node = $this->createUseBuilder('foo\\bar', Stmt\\Use_::TYPE_FUNCTION)->as('foo')->getNode();\n        $this->assertEquals(new Stmt\\Use_([\n            new \\PhpParser\\Node\\UseItem(new Name('foo\\bar'), 'foo')\n        ], Stmt\\Use_::TYPE_FUNCTION), $node);\n\n        $node = $this->createUseBuilder('foo\\BAR', Stmt\\Use_::TYPE_CONSTANT)->as('FOO')->getNode();\n        $this->assertEquals(new Stmt\\Use_([\n            new \\PhpParser\\Node\\UseItem(new Name('foo\\BAR'), 'FOO')\n        ], Stmt\\Use_::TYPE_CONSTANT), $node);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/BuilderFactoryTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Attribute;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Expr\\BinaryOp\\Concat;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Scalar\\String_;\n\nclass BuilderFactoryTest extends \\PHPUnit\\Framework\\TestCase {\n    /**\n     * @dataProvider provideTestFactory\n     */\n    public function testFactory($methodName, $className): void {\n        $factory = new BuilderFactory();\n        $this->assertInstanceOf($className, $factory->$methodName('test'));\n    }\n\n    public static function provideTestFactory() {\n        return [\n            ['namespace',   Builder\\Namespace_::class],\n            ['class',       Builder\\Class_::class],\n            ['interface',   Builder\\Interface_::class],\n            ['trait',       Builder\\Trait_::class],\n            ['enum',        Builder\\Enum_::class],\n            ['method',      Builder\\Method::class],\n            ['function',    Builder\\Function_::class],\n            ['property',    Builder\\Property::class],\n            ['param',       Builder\\Param::class],\n            ['use',         Builder\\Use_::class],\n            ['useFunction', Builder\\Use_::class],\n            ['useConst',    Builder\\Use_::class],\n            ['enumCase',    Builder\\EnumCase::class],\n        ];\n    }\n\n    public function testFactoryClassConst(): void {\n        $factory = new BuilderFactory();\n        $this->assertInstanceOf(Builder\\ClassConst::class, $factory->classConst('TEST', 1));\n    }\n\n    public function testAttribute(): void {\n        $factory = new BuilderFactory();\n        $this->assertEquals(\n            new Attribute(new Name('AttributeName'), [new Arg(\n                new String_('bar'), false, false, [], new Identifier('foo')\n            )]),\n            $factory->attribute('AttributeName', ['foo' => 'bar'])\n        );\n    }\n\n    public function testVal(): void {\n        // This method is a wrapper around BuilderHelpers::normalizeValue(),\n        // which is already tested elsewhere\n        $factory = new BuilderFactory();\n        $this->assertEquals(\n            new String_(\"foo\"),\n            $factory->val(\"foo\")\n        );\n    }\n\n    public function testConcat(): void {\n        $factory = new BuilderFactory();\n        $varA = new Expr\\Variable('a');\n        $varB = new Expr\\Variable('b');\n        $varC = new Expr\\Variable('c');\n\n        $this->assertEquals(\n            new Concat($varA, $varB),\n            $factory->concat($varA, $varB)\n        );\n        $this->assertEquals(\n            new Concat(new Concat($varA, $varB), $varC),\n            $factory->concat($varA, $varB, $varC)\n        );\n        $this->assertEquals(\n            new Concat(new Concat(new String_(\"a\"), $varB), new String_(\"c\")),\n            $factory->concat(\"a\", $varB, \"c\")\n        );\n    }\n\n    public function testConcatOneError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected at least two expressions');\n        (new BuilderFactory())->concat(\"a\");\n    }\n\n    public function testConcatInvalidExpr(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected string or Expr');\n        (new BuilderFactory())->concat(\"a\", 42);\n    }\n\n    public function testArgs(): void {\n        $factory = new BuilderFactory();\n        $unpack = new Arg(new Expr\\Variable('c'), false, true);\n        $this->assertEquals(\n            [\n                new Arg(new Expr\\Variable('a')),\n                new Arg(new String_('b')),\n                $unpack\n            ],\n            $factory->args([new Expr\\Variable('a'), 'b', $unpack])\n        );\n    }\n\n    public function testNamedArgs(): void {\n        $factory = new BuilderFactory();\n        $this->assertEquals(\n            [\n                new Arg(new String_('foo')),\n                new Arg(new String_('baz'), false, false, [], new Identifier('bar')),\n            ],\n            $factory->args(['foo', 'bar' => 'baz'])\n        );\n    }\n\n    public function testCalls(): void {\n        $factory = new BuilderFactory();\n\n        // Simple function call\n        $this->assertEquals(\n            new Expr\\FuncCall(\n                new Name('var_dump'),\n                [new Arg(new String_('str'))]\n            ),\n            $factory->funcCall('var_dump', ['str'])\n        );\n        // Dynamic function call\n        $this->assertEquals(\n            new Expr\\FuncCall(new Expr\\Variable('fn')),\n            $factory->funcCall(new Expr\\Variable('fn'))\n        );\n\n        // Simple method call\n        $this->assertEquals(\n            new Expr\\MethodCall(\n                new Expr\\Variable('obj'),\n                new Identifier('method'),\n                [new Arg(new Int_(42))]\n            ),\n            $factory->methodCall(new Expr\\Variable('obj'), 'method', [42])\n        );\n        // Explicitly pass Identifier node\n        $this->assertEquals(\n            new Expr\\MethodCall(\n                new Expr\\Variable('obj'),\n                new Identifier('method')\n            ),\n            $factory->methodCall(new Expr\\Variable('obj'), new Identifier('method'))\n        );\n        // Dynamic method call\n        $this->assertEquals(\n            new Expr\\MethodCall(\n                new Expr\\Variable('obj'),\n                new Expr\\Variable('method')\n            ),\n            $factory->methodCall(new Expr\\Variable('obj'), new Expr\\Variable('method'))\n        );\n\n        // Simple static method call\n        $this->assertEquals(\n            new Expr\\StaticCall(\n                new Name\\FullyQualified('Foo'),\n                new Identifier('bar'),\n                [new Arg(new Expr\\Variable('baz'))]\n            ),\n            $factory->staticCall('\\Foo', 'bar', [new Expr\\Variable('baz')])\n        );\n        // Dynamic static method call\n        $this->assertEquals(\n            new Expr\\StaticCall(\n                new Expr\\Variable('foo'),\n                new Expr\\Variable('bar')\n            ),\n            $factory->staticCall(new Expr\\Variable('foo'), new Expr\\Variable('bar'))\n        );\n\n        // Simple new call\n        $this->assertEquals(\n            new Expr\\New_(new Name\\FullyQualified('stdClass')),\n            $factory->new('\\stdClass')\n        );\n        // Dynamic new call\n        $this->assertEquals(\n            new Expr\\New_(\n                new Expr\\Variable('foo'),\n                [new Arg(new String_('bar'))]\n            ),\n            $factory->new(new Expr\\Variable('foo'), ['bar'])\n        );\n    }\n\n    public function testConstFetches(): void {\n        $factory = new BuilderFactory();\n        $this->assertEquals(\n            new Expr\\ConstFetch(new Name('FOO')),\n            $factory->constFetch('FOO')\n        );\n        $this->assertEquals(\n            new Expr\\ClassConstFetch(new Name('Foo'), new Identifier('BAR')),\n            $factory->classConstFetch('Foo', 'BAR')\n        );\n        $this->assertEquals(\n            new Expr\\ClassConstFetch(new Expr\\Variable('foo'), new Identifier('BAR')),\n            $factory->classConstFetch(new Expr\\Variable('foo'), 'BAR')\n        );\n        $this->assertEquals(\n            new Expr\\ClassConstFetch(new Name('Foo'), new Expr\\Variable('foo')),\n            $factory->classConstFetch('Foo', $factory->var('foo'))\n        );\n    }\n\n    public function testVar(): void {\n        $factory = new BuilderFactory();\n        $this->assertEquals(\n            new Expr\\Variable(\"foo\"),\n            $factory->var(\"foo\")\n        );\n        $this->assertEquals(\n            new Expr\\Variable(new Expr\\Variable(\"foo\")),\n            $factory->var($factory->var(\"foo\"))\n        );\n    }\n\n    public function testPropertyFetch(): void {\n        $f = new BuilderFactory();\n        $this->assertEquals(\n            new Expr\\PropertyFetch(new Expr\\Variable('foo'), 'bar'),\n            $f->propertyFetch($f->var('foo'), 'bar')\n        );\n        $this->assertEquals(\n            new Expr\\PropertyFetch(new Expr\\Variable('foo'), 'bar'),\n            $f->propertyFetch($f->var('foo'), new Identifier('bar'))\n        );\n        $this->assertEquals(\n            new Expr\\PropertyFetch(new Expr\\Variable('foo'), new Expr\\Variable('bar')),\n            $f->propertyFetch($f->var('foo'), $f->var('bar'))\n        );\n    }\n\n    public function testInvalidIdentifier(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected string or instance of Node\\Identifier');\n        (new BuilderFactory())->classConstFetch('Foo', new Name('foo'));\n    }\n\n    public function testInvalidIdentifierOrExpr(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected string or instance of Node\\Identifier or Node\\Expr');\n        (new BuilderFactory())->staticCall('Foo', new Name('bar'));\n    }\n\n    public function testInvalidNameOrExpr(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Name must be a string or an instance of Node\\Name or Node\\Expr');\n        (new BuilderFactory())->funcCall(new Node\\Stmt\\Return_());\n    }\n\n    public function testInvalidVar(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Variable name must be string or Expr');\n        (new BuilderFactory())->var(new Node\\Stmt\\Return_());\n    }\n\n    public function testIntegration(): void {\n        $factory = new BuilderFactory();\n        $node = $factory->namespace('Name\\Space')\n            ->addStmt($factory->use('Foo\\Bar\\SomeOtherClass'))\n            ->addStmt($factory->use('Foo\\Bar')->as('A'))\n            ->addStmt($factory->useFunction('strlen'))\n            ->addStmt($factory->useConst('PHP_VERSION'))\n            ->addStmt($factory\n                ->class('SomeClass')\n                ->extend('SomeOtherClass')\n                ->implement('A\\Few', '\\Interfaces')\n                ->addAttribute($factory->attribute('ClassAttribute', ['repository' => 'fqcn']))\n                ->makeAbstract()\n\n                ->addStmt($factory->useTrait('FirstTrait'))\n\n                ->addStmt($factory->useTrait('SecondTrait', 'ThirdTrait')\n                    ->and('AnotherTrait')\n                    ->with($factory->traitUseAdaptation('foo')->as('bar'))\n                    ->with($factory->traitUseAdaptation('AnotherTrait', 'baz')->as('test'))\n                    ->with($factory->traitUseAdaptation('AnotherTrait', 'func')->insteadof('SecondTrait')))\n\n                ->addStmt($factory->method('firstMethod')\n                    ->addAttribute($factory->attribute('Route', ['/index', 'name' => 'homepage']))\n                )\n\n                ->addStmt($factory->method('someMethod')\n                    ->makePublic()\n                    ->makeAbstract()\n                    ->addParam($factory->param('someParam')->setType('SomeClass'))\n                    ->setDocComment('/**\n                                      * This method does something.\n                                      *\n                                      * @param SomeClass And takes a parameter\n                                      */'))\n\n                ->addStmt($factory->method('anotherMethod')\n                    ->makeProtected()\n                    ->addParam($factory->param('someParam')\n                        ->setDefault('test')\n                        ->addAttribute($factory->attribute('TaggedIterator', ['app.handlers']))\n                    )\n                    ->addStmt(new Expr\\Print_(new Expr\\Variable('someParam'))))\n\n                ->addStmt($factory->property('someProperty')->makeProtected())\n                ->addStmt($factory->property('anotherProperty')\n                    ->makePrivate()\n                    ->setDefault([1, 2, 3]))\n                ->addStmt($factory->property('integerProperty')\n                    ->setType('int')\n                    ->addAttribute($factory->attribute('Column', ['options' => ['unsigned' => true]]))\n                    ->setDefault(1))\n                ->addStmt($factory->classConst('CONST_WITH_ATTRIBUTE', 1)\n                    ->makePublic()\n                    ->addAttribute($factory->attribute('ConstAttribute'))\n                )\n\n                ->addStmt($factory->classConst(\"FIRST_CLASS_CONST\", 1)\n                    ->addConst(\"SECOND_CLASS_CONST\", 2)\n                    ->makePrivate()))\n            ->getNode()\n        ;\n\n        $expected = <<<'EOC'\n<?php\n\nnamespace Name\\Space;\n\nuse Foo\\Bar\\SomeOtherClass;\nuse Foo\\Bar as A;\nuse function strlen;\nuse const PHP_VERSION;\n#[ClassAttribute(repository: 'fqcn')]\nabstract class SomeClass extends SomeOtherClass implements A\\Few, \\Interfaces\n{\n    use FirstTrait;\n    use SecondTrait, ThirdTrait, AnotherTrait {\n        foo as bar;\n        AnotherTrait::baz as test;\n        AnotherTrait::func insteadof SecondTrait;\n    }\n    #[ConstAttribute]\n    public const CONST_WITH_ATTRIBUTE = 1;\n    private const FIRST_CLASS_CONST = 1, SECOND_CLASS_CONST = 2;\n    protected $someProperty;\n    private $anotherProperty = [1, 2, 3];\n    #[Column(options: ['unsigned' => true])]\n    public int $integerProperty = 1;\n    #[Route('/index', name: 'homepage')]\n    function firstMethod()\n    {\n    }\n    /**\n     * This method does something.\n     *\n     * @param SomeClass And takes a parameter\n     */\n    abstract public function someMethod(SomeClass $someParam);\n    protected function anotherMethod(\n        #[TaggedIterator('app.handlers')]\n        $someParam = 'test'\n    )\n    {\n        print $someParam;\n    }\n}\nEOC;\n\n        $stmts = [$node];\n        $prettyPrinter = new PrettyPrinter\\Standard();\n        $generated = $prettyPrinter->prettyPrintFile($stmts);\n\n        $this->assertEquals(\n            str_replace(\"\\r\\n\", \"\\n\", $expected),\n            str_replace(\"\\r\\n\", \"\\n\", $generated)\n        );\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/BuilderHelpersTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Builder\\Class_;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name\\FullyQualified;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\Node\\Expr;\n\nclass BuilderHelpersTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testNormalizeNode(): void {\n        $builder = new Class_('SomeClass');\n        $this->assertEquals($builder->getNode(), BuilderHelpers::normalizeNode($builder));\n\n        $attribute = new Node\\Attribute(new Node\\Name('Test'));\n        $this->assertSame($attribute, BuilderHelpers::normalizeNode($attribute));\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected node or builder object');\n        BuilderHelpers::normalizeNode('test');\n    }\n\n    public function testNormalizeStmt(): void {\n        $stmt = new Node\\Stmt\\Class_('Class');\n        $this->assertSame($stmt, BuilderHelpers::normalizeStmt($stmt));\n\n        $expr = new Expr\\Variable('fn');\n        $normalizedExpr = BuilderHelpers::normalizeStmt($expr);\n        $this->assertEquals(new Stmt\\Expression($expr), $normalizedExpr);\n        $this->assertSame($expr, $normalizedExpr->expr);\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected statement or expression node');\n        BuilderHelpers::normalizeStmt(new Node\\Attribute(new Node\\Name('Test')));\n    }\n\n    public function testNormalizeStmtInvalidType(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected node or builder object');\n        BuilderHelpers::normalizeStmt('test');\n    }\n\n    public function testNormalizeIdentifier(): void {\n        $identifier = new Node\\Identifier('fn');\n        $this->assertSame($identifier, BuilderHelpers::normalizeIdentifier($identifier));\n        $this->assertEquals($identifier, BuilderHelpers::normalizeIdentifier('fn'));\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected string or instance of Node\\Identifier');\n        BuilderHelpers::normalizeIdentifier(1);\n    }\n\n    public function testNormalizeIdentifierOrExpr(): void {\n        $identifier = new Node\\Identifier('fn');\n        $this->assertSame($identifier, BuilderHelpers::normalizeIdentifierOrExpr($identifier));\n\n        $expr = new Expr\\Variable('fn');\n        $this->assertSame($expr, BuilderHelpers::normalizeIdentifierOrExpr($expr));\n        $this->assertEquals($identifier, BuilderHelpers::normalizeIdentifierOrExpr('fn'));\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Expected string or instance of Node\\Identifier');\n        BuilderHelpers::normalizeIdentifierOrExpr(1);\n    }\n\n    public function testNormalizeName(): void {\n        $name = new Node\\Name('test');\n        $this->assertSame($name, BuilderHelpers::normalizeName($name));\n        $this->assertEquals(\n            new Node\\Name\\FullyQualified(['Namespace', 'Test']),\n            BuilderHelpers::normalizeName('\\\\Namespace\\\\Test')\n        );\n        $this->assertEquals(\n            new Node\\Name\\Relative(['Test']),\n            BuilderHelpers::normalizeName('namespace\\\\Test')\n        );\n        $this->assertEquals($name, BuilderHelpers::normalizeName('test'));\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Name cannot be empty');\n        BuilderHelpers::normalizeName('');\n    }\n\n    public function testNormalizeNameInvalidType(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Name must be a string or an instance of Node\\Name');\n        BuilderHelpers::normalizeName(1);\n    }\n\n    public function testNormalizeNameOrExpr(): void {\n        $expr = new Expr\\Variable('fn');\n        $this->assertSame($expr, BuilderHelpers::normalizeNameOrExpr($expr));\n\n        $name = new Node\\Name('test');\n        $this->assertSame($name, BuilderHelpers::normalizeNameOrExpr($name));\n        $this->assertEquals(\n            new Node\\Name\\FullyQualified(['Namespace', 'Test']),\n            BuilderHelpers::normalizeNameOrExpr('\\\\Namespace\\\\Test')\n        );\n        $this->assertEquals(\n            new Node\\Name\\Relative(['Test']),\n            BuilderHelpers::normalizeNameOrExpr('namespace\\\\Test')\n        );\n        $this->assertEquals($name, BuilderHelpers::normalizeNameOrExpr('test'));\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Name cannot be empty');\n        BuilderHelpers::normalizeNameOrExpr('');\n    }\n\n    public function testNormalizeNameOrExpInvalidType(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Name must be a string or an instance of Node\\Name or Node\\Expr');\n        BuilderHelpers::normalizeNameOrExpr(1);\n    }\n\n    public function testNormalizeType(): void {\n        $this->assertEquals(new Node\\Identifier('array'), BuilderHelpers::normalizeType('array'));\n        $this->assertEquals(new Node\\Identifier('callable'), BuilderHelpers::normalizeType('callable'));\n        $this->assertEquals(new Node\\Identifier('string'), BuilderHelpers::normalizeType('string'));\n        $this->assertEquals(new Node\\Identifier('int'), BuilderHelpers::normalizeType('int'));\n        $this->assertEquals(new Node\\Identifier('float'), BuilderHelpers::normalizeType('float'));\n        $this->assertEquals(new Node\\Identifier('bool'), BuilderHelpers::normalizeType('bool'));\n        $this->assertEquals(new Node\\Identifier('iterable'), BuilderHelpers::normalizeType('iterable'));\n        $this->assertEquals(new Node\\Identifier('void'), BuilderHelpers::normalizeType('void'));\n        $this->assertEquals(new Node\\Identifier('object'), BuilderHelpers::normalizeType('object'));\n        $this->assertEquals(new Node\\Identifier('null'), BuilderHelpers::normalizeType('null'));\n        $this->assertEquals(new Node\\Identifier('false'), BuilderHelpers::normalizeType('false'));\n        $this->assertEquals(new Node\\Identifier('mixed'), BuilderHelpers::normalizeType('mixed'));\n        $this->assertEquals(new Node\\Identifier('never'), BuilderHelpers::normalizeType('never'));\n        $this->assertEquals(new Node\\Identifier('true'), BuilderHelpers::normalizeType('true'));\n\n        $intIdentifier = new Node\\Identifier('int');\n        $this->assertSame($intIdentifier, BuilderHelpers::normalizeType($intIdentifier));\n\n        $intName = new Node\\Name('int');\n        $this->assertSame($intName, BuilderHelpers::normalizeType($intName));\n\n        $intNullable = new Node\\NullableType(new Identifier('int'));\n        $this->assertSame($intNullable, BuilderHelpers::normalizeType($intNullable));\n\n        $unionType = new Node\\UnionType([new Node\\Identifier('int'), new Node\\Identifier('string')]);\n        $this->assertSame($unionType, BuilderHelpers::normalizeType($unionType));\n\n        $intersectionType = new Node\\IntersectionType([new Node\\Name('A'), new Node\\Name('B')]);\n        $this->assertSame($intersectionType, BuilderHelpers::normalizeType($intersectionType));\n\n        $expectedNullable = new Node\\NullableType($intIdentifier);\n        $nullable = BuilderHelpers::normalizeType('?int');\n        $this->assertEquals($expectedNullable, $nullable);\n        $this->assertEquals($intIdentifier, $nullable->type);\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Type must be a string, or an instance of Name, Identifier or ComplexType');\n        BuilderHelpers::normalizeType(1);\n    }\n\n    public function testNormalizeTypeNullableVoid(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('void type cannot be nullable');\n        BuilderHelpers::normalizeType('?void');\n    }\n\n    public function testNormalizeTypeNullableMixed(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('mixed type cannot be nullable');\n        BuilderHelpers::normalizeType('?mixed');\n    }\n\n    public function testNormalizeTypeNullableNever(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('never type cannot be nullable');\n        BuilderHelpers::normalizeType('?never');\n    }\n\n    public function testNormalizeValue(): void {\n        $expression = new Scalar\\Int_(1);\n        $this->assertSame($expression, BuilderHelpers::normalizeValue($expression));\n\n        $this->assertEquals(new Expr\\ConstFetch(new Node\\Name('null')), BuilderHelpers::normalizeValue(null));\n        $this->assertEquals(new Expr\\ConstFetch(new Node\\Name('true')), BuilderHelpers::normalizeValue(true));\n        $this->assertEquals(new Expr\\ConstFetch(new Node\\Name('false')), BuilderHelpers::normalizeValue(false));\n        $this->assertEquals(new Scalar\\Int_(2), BuilderHelpers::normalizeValue(2));\n        $this->assertEquals(new Scalar\\Float_(2.5), BuilderHelpers::normalizeValue(2.5));\n        $this->assertEquals(new Scalar\\String_('text'), BuilderHelpers::normalizeValue('text'));\n        $this->assertEquals(\n            new Expr\\Array_([\n                new Node\\ArrayItem(new Scalar\\Int_(0)),\n                new Node\\ArrayItem(new Scalar\\Int_(1), new Scalar\\String_('test')),\n            ]),\n            BuilderHelpers::normalizeValue([\n                0,\n                'test' => 1,\n            ])\n        );\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Invalid value');\n        BuilderHelpers::normalizeValue(new \\stdClass());\n    }\n\n    public function testNormalizeDocComment(): void {\n        $docComment = new Comment\\Doc('Some doc comment');\n        $this->assertSame($docComment, BuilderHelpers::normalizeDocComment($docComment));\n\n        $this->assertEquals($docComment, BuilderHelpers::normalizeDocComment('Some doc comment'));\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Doc comment must be a string or an instance of PhpParser\\Comment\\Doc');\n        BuilderHelpers::normalizeDocComment(1);\n    }\n\n    public function testNormalizeAttribute(): void {\n        $attribute = new Node\\Attribute(new Node\\Name('Test'));\n        $attributeGroup = new Node\\AttributeGroup([$attribute]);\n\n        $this->assertEquals($attributeGroup, BuilderHelpers::normalizeAttribute($attribute));\n        $this->assertSame($attributeGroup, BuilderHelpers::normalizeAttribute($attributeGroup));\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Attribute must be an instance of PhpParser\\Node\\Attribute or PhpParser\\Node\\AttributeGroup');\n        BuilderHelpers::normalizeAttribute('test');\n    }\n\n    public function testNormalizeValueEnum() {\n        if (\\PHP_VERSION_ID <= 80100) {\n            $this->markTestSkipped('Enums are supported since PHP 8.1');\n        }\n\n        include __DIR__ . '/../fixtures/Suit.php';\n\n        $this->assertEquals(new Expr\\ClassConstFetch(new FullyQualified(\\Suit::class), new Identifier('Hearts')), BuilderHelpers::normalizeValue(\\Suit::Hearts));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/CodeParsingTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Stmt;\n\nclass CodeParsingTest extends CodeTestAbstract {\n    /**\n     * @dataProvider provideTestParse\n     */\n    public function testParse($name, $code, $expected, $modeLine): void {\n        $modes = $this->parseModeLine($modeLine);\n        $parser = $this->createParser($modes['version'] ?? null);\n        list($stmts, $output) = $this->getParseOutput($parser, $code, $modes);\n\n        $this->assertSame($expected, $output, $name);\n        $this->checkAttributes($stmts);\n    }\n\n    public function createParser(?string $version): Parser {\n        $factory = new ParserFactory();\n        $version = $version === null\n            ? PhpVersion::getNewestSupported() : PhpVersion::fromString($version);\n        return $factory->createForVersion($version);\n    }\n\n    // Must be public for updateTests.php\n    public function getParseOutput(Parser $parser, $code, array $modes) {\n        $dumpPositions = isset($modes['positions']);\n        $dumpOtherAttributes = isset($modes['attributes']);\n\n        $errors = new ErrorHandler\\Collecting();\n        $stmts = $parser->parse($code, $errors);\n\n        $output = '';\n        foreach ($errors->getErrors() as $error) {\n            $output .= $this->formatErrorMessage($error, $code) . \"\\n\";\n        }\n\n        if (null !== $stmts) {\n            $dumper = new NodeDumper([\n                'dumpComments' => true,\n                'dumpPositions' => $dumpPositions,\n                'dumpOtherAttributes' => $dumpOtherAttributes,\n            ]);\n            $output .= $dumper->dump($stmts, $code);\n        }\n\n        return [$stmts, canonicalize($output)];\n    }\n\n    public static function provideTestParse() {\n        return self::getTests(__DIR__ . '/../code/parser', 'test');\n    }\n\n    private function formatErrorMessage(Error $e, $code) {\n        if ($e->hasColumnInfo()) {\n            return $e->getMessageWithColumnInfo($code);\n        }\n\n        return $e->getMessage();\n    }\n\n    private function checkAttributes($stmts): void {\n        if ($stmts === null) {\n            return;\n        }\n\n        $traverser = new NodeTraverser(new class () extends NodeVisitorAbstract {\n            public function enterNode(Node $node): void {\n                $startLine = $node->getStartLine();\n                $endLine = $node->getEndLine();\n                $startFilePos = $node->getStartFilePos();\n                $endFilePos = $node->getEndFilePos();\n                $startTokenPos = $node->getStartTokenPos();\n                $endTokenPos = $node->getEndTokenPos();\n                if ($startLine < 0 || $endLine < 0 ||\n                    $startFilePos < 0 || $endFilePos < 0 ||\n                    $startTokenPos < 0 || $endTokenPos < 0\n                ) {\n                    throw new \\Exception('Missing location information on ' . $node->getType());\n                }\n\n                if ($endLine < $startLine ||\n                    $endFilePos < $startFilePos ||\n                    $endTokenPos < $startTokenPos\n                ) {\n                    // Nop and Error can have inverted order, if they are empty.\n                    // This can also happen for a Param containing an Error.\n                    if (!$node instanceof Stmt\\Nop && !$node instanceof Expr\\Error &&\n                        !$node instanceof Node\\Param\n                    ) {\n                        throw new \\Exception('End < start on ' . $node->getType());\n                    }\n                }\n            }\n        });\n        $traverser->traverse($stmts);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/CodeTestAbstract.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nabstract class CodeTestAbstract extends \\PHPUnit\\Framework\\TestCase {\n    protected static function getTests($directory, $fileExtension, $chunksPerTest = 2) {\n        $parser = new CodeTestParser();\n        $allTests = [];\n        foreach (filesInDir($directory, $fileExtension) as $fileName => $fileContents) {\n            list($name, $tests) = $parser->parseTest($fileContents, $chunksPerTest);\n\n            // first part is the name\n            $name .= ' (' . $fileName . ')';\n            $shortName = ltrim(str_replace($directory, '', $fileName), '/\\\\');\n\n            // multiple sections possible with always two forming a pair\n            foreach ($tests as $i => list($mode, $parts)) {\n                $dataSetName = $shortName . (count($parts) > 1 ? '#' . $i : '');\n                $allTests[$dataSetName] = array_merge([$name], $parts, [$mode]);\n            }\n        }\n\n        return $allTests;\n    }\n\n    public function parseModeLine(?string $modeLine): array {\n        if ($modeLine === null) {\n            return [];\n        }\n\n        $modes = [];\n        foreach (explode(',', $modeLine) as $mode) {\n            $kv = explode('=', $mode, 2);\n            if (isset($kv[1])) {\n                $modes[$kv[0]] = $kv[1];\n            } else {\n                $modes[$kv[0]] = true;\n            }\n        }\n        return $modes;\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/CodeTestParser.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass CodeTestParser {\n    public function parseTest($code, $chunksPerTest) {\n        $code = canonicalize($code);\n\n        // evaluate @@{expr}@@ expressions\n        $code = preg_replace_callback(\n            '/@@\\{(.*?)\\}@@/',\n            function ($matches) {\n                return eval('return ' . $matches[1] . ';');\n            },\n            $code\n        );\n\n        // parse sections\n        $parts = preg_split(\"/\\n-----(?:\\n|$)/\", $code);\n\n        // first part is the name\n        $name = array_shift($parts);\n\n        // multiple sections possible with always two forming a pair\n        $chunks = array_chunk($parts, $chunksPerTest);\n        $tests = [];\n        foreach ($chunks as $chunk) {\n            $lastPart = array_pop($chunk);\n            list($lastPart, $mode) = $this->extractMode($lastPart);\n            $tests[] = [$mode, array_merge($chunk, [$lastPart])];\n        }\n\n        return [$name, $tests];\n    }\n\n    public function reconstructTest($name, array $tests) {\n        $result = $name;\n        foreach ($tests as list($mode, $parts)) {\n            $lastPart = array_pop($parts);\n            foreach ($parts as $part) {\n                $result .= \"\\n-----\\n$part\";\n            }\n\n            $result .= \"\\n-----\\n\";\n            if (null !== $mode) {\n                $result .= \"!!$mode\\n\";\n            }\n            $result .= $lastPart;\n        }\n        return $result . \"\\n\";\n    }\n\n    private function extractMode(string $expected): array {\n        $firstNewLine = strpos($expected, \"\\n\");\n        if (false === $firstNewLine) {\n            $firstNewLine = strlen($expected);\n        }\n\n        $firstLine = substr($expected, 0, $firstNewLine);\n        if (0 !== strpos($firstLine, '!!')) {\n            return [$expected, null];\n        }\n\n        $expected = substr($expected, $firstNewLine + 1);\n        return [$expected, substr($firstLine, 2)];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/CommentTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass CommentTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testGetters(): void {\n        $comment = new Comment('/* Some comment */',\n            1, 10, 2, 1, 27, 2);\n\n        $this->assertSame('/* Some comment */', $comment->getText());\n        $this->assertSame('/* Some comment */', (string) $comment);\n        $this->assertSame(1, $comment->getStartLine());\n        $this->assertSame(10, $comment->getStartFilePos());\n        $this->assertSame(2, $comment->getStartTokenPos());\n        $this->assertSame(1, $comment->getEndLine());\n        $this->assertSame(27, $comment->getEndFilePos());\n        $this->assertSame(2, $comment->getEndTokenPos());\n    }\n\n    /**\n     * @dataProvider provideTestReformatting\n     */\n    public function testReformatting($commentText, $reformattedText): void {\n        $comment = new Comment($commentText);\n        $this->assertSame($reformattedText, $comment->getReformattedText());\n    }\n\n    public static function provideTestReformatting() {\n        return [\n            ['// Some text', '// Some text'],\n            ['/* Some text */', '/* Some text */'],\n            [\n                \"/**\\n     * Some text.\\n     * Some more text.\\n     */\",\n                \"/**\\n * Some text.\\n * Some more text.\\n */\"\n            ],\n            [\n                \"/**\\r\\n     * Some text.\\r\\n     * Some more text.\\r\\n     */\",\n                \"/**\\n * Some text.\\n * Some more text.\\n */\"\n            ],\n            [\n                \"/*\\n        Some text.\\n        Some more text.\\n    */\",\n                \"/*\\n    Some text.\\n    Some more text.\\n*/\"\n            ],\n            [\n                \"/*\\r\\n        Some text.\\r\\n        Some more text.\\r\\n    */\",\n                \"/*\\n    Some text.\\n    Some more text.\\n*/\"\n            ],\n            [\n                \"/* Some text.\\n       More text.\\n       Even more text. */\",\n                \"/* Some text.\\n   More text.\\n   Even more text. */\"\n            ],\n            [\n                \"/* Some text.\\r\\n       More text.\\r\\n       Even more text. */\",\n                \"/* Some text.\\n   More text.\\n   Even more text. */\"\n            ],\n            [\n                \"/* Some text.\\n       More text.\\n         Indented text. */\",\n                \"/* Some text.\\n   More text.\\n     Indented text. */\",\n            ],\n            // invalid comment -> no reformatting\n            [\n                \"hello\\n    world\",\n                \"hello\\n    world\",\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/CompatibilityTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\InterpolatedStringPart;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Stmt;\n\nclass CompatibilityTest extends \\PHPUnit\\Framework\\TestCase {\n    /**\n     * @runInSeparateProcess\n     * @preserveGlobalState disabled\n     */\n    public function testAliases1(): void {\n        $var = new Expr\\Variable('x');\n        $node = new Node\\ClosureUse($var);\n        $this->assertTrue($node instanceof Expr\\ClosureUse);\n        $node = new Node\\ArrayItem($var);\n        $this->assertTrue($node instanceof Expr\\ArrayItem);\n        $node = new Node\\StaticVar($var);\n        $this->assertTrue($node instanceof Stmt\\StaticVar);\n        $node = new Scalar\\Float_(1.0);\n        $this->assertTrue($node instanceof Scalar\\DNumber);\n        $node = new Scalar\\Int_(1);\n        $this->assertTrue($node instanceof Scalar\\LNumber);\n        $part = new InterpolatedStringPart('foo');\n        $this->assertTrue($part instanceof Scalar\\EncapsedStringPart);\n        $node = new Scalar\\InterpolatedString([$part]);\n        $this->assertTrue($node instanceof Scalar\\Encapsed);\n        $node = new Node\\DeclareItem('strict_types', new Scalar\\Int_(1));\n        $this->assertTrue($node instanceof Stmt\\DeclareDeclare);\n        $node = new Node\\PropertyItem('x');\n        $this->assertTrue($node instanceof Stmt\\PropertyProperty);\n        $node = new Node\\UseItem(new Name('X'));\n        $this->assertTrue($node instanceof Stmt\\UseUse);\n    }\n\n    /**\n     * @runInSeparateProcess\n     * @preserveGlobalState disabled\n     */\n    public function testAliases2(): void {\n        $var = new Expr\\Variable('x');\n        $node = new Node\\Expr\\ClosureUse($var);\n        $this->assertTrue($node instanceof Node\\ClosureUse);\n        $node = new Node\\Expr\\ArrayItem($var);\n        $this->assertTrue($node instanceof Node\\ArrayItem);\n        $node = new Node\\Stmt\\StaticVar($var);\n        $this->assertTrue($node instanceof Node\\StaticVar);\n        $node = new Node\\Scalar\\DNumber(1.0);\n        $this->assertTrue($node instanceof Scalar\\Float_);\n        $node = new Node\\Scalar\\LNumber(1);\n        $this->assertTrue($node instanceof Scalar\\Int_);\n        $part = new Node\\Scalar\\EncapsedStringPart('foo');\n        $this->assertTrue($part instanceof Node\\InterpolatedStringPart);\n        $node = new Scalar\\Encapsed([$part]);\n        $this->assertTrue($node instanceof Scalar\\InterpolatedString);\n        $node = new Stmt\\DeclareDeclare('strict_types', new Scalar\\LNumber(1));\n        $this->assertTrue($node instanceof Node\\DeclareItem);\n        $node = new Stmt\\PropertyProperty('x');\n        $this->assertTrue($node instanceof Node\\PropertyItem);\n        $node = new Stmt\\UseUse(new Name('X'));\n        $this->assertTrue($node instanceof Node\\UseItem);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/ConstExprEvaluatorTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Scalar;\n\nclass ConstExprEvaluatorTest extends \\PHPUnit\\Framework\\TestCase {\n    /** @dataProvider provideTestEvaluate */\n    public function testEvaluate($exprString, $expected): void {\n        $parser = (new ParserFactory())->createForNewestSupportedVersion();\n        $expr = $parser->parse('<?php ' . $exprString . ';')[0]->expr;\n        $evaluator = new ConstExprEvaluator();\n        $this->assertSame($expected, $evaluator->evaluateDirectly($expr));\n    }\n\n    public static function provideTestEvaluate() {\n        return [\n            ['1', 1],\n            ['1.0', 1.0],\n            ['\"foo\"', \"foo\"],\n            ['[0, 1]', [0, 1]],\n            ['[\"foo\" => \"bar\"]', [\"foo\" => \"bar\"]],\n            ['[...[\"bar\"]]', [\"bar\"]],\n            ['[...[\"foo\" => \"bar\"]]', [\"foo\" => \"bar\"]],\n            ['[\"a\", \"b\" => \"b\", ...[\"b\" => \"bb\", \"c\"]]', [\"a\", \"b\" => \"bb\", \"c\"]],\n            ['NULL', null],\n            ['False', false],\n            ['true', true],\n            ['+1', 1],\n            ['-1', -1],\n            ['~0', -1],\n            ['!true', false],\n            ['[0][0]', 0],\n            ['\"a\"[0]', \"a\"],\n            ['true ? 1 : (1/0)', 1],\n            ['false ? (1/0) : 1', 1],\n            ['42 ?: (1/0)', 42],\n            ['false ?: 42', 42],\n            ['false ?? 42', false],\n            ['null ?? 42', 42],\n            ['[0][0] ?? 42', 0],\n            ['[][0] ?? 42', 42],\n            ['0b11 & 0b10', 0b10],\n            ['0b11 | 0b10', 0b11],\n            ['0b11 ^ 0b10', 0b01],\n            ['1 << 2', 4],\n            ['4 >> 2', 1],\n            ['\"a\" . \"b\"', \"ab\"],\n            ['4 + 2', 6],\n            ['4 - 2', 2],\n            ['4 * 2', 8],\n            ['4 / 2', 2],\n            ['4 % 2', 0],\n            ['4 ** 2', 16],\n            ['1 == 1.0', true],\n            ['1 != 1.0', false],\n            ['1 < 2.0', true],\n            ['1 <= 2.0', true],\n            ['1 > 2.0', false],\n            ['1 >= 2.0', false],\n            ['1 <=> 2.0', -1],\n            ['1 === 1.0', false],\n            ['1 !== 1.0', true],\n            ['true && true', true],\n            ['true and true', true],\n            ['false && (1/0)', false],\n            ['false and (1/0)', false],\n            ['false || false', false],\n            ['false or false', false],\n            ['true || (1/0)', true],\n            ['true or (1/0)', true],\n            ['true xor false', true],\n            ['\"foo\" |> \"strlen\"', 3],\n        ];\n    }\n\n    public function testEvaluateFails(): void {\n        $this->expectException(ConstExprEvaluationException::class);\n        $this->expectExceptionMessage('Expression of type Expr_Variable cannot be evaluated');\n        $evaluator = new ConstExprEvaluator();\n        $evaluator->evaluateDirectly(new Expr\\Variable('a'));\n    }\n\n    public function testEvaluateFallback(): void {\n        $evaluator = new ConstExprEvaluator(function (Expr $expr) {\n            if ($expr instanceof Scalar\\MagicConst\\Line) {\n                return 42;\n            }\n            throw new ConstExprEvaluationException();\n        });\n        $expr = new Expr\\BinaryOp\\Plus(\n            new Scalar\\Int_(8),\n            new Scalar\\MagicConst\\Line()\n        );\n        $this->assertSame(50, $evaluator->evaluateDirectly($expr));\n    }\n\n    /**\n     * @dataProvider provideTestEvaluateSilently\n     */\n    public function testEvaluateSilently($expr, $exception, $msg): void {\n        $evaluator = new ConstExprEvaluator();\n\n        try {\n            $evaluator->evaluateSilently($expr);\n        } catch (ConstExprEvaluationException $e) {\n            $this->assertSame(\n                'An error occurred during constant expression evaluation',\n                $e->getMessage()\n            );\n\n            $prev = $e->getPrevious();\n            $this->assertInstanceOf($exception, $prev);\n            $this->assertSame($msg, $prev->getMessage());\n        }\n    }\n\n    public static function provideTestEvaluateSilently() {\n        return [\n            [\n                new Expr\\BinaryOp\\Mod(new Scalar\\Int_(42), new Scalar\\Int_(0)),\n                \\Error::class,\n                'Modulo by zero'\n            ],\n            [\n                new Expr\\BinaryOp\\Plus(new Scalar\\Int_(42), new Scalar\\String_(\"1foo\")),\n                \\ErrorException::class,\n                \\PHP_VERSION_ID >= 80000\n                    ? 'A non-numeric value encountered'\n                    : 'A non well formed numeric value encountered'\n            ],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/ErrorHandler/CollectingTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\ErrorHandler;\n\nuse PhpParser\\Error;\n\nclass CollectingTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testHandleError(): void {\n        $errorHandler = new Collecting();\n        $this->assertFalse($errorHandler->hasErrors());\n        $this->assertEmpty($errorHandler->getErrors());\n\n        $errorHandler->handleError($e1 = new Error('Test 1'));\n        $errorHandler->handleError($e2 = new Error('Test 2'));\n        $this->assertTrue($errorHandler->hasErrors());\n        $this->assertSame([$e1, $e2], $errorHandler->getErrors());\n\n        $errorHandler->clearErrors();\n        $this->assertFalse($errorHandler->hasErrors());\n        $this->assertEmpty($errorHandler->getErrors());\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/ErrorHandler/ThrowingTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\ErrorHandler;\n\nuse PhpParser\\Error;\n\nclass ThrowingTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testHandleError(): void {\n        $this->expectException(Error::class);\n        $this->expectExceptionMessage('Test');\n        $errorHandler = new Throwing();\n        $errorHandler->handleError(new Error('Test'));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/ErrorTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass ErrorTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testConstruct() {\n        $attributes = [\n            'startLine' => 10,\n            'endLine' => 11,\n        ];\n        $error = new Error('Some error', $attributes);\n\n        $this->assertSame('Some error', $error->getRawMessage());\n        $this->assertSame($attributes, $error->getAttributes());\n        $this->assertSame(10, $error->getStartLine());\n        $this->assertSame(11, $error->getEndLine());\n        $this->assertSame('Some error on line 10', $error->getMessage());\n\n        return $error;\n    }\n\n    /**\n     * @depends testConstruct\n     */\n    public function testSetMessageAndLine(Error $error): void {\n        $error->setRawMessage('Some other error');\n        $this->assertSame('Some other error', $error->getRawMessage());\n\n        $error->setStartLine(15);\n        $this->assertSame(15, $error->getStartLine());\n        $this->assertSame('Some other error on line 15', $error->getMessage());\n    }\n\n    public function testUnknownLine(): void {\n        $error = new Error('Some error');\n\n        $this->assertSame(-1, $error->getStartLine());\n        $this->assertSame(-1, $error->getEndLine());\n        $this->assertSame('Some error on unknown line', $error->getMessage());\n    }\n\n    /** @dataProvider provideTestColumnInfo */\n    public function testColumnInfo($code, $startPos, $endPos, $startColumn, $endColumn): void {\n        $error = new Error('Some error', [\n            'startFilePos' => $startPos,\n            'endFilePos' => $endPos,\n        ]);\n\n        $this->assertTrue($error->hasColumnInfo());\n        $this->assertSame($startColumn, $error->getStartColumn($code));\n        $this->assertSame($endColumn, $error->getEndColumn($code));\n    }\n\n    public static function provideTestColumnInfo() {\n        return [\n            // Error at \"bar\"\n            [\"<?php foo bar baz\", 10, 12, 11, 13],\n            [\"<?php\\nfoo bar baz\", 10, 12, 5, 7],\n            [\"<?php foo\\nbar baz\", 10, 12, 1, 3],\n            [\"<?php foo bar\\nbaz\", 10, 12, 11, 13],\n            [\"<?php\\r\\nfoo bar baz\", 11, 13, 5, 7],\n            // Error at \"baz\"\n            [\"<?php foo bar baz\", 14, 16, 15, 17],\n            [\"<?php foo bar\\nbaz\", 14, 16, 1, 3],\n            // Error at string literal\n            [\"<?php foo 'bar\\nbaz' xyz\", 10, 18, 11, 4],\n            [\"<?php\\nfoo 'bar\\nbaz' xyz\", 10, 18, 5, 4],\n            [\"<?php foo\\n'\\nbarbaz\\n'\\nxyz\", 10, 19, 1, 1],\n            // Error over full string\n            [\"<?php\", 0, 4, 1, 5],\n            [\"<?\\nphp\", 0, 5, 1, 3],\n        ];\n    }\n\n    public function testNoColumnInfo(): void {\n        $error = new Error('Some error', ['startLine' => 3]);\n\n        $this->assertFalse($error->hasColumnInfo());\n        try {\n            $error->getStartColumn('');\n            $this->fail('Expected RuntimeException');\n        } catch (\\RuntimeException $e) {\n            $this->assertSame('Error does not have column information', $e->getMessage());\n        }\n        try {\n            $error->getEndColumn('');\n            $this->fail('Expected RuntimeException');\n        } catch (\\RuntimeException $e) {\n            $this->assertSame('Error does not have column information', $e->getMessage());\n        }\n    }\n\n    public function testInvalidPosInfo(): void {\n        $this->expectException(\\RuntimeException::class);\n        $this->expectExceptionMessage('Invalid position information');\n        $error = new Error('Some error', [\n            'startFilePos' => 10,\n            'endFilePos' => 11,\n        ]);\n        $error->getStartColumn('code');\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Internal/DifferTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Internal;\n\nclass DifferTest extends \\PHPUnit\\Framework\\TestCase {\n    private function formatDiffString(array $diff) {\n        $diffStr = '';\n        foreach ($diff as $diffElem) {\n            switch ($diffElem->type) {\n                case DiffElem::TYPE_KEEP:\n                    $diffStr .= $diffElem->old;\n                    break;\n                case DiffElem::TYPE_REMOVE:\n                    $diffStr .= '-' . $diffElem->old;\n                    break;\n                case DiffElem::TYPE_ADD:\n                    $diffStr .= '+' . $diffElem->new;\n                    break;\n                case DiffElem::TYPE_REPLACE:\n                    $diffStr .= '/' . $diffElem->old . $diffElem->new;\n                    break;\n                default:\n                    assert(false);\n                    break;\n            }\n        }\n        return $diffStr;\n    }\n\n    /** @dataProvider provideTestDiff */\n    public function testDiff($oldStr, $newStr, $expectedDiffStr): void {\n        $differ = new Differ(function ($a, $b) {\n            return $a === $b;\n        });\n        $diff = $differ->diff(str_split($oldStr), str_split($newStr));\n        $this->assertSame($expectedDiffStr, $this->formatDiffString($diff));\n    }\n\n    public static function provideTestDiff() {\n        return [\n            ['abc', 'abc', 'abc'],\n            ['abc', 'abcdef', 'abc+d+e+f'],\n            ['abcdef', 'abc', 'abc-d-e-f'],\n            ['abcdef', 'abcxyzdef', 'abc+x+y+zdef'],\n            ['axyzb', 'ab', 'a-x-y-zb'],\n            ['abcdef', 'abxyef', 'ab-c-d+x+yef'],\n            ['abcdef', 'cdefab', '-a-bcdef+a+b'],\n        ];\n    }\n\n    /** @dataProvider provideTestDiffWithReplacements */\n    public function testDiffWithReplacements($oldStr, $newStr, $expectedDiffStr): void {\n        $differ = new Differ(function ($a, $b) {\n            return $a === $b;\n        });\n        $diff = $differ->diffWithReplacements(str_split($oldStr), str_split($newStr));\n        $this->assertSame($expectedDiffStr, $this->formatDiffString($diff));\n    }\n\n    public static function provideTestDiffWithReplacements() {\n        return [\n            ['abcde', 'axyze', 'a/bx/cy/dze'],\n            ['abcde', 'xbcdy', '/axbcd/ey'],\n            ['abcde', 'axye', 'a-b-c-d+x+ye'],\n            ['abcde', 'axyzue', 'a-b-c-d+x+y+z+ue'],\n        ];\n    }\n\n    public function testNonContiguousIndices(): void {\n        $differ = new Differ(function ($a, $b) {\n            return $a === $b;\n        });\n        $diff = $differ->diff([0 => 'a', 2 => 'b'], [0 => 'a', 3 => 'b']);\n        $this->assertEquals([\n            new DiffElem(DiffElem::TYPE_KEEP, 'a', 'a'),\n            new DiffElem(DiffElem::TYPE_KEEP, 'b', 'b'),\n        ], $diff);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/JsonDecoderTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass JsonDecoderTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testRoundTrip(): void {\n        $code = <<<'PHP'\n<?php\n// comment\n/** doc comment */\nfunction functionName(&$a = 0, $b = 1.0) {\n    echo 'Foo';\n}\nPHP;\n\n        $parser = new Parser\\Php7(new Lexer());\n        $stmts = $parser->parse($code);\n        $json = json_encode($stmts);\n\n        $jsonDecoder = new JsonDecoder();\n        $decodedStmts = $jsonDecoder->decode($json);\n        $this->assertEquals($stmts, $decodedStmts);\n    }\n\n    /** @dataProvider provideTestDecodingError */\n    public function testDecodingError($json, $expectedMessage): void {\n        $jsonDecoder = new JsonDecoder();\n        $this->expectException(\\RuntimeException::class);\n        $this->expectExceptionMessage($expectedMessage);\n        $jsonDecoder->decode($json);\n    }\n\n    public static function provideTestDecodingError() {\n        return [\n            ['???', 'JSON decoding error: Syntax error'],\n            ['{\"nodeType\":123}', 'Node type must be a string'],\n            ['{\"nodeType\":\"Name\",\"attributes\":123}', 'Attributes must be an array'],\n            ['{\"nodeType\":\"Comment\"}', 'Comment must have text'],\n            ['{\"nodeType\":\"xxx\"}', 'Unknown node type \"xxx\"'],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Lexer/EmulativeTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Lexer;\n\nuse PhpParser\\ErrorHandler;\nuse PhpParser\\Lexer;\nuse PhpParser\\LexerTest;\nuse PhpParser\\Parser\\Php7;\nuse PhpParser\\PhpVersion;\nuse PhpParser\\Token;\n\nrequire __DIR__ . '/../../../lib/PhpParser/compatibility_tokens.php';\n\nclass EmulativeTest extends LexerTest {\n    protected function getLexer() {\n        return new Emulative();\n    }\n\n    /**\n     * @dataProvider provideTestReplaceKeywords\n     */\n    public function testReplaceKeywords(string $keyword, int $expectedToken): void {\n        $lexer = $this->getLexer();\n        $code = '<?php ' . $keyword;\n        $this->assertEquals([\n            new Token(\\T_OPEN_TAG, '<?php ', 1, 0),\n            new Token($expectedToken, $keyword, 1, 6),\n            new Token(0, \"\\0\", 1, \\strlen($code)),\n        ], $lexer->tokenize($code));\n    }\n\n    /**\n     * @dataProvider provideTestReplaceKeywords\n     */\n    public function testReplaceKeywordsUppercase(string $keyword, int $expectedToken): void {\n        $lexer = $this->getLexer();\n        $code = '<?php ' . strtoupper($keyword);\n\n        $this->assertEquals([\n            new Token(\\T_OPEN_TAG, '<?php ', 1, 0),\n            new Token($expectedToken, \\strtoupper($keyword), 1, 6),\n            new Token(0, \"\\0\", 1, \\strlen($code)),\n        ], $lexer->tokenize($code));\n    }\n\n    /**\n     * @dataProvider provideTestReplaceKeywords\n     */\n    public function testNoReplaceKeywordsAfterObjectOperator(string $keyword): void {\n        $lexer = $this->getLexer();\n        $code = '<?php ->' . $keyword;\n\n        $this->assertEquals([\n            new Token(\\T_OPEN_TAG, '<?php ', 1, 0),\n            new Token(\\T_OBJECT_OPERATOR, '->', 1, 6),\n            new Token(\\T_STRING, $keyword, 1, 8),\n            new Token(0, \"\\0\", 1, \\strlen($code)),\n        ], $lexer->tokenize($code));\n    }\n\n    /**\n     * @dataProvider provideTestReplaceKeywords\n     */\n    public function testNoReplaceKeywordsAfterObjectOperatorWithSpaces(string $keyword): void {\n        $lexer = $this->getLexer();\n        $code = '<?php ->    ' . $keyword;\n\n        $this->assertEquals([\n            new Token(\\T_OPEN_TAG, '<?php ', 1, 0),\n            new Token(\\T_OBJECT_OPERATOR, '->', 1, 6),\n            new Token(\\T_WHITESPACE, '    ', 1, 8),\n            new Token(\\T_STRING, $keyword, 1, 12),\n            new Token(0, \"\\0\", 1, \\strlen($code)),\n        ], $lexer->tokenize($code));\n    }\n\n    /**\n     * @dataProvider provideTestReplaceKeywords\n     */\n    public function testNoReplaceKeywordsAfterNullsafeObjectOperator(string $keyword): void {\n        $lexer = $this->getLexer();\n        $code = '<?php ?->' . $keyword;\n\n        $this->assertEquals([\n            new Token(\\T_OPEN_TAG, '<?php ', 1, 0),\n            new Token(\\T_NULLSAFE_OBJECT_OPERATOR, '?->', 1, 6),\n            new Token(\\T_STRING, $keyword, 1, 9),\n            new Token(0, \"\\0\", 1, \\strlen($code)),\n        ], $lexer->tokenize($code));\n    }\n\n    public static function provideTestReplaceKeywords() {\n        return [\n            // PHP 8.4\n            ['__PROPERTY__', \\T_PROPERTY_C],\n\n            // PHP 8.0\n            ['match',         \\T_MATCH],\n\n            // PHP 7.4\n            ['fn',            \\T_FN],\n\n            // PHP 5.5\n            ['finally',       \\T_FINALLY],\n            ['yield',         \\T_YIELD],\n\n            // PHP 5.4\n            ['callable',      \\T_CALLABLE],\n            ['insteadof',     \\T_INSTEADOF],\n            ['trait',         \\T_TRAIT],\n            ['__TRAIT__',     \\T_TRAIT_C],\n\n            // PHP 5.3\n            ['__DIR__',       \\T_DIR],\n            ['goto',          \\T_GOTO],\n            ['namespace',     \\T_NAMESPACE],\n            ['__NAMESPACE__', \\T_NS_C],\n        ];\n    }\n\n    private function assertSameTokens(array $expectedTokens, array $tokens): void {\n        $reducedTokens = [];\n        foreach ($tokens as $token) {\n            if ($token->id === 0 || $token->isIgnorable()) {\n                continue;\n            }\n            $reducedTokens[] = [$token->id, $token->text];\n        }\n        $this->assertSame($expectedTokens, $reducedTokens);\n    }\n\n    /**\n     * @dataProvider provideTestLexNewFeatures\n     */\n    public function testLexNewFeatures(string $code, array $expectedTokens): void {\n        $lexer = $this->getLexer();\n        $this->assertSameTokens($expectedTokens, $lexer->tokenize('<?php ' . $code));\n    }\n\n    /**\n     * @dataProvider provideTestLexNewFeatures\n     */\n    public function testLeaveStuffAloneInStrings(string $code): void {\n        $stringifiedToken = '\"' . addcslashes($code, '\"\\\\') . '\"';\n\n        $lexer = $this->getLexer();\n        $fullCode = '<?php ' . $stringifiedToken;\n\n        $this->assertEquals([\n            new Token(\\T_OPEN_TAG, '<?php ', 1, 0),\n            new Token(\\T_CONSTANT_ENCAPSED_STRING, $stringifiedToken, 1, 6),\n            new Token(0, \"\\0\", \\substr_count($fullCode, \"\\n\") + 1, \\strlen($fullCode)),\n        ], $lexer->tokenize($fullCode));\n    }\n\n    /**\n     * @dataProvider provideTestLexNewFeatures\n     */\n    public function testErrorAfterEmulation($code): void {\n        $errorHandler = new ErrorHandler\\Collecting();\n        $lexer = $this->getLexer();\n        $lexer->tokenize('<?php ' . $code . \"\\0\", $errorHandler);\n\n        $errors = $errorHandler->getErrors();\n        $this->assertCount(1, $errors);\n\n        $error = $errors[0];\n        $this->assertSame('Unexpected null byte', $error->getRawMessage());\n\n        $attrs = $error->getAttributes();\n        $expPos = strlen('<?php ' . $code);\n        $expLine = 1 + substr_count('<?php ' . $code, \"\\n\");\n        $this->assertSame($expPos, $attrs['startFilePos']);\n        $this->assertSame($expPos, $attrs['endFilePos']);\n        $this->assertSame($expLine, $attrs['startLine']);\n        $this->assertSame($expLine, $attrs['endLine']);\n    }\n\n    public static function provideTestLexNewFeatures() {\n        return [\n            ['yield from', [\n                [\\T_YIELD_FROM, 'yield from'],\n            ]],\n            [\"yield\\r\\nfrom\", [\n                [\\T_YIELD_FROM, \"yield\\r\\nfrom\"],\n            ]],\n            ['...', [\n                [\\T_ELLIPSIS, '...'],\n            ]],\n            ['**', [\n                [\\T_POW, '**'],\n            ]],\n            ['**=', [\n                [\\T_POW_EQUAL, '**='],\n            ]],\n            ['??', [\n                [\\T_COALESCE, '??'],\n            ]],\n            ['<=>', [\n                [\\T_SPACESHIP, '<=>'],\n            ]],\n            ['0b1010110', [\n                [\\T_LNUMBER, '0b1010110'],\n            ]],\n            ['0b1011010101001010110101010010101011010101010101101011001110111100', [\n                [\\T_DNUMBER, '0b1011010101001010110101010010101011010101010101101011001110111100'],\n            ]],\n            ['\\\\', [\n                [\\T_NS_SEPARATOR, '\\\\'],\n            ]],\n            [\"<<<'NOWDOC'\\nNOWDOC;\\n\", [\n                [\\T_START_HEREDOC, \"<<<'NOWDOC'\\n\"],\n                [\\T_END_HEREDOC, 'NOWDOC'],\n                [ord(';'), ';'],\n            ]],\n            [\"<<<'NOWDOC'\\nFoobar\\nNOWDOC;\\n\", [\n                [\\T_START_HEREDOC, \"<<<'NOWDOC'\\n\"],\n                [\\T_ENCAPSED_AND_WHITESPACE, \"Foobar\\n\"],\n                [\\T_END_HEREDOC, 'NOWDOC'],\n                [ord(';'), ';'],\n            ]],\n\n            // PHP 7.3: Flexible heredoc/nowdoc\n            [\"<<<LABEL\\nLABEL,\", [\n                [\\T_START_HEREDOC, \"<<<LABEL\\n\"],\n                [\\T_END_HEREDOC, \"LABEL\"],\n                [ord(','), ','],\n            ]],\n            [\"<<<LABEL\\n    LABEL,\", [\n                [\\T_START_HEREDOC, \"<<<LABEL\\n\"],\n                [\\T_END_HEREDOC, \"    LABEL\"],\n                [ord(','), ','],\n            ]],\n            [\"<<<LABEL\\n    Foo\\n  LABEL;\", [\n                [\\T_START_HEREDOC, \"<<<LABEL\\n\"],\n                [\\T_ENCAPSED_AND_WHITESPACE, \"    Foo\\n\"],\n                [\\T_END_HEREDOC, \"  LABEL\"],\n                [ord(';'), ';'],\n            ]],\n            [\"<<<A\\n A,<<<A\\n A,\", [\n                [\\T_START_HEREDOC, \"<<<A\\n\"],\n                [\\T_END_HEREDOC, \" A\"],\n                [ord(','), ','],\n                [\\T_START_HEREDOC, \"<<<A\\n\"],\n                [\\T_END_HEREDOC, \" A\"],\n                [ord(','), ','],\n            ]],\n            [\"<<<LABEL\\nLABELNOPE\\nLABEL\\n\", [\n                [\\T_START_HEREDOC, \"<<<LABEL\\n\"],\n                [\\T_ENCAPSED_AND_WHITESPACE, \"LABELNOPE\\n\"],\n                [\\T_END_HEREDOC, \"LABEL\"],\n            ]],\n            // Interpretation changed\n            [\"<<<LABEL\\n    LABEL\\nLABEL\\n\", [\n                [\\T_START_HEREDOC, \"<<<LABEL\\n\"],\n                [\\T_END_HEREDOC, \"    LABEL\"],\n                [\\T_STRING, \"LABEL\"],\n            ]],\n\n            // PHP 7.4: Null coalesce equal\n            ['??=', [\n                [\\T_COALESCE_EQUAL, '??='],\n            ]],\n\n            // PHP 7.4: Number literal separator\n            ['1_000', [\n                [\\T_LNUMBER, '1_000'],\n            ]],\n            ['0x7AFE_F00D', [\n                [\\T_LNUMBER, '0x7AFE_F00D'],\n            ]],\n            ['0b0101_1111', [\n                [\\T_LNUMBER, '0b0101_1111'],\n            ]],\n            ['0137_041', [\n                [\\T_LNUMBER, '0137_041'],\n            ]],\n            ['1_000.0', [\n                [\\T_DNUMBER, '1_000.0'],\n            ]],\n            ['1_0.0', [\n                [\\T_DNUMBER, '1_0.0']\n            ]],\n            ['1_000_000_000.0', [\n                [\\T_DNUMBER, '1_000_000_000.0']\n            ]],\n            ['0e1_0', [\n                [\\T_DNUMBER, '0e1_0']\n            ]],\n            ['1_0e+10', [\n                [\\T_DNUMBER, '1_0e+10']\n            ]],\n            ['1_0e-10', [\n                [\\T_DNUMBER, '1_0e-10']\n            ]],\n            ['0b1011010101001010_110101010010_10101101010101_0101101011001_110111100', [\n                [\\T_DNUMBER, '0b1011010101001010_110101010010_10101101010101_0101101011001_110111100'],\n            ]],\n            ['0xFFFF_FFFF_FFFF_FFFF', [\n                [\\T_DNUMBER, '0xFFFF_FFFF_FFFF_FFFF'],\n            ]],\n            ['1_000+1', [\n                [\\T_LNUMBER, '1_000'],\n                [ord('+'), '+'],\n                [\\T_LNUMBER, '1'],\n            ]],\n            ['1_0abc', [\n                [\\T_LNUMBER, '1_0'],\n                [\\T_STRING, 'abc'],\n            ]],\n            ['?->', [\n                [\\T_NULLSAFE_OBJECT_OPERATOR, '?->'],\n            ]],\n            ['#[Attr]', [\n                [\\T_ATTRIBUTE, '#['],\n                [\\T_STRING, 'Attr'],\n                [ord(']'), ']'],\n            ]],\n            [\"#[\\nAttr\\n]\", [\n                [\\T_ATTRIBUTE, '#['],\n                [\\T_STRING, 'Attr'],\n                [ord(']'), ']'],\n            ]],\n            // Test interaction of two patch-based emulators\n            [\"<<<LABEL\\n    LABEL, #[Attr]\", [\n                [\\T_START_HEREDOC, \"<<<LABEL\\n\"],\n                [\\T_END_HEREDOC, \"    LABEL\"],\n                [ord(','), ','],\n                [\\T_ATTRIBUTE, '#['],\n                [\\T_STRING, 'Attr'],\n                [ord(']'), ']'],\n            ]],\n            [\"#[Attr] <<<LABEL\\n    LABEL,\", [\n                [\\T_ATTRIBUTE, '#['],\n                [\\T_STRING, 'Attr'],\n                [ord(']'), ']'],\n                [\\T_START_HEREDOC, \"<<<LABEL\\n\"],\n                [\\T_END_HEREDOC, \"    LABEL\"],\n                [ord(','), ','],\n            ]],\n            // Enums use a contextual keyword\n            ['enum Foo {}', [\n                [\\T_ENUM, 'enum'],\n                [\\T_STRING, 'Foo'],\n                [ord('{'), '{'],\n                [ord('}'), '}'],\n            ]],\n            ['class Enum {}', [\n                [\\T_CLASS, 'class'],\n                [\\T_STRING, 'Enum'],\n                [ord('{'), '{'],\n                [ord('}'), '}'],\n            ]],\n            ['class Enum extends X {}', [\n                [\\T_CLASS, 'class'],\n                [\\T_STRING, 'Enum'],\n                [\\T_EXTENDS, 'extends'],\n                [\\T_STRING, 'X'],\n                [ord('{'), '{'],\n                [ord('}'), '}'],\n            ]],\n            ['class Enum implements X {}', [\n                [\\T_CLASS, 'class'],\n                [\\T_STRING, 'Enum'],\n                [\\T_IMPLEMENTS, 'implements'],\n                [\\T_STRING, 'X'],\n                [ord('{'), '{'],\n                [ord('}'), '}'],\n            ]],\n            ['0o123', [\n                [\\T_LNUMBER, '0o123'],\n            ]],\n            ['0O123', [\n                [\\T_LNUMBER, '0O123'],\n            ]],\n            ['0o1_2_3', [\n                [\\T_LNUMBER, '0o1_2_3'],\n            ]],\n            ['0o1000000000000000000000', [\n                [\\T_DNUMBER, '0o1000000000000000000000'],\n            ]],\n            ['readonly class', [\n                [\\T_READONLY, 'readonly'],\n                [\\T_CLASS, 'class'],\n            ]],\n            ['function readonly(', [\n                [\\T_FUNCTION, 'function'],\n                [\\T_READONLY, 'readonly'],\n                [ord('('), '('],\n            ]],\n            ['function readonly (', [\n                [\\T_FUNCTION, 'function'],\n                [\\T_READONLY, 'readonly'],\n                [ord('('), '('],\n            ]],\n\n            // PHP 8.4: Asymmetric visibility modifiers\n            ['private(set)', [\n                [\\T_PRIVATE_SET, 'private(set)']\n            ]],\n            ['PROTECTED(SET)', [\n                [\\T_PROTECTED_SET, 'PROTECTED(SET)']\n            ]],\n            ['Public(Set)', [\n                [\\T_PUBLIC_SET, 'Public(Set)']\n            ]],\n            ['public (set)', [\n                [\\T_PUBLIC, 'public'],\n                [\\ord('('), '('],\n                [\\T_STRING, 'set'],\n                [\\ord(')'), ')'],\n            ]],\n            ['->public(set)', [\n                [\\T_OBJECT_OPERATOR, '->'],\n                [\\T_STRING, 'public'],\n                [\\ord('('), '('],\n                [\\T_STRING, 'set'],\n                [\\ord(')'), ')'],\n            ]],\n            ['?-> public(set)', [\n                [\\T_NULLSAFE_OBJECT_OPERATOR, '?->'],\n                [\\T_STRING, 'public'],\n                [\\ord('('), '('],\n                [\\T_STRING, 'set'],\n                [\\ord(')'), ')'],\n            ]],\n\n            // PHP 8.5: Pipe operator\n            ['|>', [\n                [\\T_PIPE, '|>']\n            ]],\n\n            // PHP 8.5: Void cast\n            ['(void)', [\n                [\\T_VOID_CAST, '(void)'],\n            ]],\n            [\"( \\tvoid \\t)\", [\n                [\\T_VOID_CAST, \"( \\tvoid \\t)\"],\n            ]],\n            ['( vOiD)', [\n                [\\T_VOID_CAST, '( vOiD)'],\n            ]],\n            [\"(void\\n)\", [\n                [\\ord('('), '('],\n                [\\T_STRING, 'void'],\n                [\\ord(')'), ')'],\n            ]],\n        ];\n    }\n\n    /**\n     * @dataProvider provideTestTargetVersion\n     */\n    public function testTargetVersion(string $phpVersion, string $code, array $expectedTokens): void {\n        $lexer = new Emulative(PhpVersion::fromString($phpVersion));\n        $this->assertSameTokens($expectedTokens, $lexer->tokenize('<?php ' . $code));\n    }\n\n    public static function provideTestTargetVersion() {\n        return [\n            ['8.0', 'match', [[\\T_MATCH, 'match']]],\n            ['7.4', 'match', [[\\T_STRING, 'match']]],\n            // Keywords are not case-sensitive.\n            ['8.0', 'MATCH', [[\\T_MATCH, 'MATCH']]],\n            ['7.4', 'MATCH', [[\\T_STRING, 'MATCH']]],\n            // Tested here to skip testLeaveStuffAloneInStrings.\n            ['8.0', '\"$foo?->bar\"', [\n                [ord('\"'), '\"'],\n                [\\T_VARIABLE, '$foo'],\n                [\\T_NULLSAFE_OBJECT_OPERATOR, '?->'],\n                [\\T_STRING, 'bar'],\n                [ord('\"'), '\"'],\n            ]],\n            ['8.0', '\"$foo?->bar baz\"', [\n                [ord('\"'), '\"'],\n                [\\T_VARIABLE, '$foo'],\n                [\\T_NULLSAFE_OBJECT_OPERATOR, '?->'],\n                [\\T_STRING, 'bar'],\n                [\\T_ENCAPSED_AND_WHITESPACE, ' baz'],\n                [ord('\"'), '\"'],\n            ]],\n            ['8.4', '__PROPERTY__', [[\\T_PROPERTY_C, '__PROPERTY__']]],\n            ['8.3', '__PROPERTY__', [[\\T_STRING, '__PROPERTY__']]],\n            ['8.4', '__property__', [[\\T_PROPERTY_C, '__property__']]],\n            ['8.3', '__property__', [[\\T_STRING, '__property__']]],\n            ['8.4', 'public(set)', [\n                [\\T_PUBLIC_SET, 'public(set)'],\n            ]],\n            ['8.3', 'public(set)', [\n                [\\T_PUBLIC, 'public'],\n                [\\ord('('), '('],\n                [\\T_STRING, 'set'],\n                [\\ord(')'), ')']\n            ]],\n            ['8.5', '|>', [\n                [\\T_PIPE, '|>']\n            ]],\n            ['8.4', '|>', [\n                [\\ord('|'), '|'],\n                [\\ord('>'), '>'],\n            ]],\n            ['8.5', '(void)', [\n                [\\T_VOID_CAST, '(void)'],\n            ]],\n            ['8.5', \"( \\tvoid \\t)\", [\n                [\\T_VOID_CAST, \"( \\tvoid \\t)\"],\n            ]],\n            ['8.4', '(void)', [\n                [\\ord('('), '('],\n                [\\T_STRING, 'void'],\n                [\\ord(')'), ')'],\n            ]],\n            ['8.4', \"( \\tVOID \\t)\", [\n                [\\ord('('), '('],\n                [\\T_STRING, 'VOID'],\n                [\\ord(')'), ')'],\n            ]],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/LexerTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nrequire __DIR__ . '/../../lib/PhpParser/compatibility_tokens.php';\n\nclass LexerTest extends \\PHPUnit\\Framework\\TestCase {\n    /* To allow overwriting in parent class */\n    protected function getLexer() {\n        return new Lexer();\n    }\n\n    /**\n     * @dataProvider provideTestError\n     */\n    public function testError($code, $messages): void {\n        if (defined('HHVM_VERSION')) {\n            $this->markTestSkipped('HHVM does not throw warnings from token_get_all()');\n        }\n\n        $errorHandler = new ErrorHandler\\Collecting();\n        $lexer = $this->getLexer();\n        $lexer->tokenize($code, $errorHandler);\n        $errors = $errorHandler->getErrors();\n\n        $this->assertCount(count($messages), $errors);\n        for ($i = 0; $i < count($messages); $i++) {\n            $this->assertSame($messages[$i], $errors[$i]->getMessageWithColumnInfo($code));\n        }\n    }\n\n    public static function provideTestError() {\n        return [\n            [\"<?php /*\", [\"Unterminated comment from 1:7 to 1:9\"]],\n            [\"<?php /*\\n\", [\"Unterminated comment from 1:7 to 2:1\"]],\n            [\"<?php \\1\", [\"Unexpected character \\\"\\1\\\" (ASCII 1) from 1:7 to 1:7\"]],\n            [\"<?php \\0\", [\"Unexpected null byte from 1:7 to 1:7\"]],\n            // Error with potentially emulated token\n            [\"<?php ?? \\0\", [\"Unexpected null byte from 1:10 to 1:10\"]],\n            [\"<?php\\n\\0\\1 foo /* bar\", [\n                \"Unexpected null byte from 2:1 to 2:1\",\n                \"Unexpected character \\\"\\1\\\" (ASCII 1) from 2:2 to 2:2\",\n                \"Unterminated comment from 2:8 to 2:14\"\n            ]],\n        ];\n    }\n\n    public function testDefaultErrorHandler(): void {\n        $this->expectException(Error::class);\n        $this->expectExceptionMessage('Unterminated comment on line 1');\n        $lexer = $this->getLexer();\n        $lexer->tokenize(\"<?php readonly /*\");\n    }\n\n    /**\n     * @dataProvider provideTestLex\n     */\n    public function testLex($code, $expectedTokens): void {\n        $lexer = $this->getLexer();\n        $tokens = $lexer->tokenize($code);\n        foreach ($tokens as $token) {\n            if ($token->id === 0 || $token->isIgnorable()) {\n                continue;\n            }\n\n            $expectedToken = array_shift($expectedTokens);\n\n            $this->assertSame($expectedToken[0], $token->id);\n            $this->assertSame($expectedToken[1], $token->text);\n        }\n    }\n\n    public static function provideTestLex() {\n        return [\n            // tests PHP 8 T_NAME_* emulation\n            [\n                '<?php Foo\\Bar \\Foo\\Bar namespace\\Foo\\Bar Foo\\Bar\\\\',\n                [\n                    [\\T_NAME_QUALIFIED, 'Foo\\Bar'],\n                    [\\T_NAME_FULLY_QUALIFIED, '\\Foo\\Bar'],\n                    [\\T_NAME_RELATIVE, 'namespace\\Foo\\Bar'],\n                    [\\T_NAME_QUALIFIED, 'Foo\\Bar'],\n                    [\\T_NS_SEPARATOR, '\\\\'],\n                ]\n            ],\n            // tests PHP 8 T_NAME_* emulation with reserved keywords\n            [\n                '<?php fn\\use \\fn\\use namespace\\fn\\use fn\\use\\\\',\n                [\n                    [\\T_NAME_QUALIFIED, 'fn\\use'],\n                    [\\T_NAME_FULLY_QUALIFIED, '\\fn\\use'],\n                    [\\T_NAME_RELATIVE, 'namespace\\fn\\use'],\n                    [\\T_NAME_QUALIFIED, 'fn\\use'],\n                    [\\T_NS_SEPARATOR, '\\\\'],\n                ]\n            ],\n        ];\n    }\n\n    public function testGetTokens(): void {\n        $code = '<?php \"a\";' . \"\\n\" . '// foo' . \"\\n\" . '// bar' . \"\\n\\n\" . '\"b\";';\n        $expectedTokens = [\n            new Token(T_OPEN_TAG, '<?php ', 1, 0),\n            new Token(T_CONSTANT_ENCAPSED_STRING, '\"a\"', 1, 6),\n            new Token(\\ord(';'), ';', 1, 9),\n            new Token(T_WHITESPACE, \"\\n\", 1, 10),\n            new Token(T_COMMENT, '// foo', 2, 11),\n            new Token(T_WHITESPACE, \"\\n\", 2, 17),\n            new Token(T_COMMENT, '// bar', 3, 18),\n            new Token(T_WHITESPACE, \"\\n\\n\", 3, 24),\n            new Token(T_CONSTANT_ENCAPSED_STRING, '\"b\"', 5, 26),\n            new Token(\\ord(';'), ';', 5, 29),\n            new Token(0, \"\\0\", 5, 30),\n        ];\n\n        $lexer = $this->getLexer();\n        $this->assertEquals($expectedTokens, $lexer->tokenize($code));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/ModifiersTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse InvalidArgumentException;\nuse PHPUnit\\Framework\\TestCase;\n\nclass ModifiersTest extends TestCase {\n    public function testToString() {\n        $this->assertSame('public', Modifiers::toString(Modifiers::PUBLIC));\n    }\n\n    public function testToStringInvalid() {\n        $this->expectException(InvalidArgumentException::class);\n        $this->expectExceptionMessage('Unknown modifier 3');\n        Modifiers::toString(Modifiers::PUBLIC | Modifiers::PROTECTED);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NameContextTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Stmt\\Use_;\n\nclass NameContextTest extends \\PHPUnit\\Framework\\TestCase {\n    /**\n     * @dataProvider provideTestGetPossibleNames\n     */\n    public function testGetPossibleNames($type, $name, $expectedPossibleNames): void {\n        $nameContext = new NameContext(new ErrorHandler\\Throwing());\n        $nameContext->startNamespace(new Name('NS'));\n        $nameContext->addAlias(new Name('Foo'), 'Foo', Use_::TYPE_NORMAL);\n        $nameContext->addAlias(new Name('Foo\\Bar'), 'Alias', Use_::TYPE_NORMAL);\n        $nameContext->addAlias(new Name('Foo\\fn'), 'fn', Use_::TYPE_FUNCTION);\n        $nameContext->addAlias(new Name('Foo\\CN'), 'CN', Use_::TYPE_CONSTANT);\n\n        $possibleNames = $nameContext->getPossibleNames($name, $type);\n        $possibleNames = array_map(function (Name $name) {\n            return $name->toCodeString();\n        }, $possibleNames);\n\n        $this->assertSame($expectedPossibleNames, $possibleNames);\n\n        // Here the last name is always the shortest one\n        $expectedShortName = $expectedPossibleNames[count($expectedPossibleNames) - 1];\n        $this->assertSame(\n            $expectedShortName,\n            $nameContext->getShortName($name, $type)->toCodeString()\n        );\n    }\n\n    public static function provideTestGetPossibleNames() {\n        return [\n            [Use_::TYPE_NORMAL, 'Test', ['\\Test']],\n            [Use_::TYPE_NORMAL, 'Test\\Namespaced', ['\\Test\\Namespaced']],\n            [Use_::TYPE_NORMAL, 'NS\\Test', ['\\NS\\Test', 'Test']],\n            [Use_::TYPE_NORMAL, 'ns\\Test', ['\\ns\\Test', 'Test']],\n            [Use_::TYPE_NORMAL, 'NS\\Foo\\Bar', ['\\NS\\Foo\\Bar']],\n            [Use_::TYPE_NORMAL, 'ns\\foo\\Bar', ['\\ns\\foo\\Bar']],\n            [Use_::TYPE_NORMAL, 'Foo', ['\\Foo', 'Foo']],\n            [Use_::TYPE_NORMAL, 'Foo\\Bar', ['\\Foo\\Bar', 'Foo\\Bar', 'Alias']],\n            [Use_::TYPE_NORMAL, 'Foo\\Bar\\Baz', ['\\Foo\\Bar\\Baz', 'Foo\\Bar\\Baz', 'Alias\\Baz']],\n            [Use_::TYPE_NORMAL, 'Foo\\fn\\Bar', ['\\Foo\\fn\\Bar', 'Foo\\fn\\Bar']],\n            [Use_::TYPE_FUNCTION, 'Foo\\fn\\bar', ['\\Foo\\fn\\bar', 'Foo\\fn\\bar']],\n            [Use_::TYPE_FUNCTION, 'Foo\\fn', ['\\Foo\\fn', 'Foo\\fn', 'fn']],\n            [Use_::TYPE_FUNCTION, 'Foo\\FN', ['\\Foo\\FN', 'Foo\\FN', 'fn']],\n            [Use_::TYPE_CONSTANT, 'Foo\\CN\\BAR', ['\\Foo\\CN\\BAR', 'Foo\\CN\\BAR']],\n            [Use_::TYPE_CONSTANT, 'Foo\\CN', ['\\Foo\\CN', 'Foo\\CN', 'CN']],\n            [Use_::TYPE_CONSTANT, 'foo\\CN', ['\\foo\\CN', 'Foo\\CN', 'CN']],\n            [Use_::TYPE_CONSTANT, 'foo\\cn', ['\\foo\\cn', 'Foo\\cn']],\n            // self/parent/static must not be fully qualified\n            [Use_::TYPE_NORMAL, 'self', ['self']],\n            [Use_::TYPE_NORMAL, 'parent', ['parent']],\n            [Use_::TYPE_NORMAL, 'static', ['static']],\n            // true/false/null do not need to be fully qualified, even in namespaces\n            [Use_::TYPE_CONSTANT, 'true', ['\\true', 'true']],\n            [Use_::TYPE_CONSTANT, 'false', ['\\false', 'false']],\n            [Use_::TYPE_CONSTANT, 'null', ['\\null', 'null']],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/Expr/CallableLikeTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Expr;\n\nuse PhpParser\\Node\\Arg;\nuse PhpParser\\Node\\Identifier;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\VariadicPlaceholder;\n\nclass CallableLikeTest extends \\PHPUnit\\Framework\\TestCase {\n    /**\n     * @dataProvider provideTestIsFirstClassCallable\n     */\n    public function testIsFirstClassCallable(CallLike $node, bool $isFirstClassCallable): void {\n        $this->assertSame($isFirstClassCallable, $node->isFirstClassCallable());\n        if (!$isFirstClassCallable) {\n            $this->assertSame($node->getRawArgs(), $node->getArgs());\n        }\n    }\n\n    /**\n     * @dataProvider provideTestGetArg\n     */\n    public function testGetArg(CallLike $node, ?Arg $expected): void {\n        $this->assertSame($expected, $node->getArg('bar', 1));\n    }\n\n    public static function provideTestIsFirstClassCallable() {\n        $normalArgs = [new Arg(new Int_(1))];\n        $callableArgs = [new VariadicPlaceholder()];\n        return [\n            [new FuncCall(new Name('test'), $normalArgs), false],\n            [new FuncCall(new Name('test'), $callableArgs), true],\n            [new MethodCall(new Variable('this'), 'test', $normalArgs), false],\n            [new MethodCall(new Variable('this'), 'test', $callableArgs), true],\n            [new StaticCall(new Name('Test'), 'test', $normalArgs), false],\n            [new StaticCall(new Name('Test'), 'test', $callableArgs), true],\n            [new New_(new Name('Test'), $normalArgs), false],\n            [new NullsafeMethodCall(new Variable('this'), 'test', $normalArgs), false],\n            // This is not legal code, but accepted by the parser.\n            [new New_(new Name('Test'), $callableArgs), true],\n            [new NullsafeMethodCall(new Variable('this'), 'test', $callableArgs), true],\n        ];\n    }\n\n    public static function provideTestGetArg() {\n        $foo = new Arg(new Int_(1));\n        $namedFoo = new Arg(new Int_(1), false, false, [], new Identifier('foo'));\n        $bar = new Arg(new Int_(2));\n        $namedBar = new Arg(new Int_(2), false, false, [], new Identifier('bar'));\n        $unpack = new Arg(new Int_(3), false, true);\n        $callableArgs = [new VariadicPlaceholder()];\n        return [\n            [new FuncCall(new Name('test'), [$foo]), null],\n            [new FuncCall(new Name('test'), [$namedFoo]), null],\n            [new FuncCall(new Name('test'), [$foo, $bar]), $bar],\n            [new FuncCall(new Name('test'), [$namedBar]), $namedBar],\n            [new FuncCall(new Name('test'), [$namedFoo, $namedBar]), $namedBar],\n            [new FuncCall(new Name('test'), [$namedBar, $namedFoo]), $namedBar],\n            [new FuncCall(new Name('test'), [$namedFoo, $unpack]), null],\n            [new FuncCall(new Name('test'), $callableArgs), null],\n            [new MethodCall(new Variable('this'), 'test', [$foo]), null],\n            [new MethodCall(new Variable('this'), 'test', [$namedFoo]), null],\n            [new MethodCall(new Variable('this'), 'test', [$foo, $bar]), $bar],\n            [new MethodCall(new Variable('this'), 'test', [$namedBar]), $namedBar],\n            [new MethodCall(new Variable('this'), 'test', [$namedFoo, $namedBar]), $namedBar],\n            [new MethodCall(new Variable('this'), 'test', [$namedBar, $namedFoo]), $namedBar],\n            [new MethodCall(new Variable('this'), 'test', [$namedFoo, $unpack]), null],\n            [new MethodCall(new Variable('this'), 'test', $callableArgs), null],\n            [new StaticCall(new Name('Test'), 'test', [$foo]), null],\n            [new StaticCall(new Name('Test'), 'test', [$namedFoo]), null],\n            [new StaticCall(new Name('Test'), 'test', [$foo, $bar]), $bar],\n            [new StaticCall(new Name('Test'), 'test', [$namedBar]), $namedBar],\n            [new StaticCall(new Name('Test'), 'test', [$namedFoo, $namedBar]), $namedBar],\n            [new StaticCall(new Name('Test'), 'test', [$namedBar, $namedFoo]), $namedBar],\n            [new StaticCall(new Name('Test'), 'test', [$namedFoo, $unpack]), null],\n            [new StaticCall(new Name('Test'), 'test', $callableArgs), null],\n            [new New_(new Name('test'), [$foo]), null],\n            [new New_(new Name('test'), [$namedFoo]), null],\n            [new New_(new Name('test'), [$foo, $bar]), $bar],\n            [new New_(new Name('test'), [$namedBar]), $namedBar],\n            [new New_(new Name('test'), [$namedFoo, $namedBar]), $namedBar],\n            [new New_(new Name('test'), [$namedBar, $namedFoo]), $namedBar],\n            [new New_(new Name('test'), [$namedFoo, $unpack]), null],\n            [new NullsafeMethodCall(new Variable('this'), 'test', [$foo]), null],\n            [new NullsafeMethodCall(new Variable('this'), 'test', [$namedFoo]), null],\n            [new NullsafeMethodCall(new Variable('this'), 'test', [$foo, $bar]), $bar],\n            [new NullsafeMethodCall(new Variable('this'), 'test', [$namedBar]), $namedBar],\n            [new NullsafeMethodCall(new Variable('this'), 'test', [$namedFoo, $namedBar]), $namedBar],\n            [new NullsafeMethodCall(new Variable('this'), 'test', [$namedBar, $namedFoo]), $namedBar],\n            [new NullsafeMethodCall(new Variable('this'), 'test', [$namedFoo, $unpack]), null],\n            // This is not legal code, but accepted by the parser.\n            [new New_(new Name('Test'), $callableArgs), null],\n            [new NullsafeMethodCall(new Variable('this'), 'test', $callableArgs), null],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/IdentifierTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nclass IdentifierTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testConstructorThrows(): void {\n        self::expectException(\\InvalidArgumentException::class);\n        new Identifier('');\n    }\n\n    public function testToString(): void {\n        $identifier = new Identifier('Foo');\n\n        $this->assertSame('Foo', (string) $identifier);\n        $this->assertSame('Foo', $identifier->toString());\n        $this->assertSame('foo', $identifier->toLowerString());\n    }\n\n    /** @dataProvider provideTestIsSpecialClassName */\n    public function testIsSpecialClassName($identifier, $expected): void {\n        $identifier = new Identifier($identifier);\n        $this->assertSame($expected, $identifier->isSpecialClassName());\n    }\n\n    public static function provideTestIsSpecialClassName() {\n        return [\n            ['self', true],\n            ['PARENT', true],\n            ['Static', true],\n            ['other', false],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/NameTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nclass NameTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testConstruct(): void {\n        $name = new Name(['foo', 'bar']);\n        $this->assertSame('foo\\bar', $name->name);\n\n        $name = new Name('foo\\bar');\n        $this->assertSame('foo\\bar', $name->name);\n\n        $name = new Name($name);\n        $this->assertSame('foo\\bar', $name->name);\n    }\n\n    public function testGet(): void {\n        $name = new Name('foo');\n        $this->assertSame('foo', $name->getFirst());\n        $this->assertSame('foo', $name->getLast());\n        $this->assertSame(['foo'], $name->getParts());\n\n        $name = new Name('foo\\bar');\n        $this->assertSame('foo', $name->getFirst());\n        $this->assertSame('bar', $name->getLast());\n        $this->assertSame(['foo', 'bar'], $name->getParts());\n    }\n\n    public function testToString(): void {\n        $name = new Name('Foo\\Bar');\n\n        $this->assertSame('Foo\\Bar', (string) $name);\n        $this->assertSame('Foo\\Bar', $name->toString());\n        $this->assertSame('foo\\bar', $name->toLowerString());\n    }\n\n    public function testSlice(): void {\n        $name = new Name('foo\\bar\\baz');\n        $this->assertEquals(new Name('foo\\bar\\baz'), $name->slice(0));\n        $this->assertEquals(new Name('bar\\baz'), $name->slice(1));\n        $this->assertNull($name->slice(3));\n        $this->assertEquals(new Name('foo\\bar\\baz'), $name->slice(-3));\n        $this->assertEquals(new Name('bar\\baz'), $name->slice(-2));\n        $this->assertEquals(new Name('foo\\bar'), $name->slice(0, -1));\n        $this->assertNull($name->slice(0, -3));\n        $this->assertEquals(new Name('bar'), $name->slice(1, -1));\n        $this->assertNull($name->slice(1, -2));\n        $this->assertEquals(new Name('bar'), $name->slice(-2, 1));\n        $this->assertEquals(new Name('bar'), $name->slice(-2, -1));\n        $this->assertNull($name->slice(-2, -2));\n    }\n\n    public function testSliceOffsetTooLarge(): void {\n        $this->expectException(\\OutOfBoundsException::class);\n        $this->expectExceptionMessage('Offset 4 is out of bounds');\n        (new Name('foo\\bar\\baz'))->slice(4);\n    }\n\n    public function testSliceOffsetTooSmall(): void {\n        $this->expectException(\\OutOfBoundsException::class);\n        $this->expectExceptionMessage('Offset -4 is out of bounds');\n        (new Name('foo\\bar\\baz'))->slice(-4);\n    }\n\n    public function testSliceLengthTooLarge(): void {\n        $this->expectException(\\OutOfBoundsException::class);\n        $this->expectExceptionMessage('Length 4 is out of bounds');\n        (new Name('foo\\bar\\baz'))->slice(0, 4);\n    }\n\n    public function testSliceLengthTooSmall(): void {\n        $this->expectException(\\OutOfBoundsException::class);\n        $this->expectExceptionMessage('Length -4 is out of bounds');\n        (new Name('foo\\bar\\baz'))->slice(0, -4);\n    }\n\n    public function testSliceLengthTooLargeWithOffset(): void {\n        $this->expectException(\\OutOfBoundsException::class);\n        $this->expectExceptionMessage('Length 3 is out of bounds');\n        (new Name('foo\\bar\\baz'))->slice(1, 3);\n    }\n\n    public function testConcat(): void {\n        $this->assertEquals(new Name('foo\\bar\\baz'), Name::concat('foo', 'bar\\baz'));\n        $this->assertEquals(\n            new Name\\FullyQualified('foo\\bar'),\n            Name\\FullyQualified::concat(['foo'], new Name('bar'))\n        );\n\n        $attributes = ['foo' => 'bar'];\n        $this->assertEquals(\n            new Name\\Relative('foo\\bar\\baz', $attributes),\n            Name\\Relative::concat(new Name\\FullyQualified('foo\\bar'), 'baz', $attributes)\n        );\n\n        $this->assertEquals(new Name('foo'), Name::concat(null, 'foo'));\n        $this->assertEquals(new Name('foo'), Name::concat('foo', null));\n        $this->assertNull(Name::concat(null, null));\n    }\n\n    public function testNameTypes(): void {\n        $name = new Name('foo');\n        $this->assertTrue($name->isUnqualified());\n        $this->assertFalse($name->isQualified());\n        $this->assertFalse($name->isFullyQualified());\n        $this->assertFalse($name->isRelative());\n        $this->assertSame('foo', $name->toCodeString());\n\n        $name = new Name('foo\\bar');\n        $this->assertFalse($name->isUnqualified());\n        $this->assertTrue($name->isQualified());\n        $this->assertFalse($name->isFullyQualified());\n        $this->assertFalse($name->isRelative());\n        $this->assertSame('foo\\bar', $name->toCodeString());\n\n        $name = new Name\\FullyQualified('foo');\n        $this->assertFalse($name->isUnqualified());\n        $this->assertFalse($name->isQualified());\n        $this->assertTrue($name->isFullyQualified());\n        $this->assertFalse($name->isRelative());\n        $this->assertSame('\\foo', $name->toCodeString());\n\n        $name = new Name\\Relative('foo');\n        $this->assertFalse($name->isUnqualified());\n        $this->assertFalse($name->isQualified());\n        $this->assertFalse($name->isFullyQualified());\n        $this->assertTrue($name->isRelative());\n        $this->assertSame('namespace\\foo', $name->toCodeString());\n    }\n\n    public function testInvalidArg(): void {\n        $this->expectException(\\InvalidArgumentException::class);\n        $this->expectExceptionMessage('Expected string, array of parts or Name instance');\n        Name::concat('foo', new \\stdClass());\n    }\n\n    public function testInvalidEmptyString(): void {\n        $this->expectException(\\InvalidArgumentException::class);\n        $this->expectExceptionMessage('Name cannot be empty');\n        new Name('');\n    }\n\n    public function testInvalidEmptyArray(): void {\n        $this->expectException(\\InvalidArgumentException::class);\n        $this->expectExceptionMessage('Name cannot be empty');\n        new Name([]);\n    }\n\n    /** @dataProvider provideTestIsSpecialClassName */\n    public function testIsSpecialClassName($name, $expected): void {\n        $name = new Name($name);\n        $this->assertSame($expected, $name->isSpecialClassName());\n    }\n\n    public static function provideTestIsSpecialClassName() {\n        return [\n            ['self', true],\n            ['PARENT', true],\n            ['Static', true],\n            ['self\\not', false],\n            ['not\\self', false],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/ParamTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node\\Expr\\Variable;\n\nclass ParamTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testNoModifiers(): void {\n        $node = new Param(new Variable('foo'));\n\n        $this->assertFalse($node->isPromoted());\n        $this->assertFalse($node->isPrivate());\n        $this->assertFalse($node->isProtected());\n        $this->assertFalse($node->isPrivate());\n        $this->assertFalse($node->isReadonly());\n        $this->assertFalse($node->isPublicSet());\n        $this->assertFalse($node->isProtectedSet());\n        $this->assertFalse($node->isPrivateSet());\n    }\n\n    /**\n     * @dataProvider provideModifiers\n     */\n    public function testModifiers(string $modifier): void {\n        $node = new Param(new Variable('foo'));\n        $node->flags = constant(Modifiers::class . '::' . strtoupper($modifier));\n        $this->assertTrue($node->isPromoted());\n        $this->assertTrue($node->{'is' . $modifier}());\n    }\n\n    public static function provideModifiers() {\n        return [\n            ['public'],\n            ['protected'],\n            ['private'],\n            ['readonly'],\n            ['final'],\n        ];\n    }\n\n    public function testSetVisibility() {\n        $node = new Param(new Variable('foo'));\n        $node->flags = Modifiers::PRIVATE_SET;\n        $this->assertTrue($node->isPrivateSet());\n        $this->assertTrue($node->isPublic());\n        $node->flags = Modifiers::PROTECTED_SET;\n        $this->assertTrue($node->isProtectedSet());\n        $this->assertTrue($node->isPublic());\n        $node->flags = Modifiers::PUBLIC_SET;\n        $this->assertTrue($node->isPublicSet());\n        $this->assertTrue($node->isPublic());\n    }\n\n    public function testPromotedPropertyWithoutVisibilityModifier(): void {\n        $node = new Param(new Variable('foo'));\n        $get = new PropertyHook('get', null);\n        $node->hooks[] = $get;\n\n        $this->assertTrue($node->isPromoted());\n        $this->assertTrue($node->isPublic());\n    }\n\n    public function testNonPromotedPropertyIsNotPublic(): void {\n        $node = new Param(new Variable('foo'));\n        $this->assertFalse($node->isPublic());\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/PropertyHookTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node\\Expr\\Assign;\nuse PhpParser\\Node\\Expr\\PropertyFetch;\nuse PhpParser\\Node\\Expr\\Variable;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Stmt\\Expression;\nuse PhpParser\\Node\\Stmt\\Return_;\nuse PhpParser\\ParserFactory;\nuse PhpParser\\PrettyPrinter\\Standard;\n\nclass PropertyHookTest extends \\PHPUnit\\Framework\\TestCase {\n    /**\n     * @dataProvider provideModifiers\n     */\n    public function testModifiers($modifier): void {\n        $node = new PropertyHook(\n            'get',\n            null,\n            [\n                'flags' => constant(Modifiers::class . '::' . strtoupper($modifier)),\n            ]\n        );\n\n        $this->assertTrue($node->{'is' . $modifier}());\n    }\n\n    public function testNoModifiers(): void {\n        $node = new PropertyHook('get', null);\n\n        $this->assertFalse($node->isFinal());\n    }\n\n    public static function provideModifiers() {\n        return [\n            ['final'],\n        ];\n    }\n\n    public function testGetStmts(): void {\n        $expr = new Variable('test');\n        $get = new PropertyHook('get', $expr);\n        $this->assertEquals([new Return_($expr)], $get->getStmts());\n\n        $set = new PropertyHook('set', $expr, [], ['propertyName' => 'abc']);\n        $this->assertEquals([\n            new Expression(new Assign(new PropertyFetch(new Variable('this'), 'abc'), $expr))\n        ], $set->getStmts());\n    }\n\n    public function testGetStmtsSetHookFromParser(): void {\n        $parser = (new ParserFactory())->createForNewestSupportedVersion();\n        $prettyPrinter = new Standard();\n        $stmts = $parser->parse(<<<'CODE'\n        <?php\n        class Test {\n            public $prop1 { set => 123; }\n\n            public function __construct(public $prop2 { set => 456; }) {}\n        }\n        CODE);\n\n        $hook1 = $stmts[0]->stmts[0]->hooks[0];\n        $this->assertEquals('$this->prop1 = 123;', $prettyPrinter->prettyPrint($hook1->getStmts()));\n\n        $hook2 = $stmts[0]->stmts[1]->params[0]->hooks[0];\n        $this->assertEquals('$this->prop2 = 456;', $prettyPrinter->prettyPrint($hook2->getStmts()));\n    }\n\n    public function testGetStmtsUnknownHook(): void {\n        $expr = new Variable('test');\n        $hook = new PropertyHook('foobar', $expr);\n\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Unknown property hook \"foobar\"');\n        $hook->getStmts();\n    }\n\n    public function testGetStmtsSetHookWithoutPropertyName(): void {\n        $expr = new Variable('test');\n        $set = new PropertyHook('set', $expr);\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Can only use getStmts() on a \"set\" hook if the \"propertyName\" attribute is set');\n        $set->getStmts();\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/Scalar/DNumberTest.php",
    "content": "<?php\ndeclare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nuse PhpParser\\Node\\Stmt\\Echo_;\nuse PhpParser\\ParserFactory;\n\nclass DNumberTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testRawValue(): void {\n        $parser = (new ParserFactory())->createForNewestSupportedVersion();\n        $nodes = $parser->parse('<?php echo 1_234.56;');\n\n        $echo = $nodes[0];\n        $this->assertInstanceOf(Echo_::class, $echo);\n\n        /** @var Echo_ $echo */\n        $dnumber = $echo->exprs[0];\n        $this->assertInstanceOf(Float_::class, $dnumber);\n\n        /** @var Float_ $dnumber */\n        $this->assertSame(1234.56, $dnumber->value);\n        $this->assertSame('1_234.56', $dnumber->getAttribute('rawValue'));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/Scalar/MagicConstTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nclass MagicConstTest extends \\PHPUnit\\Framework\\TestCase {\n    /**\n     * @dataProvider provideTestGetName\n     */\n    public function testGetName(MagicConst $magicConst, $name): void {\n        $this->assertSame($name, $magicConst->getName());\n    }\n\n    public static function provideTestGetName() {\n        return [\n            [new MagicConst\\Class_(), '__CLASS__'],\n            [new MagicConst\\Dir(), '__DIR__'],\n            [new MagicConst\\File(), '__FILE__'],\n            [new MagicConst\\Function_(), '__FUNCTION__'],\n            [new MagicConst\\Line(), '__LINE__'],\n            [new MagicConst\\Method(), '__METHOD__'],\n            [new MagicConst\\Namespace_(), '__NAMESPACE__'],\n            [new MagicConst\\Trait_(), '__TRAIT__'],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/Scalar/NumberTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nuse PhpParser\\Node\\Stmt\\Echo_;\nuse PhpParser\\ParserFactory;\n\nclass NumberTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testRawValue(): void {\n        $parser = (new ParserFactory())->createForNewestSupportedVersion();\n        $nodes = $parser->parse('<?php echo 1_234;');\n\n        $echo = $nodes[0];\n        $this->assertInstanceOf(Echo_::class, $echo);\n\n        /** @var Echo_ $echo */\n        $lnumber = $echo->exprs[0];\n        $this->assertInstanceOf(Int_::class, $lnumber);\n\n        /** @var Int_ $lnumber */\n        $this->assertSame(1234, $lnumber->value);\n        $this->assertSame('1_234', $lnumber->getAttribute('rawValue'));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/Scalar/StringTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Scalar;\n\nuse PhpParser\\Node\\Stmt\\Echo_;\nuse PhpParser\\ParserFactory;\n\nclass StringTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testRawValue(): void {\n        $parser = (new ParserFactory())->createForNewestSupportedVersion();\n        $nodes = $parser->parse('<?php echo \"sequence \\x41\";');\n\n        $echo = $nodes[0];\n        $this->assertInstanceOf(Echo_::class, $echo);\n\n        /** @var Echo_ $echo */\n        $string = $echo->exprs[0];\n        $this->assertInstanceOf(String_::class, $string);\n\n        /** @var String_ $string */\n        $this->assertSame('sequence A', $string->value);\n        $this->assertSame('\"sequence \\\\x41\"', $string->getAttribute('rawValue'));\n    }\n\n    /**\n     * @dataProvider provideTestParseEscapeSequences\n     */\n    public function testParseEscapeSequences($expected, $string, $quote): void {\n        $this->assertSame(\n            $expected,\n            String_::parseEscapeSequences($string, $quote)\n        );\n    }\n\n    /**\n     * @dataProvider provideTestParse\n     */\n    public function testCreate($expected, $string): void {\n        $this->assertSame(\n            $expected,\n            String_::parse($string)\n        );\n    }\n\n    public static function provideTestParseEscapeSequences() {\n        return [\n            ['\"',              '\\\\\"',              '\"'],\n            ['\\\\\"',            '\\\\\"',              '`'],\n            ['\\\\\"\\\\`',         '\\\\\"\\\\`',           null],\n            [\"\\\\\\$\\n\\r\\t\\f\\v\", '\\\\\\\\\\$\\n\\r\\t\\f\\v', null],\n            [\"\\x1B\",           '\\e',               null],\n            [chr(255),         '\\xFF',             null],\n            [chr(255),         '\\377',             null],\n            [chr(0),           '\\400',             null],\n            [\"\\0\",             '\\0',               null],\n            ['\\xFF',           '\\\\\\\\xFF',          null],\n        ];\n    }\n\n    public static function provideTestParse() {\n        $tests = [\n            ['A', '\\'A\\''],\n            ['A', 'b\\'A\\''],\n            ['A', '\"A\"'],\n            ['A', 'b\"A\"'],\n            ['\\\\', '\\'\\\\\\\\\\''],\n            ['\\'', '\\'\\\\\\'\\''],\n        ];\n\n        foreach (self::provideTestParseEscapeSequences() as $i => $test) {\n            // skip second and third tests, they aren't for double quotes\n            if ($i !== 1 && $i !== 2) {\n                $tests[] = [$test[0], '\"' . $test[1] . '\"'];\n            }\n        }\n\n        return $tests;\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/Stmt/ClassConstTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Modifiers;\n\nclass ClassConstTest extends \\PHPUnit\\Framework\\TestCase {\n    /**\n     * @dataProvider provideModifiers\n     */\n    public function testModifiers($modifier): void {\n        $node = new ClassConst(\n            [], // invalid\n            constant(Modifiers::class . '::' . strtoupper($modifier))\n        );\n\n        $this->assertTrue($node->{'is' . $modifier}());\n    }\n\n    public function testNoModifiers(): void {\n        $node = new ClassConst([], 0);\n\n        $this->assertTrue($node->isPublic());\n        $this->assertFalse($node->isProtected());\n        $this->assertFalse($node->isPrivate());\n        $this->assertFalse($node->isFinal());\n    }\n\n    public static function provideModifiers() {\n        return [\n            ['public'],\n            ['protected'],\n            ['private'],\n            ['final'],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/Stmt/ClassMethodTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node\\Expr\\Variable;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Param;\n\nclass ClassMethodTest extends \\PHPUnit\\Framework\\TestCase {\n    /**\n     * @dataProvider provideModifiers\n     */\n    public function testModifiers($modifier): void {\n        $node = new ClassMethod('foo', [\n            'type' => constant(Modifiers::class . '::' . strtoupper($modifier))\n        ]);\n\n        $this->assertTrue($node->{'is' . $modifier}());\n    }\n\n    public function testNoModifiers(): void {\n        $node = new ClassMethod('foo', ['type' => 0]);\n\n        $this->assertTrue($node->isPublic());\n        $this->assertFalse($node->isProtected());\n        $this->assertFalse($node->isPrivate());\n        $this->assertFalse($node->isAbstract());\n        $this->assertFalse($node->isFinal());\n        $this->assertFalse($node->isStatic());\n        $this->assertFalse($node->isMagic());\n    }\n\n    public static function provideModifiers() {\n        return [\n            ['public'],\n            ['protected'],\n            ['private'],\n            ['abstract'],\n            ['final'],\n            ['static'],\n        ];\n    }\n\n    /**\n     * Checks that implicit public modifier detection for method is working\n     *\n     * @dataProvider implicitPublicModifiers\n     *\n     * @param string $modifier Node type modifier\n     */\n    public function testImplicitPublic(string $modifier): void {\n        $node = new ClassMethod('foo', [\n            'type' => constant(Modifiers::class . '::' . strtoupper($modifier))\n        ]);\n\n        $this->assertTrue($node->isPublic(), 'Node should be implicitly public');\n    }\n\n    public static function implicitPublicModifiers() {\n        return [\n            ['abstract'],\n            ['final'],\n            ['static'],\n        ];\n    }\n\n    /**\n     * @dataProvider provideMagics\n     *\n     * @param string $name Node name\n     */\n    public function testMagic(string $name): void {\n        $node = new ClassMethod($name);\n        $this->assertTrue($node->isMagic(), 'Method should be magic');\n    }\n\n    public static function provideMagics() {\n        return [\n             ['__construct'],\n             ['__DESTRUCT'],\n             ['__caLL'],\n             ['__callstatic'],\n             ['__get'],\n             ['__set'],\n             ['__isset'],\n             ['__unset'],\n             ['__sleep'],\n             ['__wakeup'],\n             ['__tostring'],\n             ['__set_state'],\n             ['__clone'],\n             ['__invoke'],\n             ['__debuginfo'],\n        ];\n    }\n\n    public function testFunctionLike(): void {\n        $param = new Param(new Variable('a'));\n        $type = new Name('Foo');\n        $return = new Return_(new Variable('a'));\n        $method = new ClassMethod('test', [\n            'byRef' => false,\n            'params' => [$param],\n            'returnType' => $type,\n            'stmts' => [$return],\n        ]);\n\n        $this->assertFalse($method->returnsByRef());\n        $this->assertSame([$param], $method->getParams());\n        $this->assertSame($type, $method->getReturnType());\n        $this->assertSame([$return], $method->getStmts());\n\n        $method = new ClassMethod('test', [\n            'byRef' => true,\n            'stmts' => null,\n        ]);\n\n        $this->assertTrue($method->returnsByRef());\n        $this->assertNull($method->getStmts());\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/Stmt/ClassTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Modifiers;\nuse PhpParser\\Node\\PropertyItem;\nuse PhpParser\\Node\\Scalar\\String_;\n\nclass ClassTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testIsAbstract(): void {\n        $class = new Class_('Foo', ['type' => Modifiers::ABSTRACT]);\n        $this->assertTrue($class->isAbstract());\n\n        $class = new Class_('Foo');\n        $this->assertFalse($class->isAbstract());\n    }\n\n    public function testIsFinal(): void {\n        $class = new Class_('Foo', ['type' => Modifiers::FINAL]);\n        $this->assertTrue($class->isFinal());\n\n        $class = new Class_('Foo');\n        $this->assertFalse($class->isFinal());\n    }\n\n    public function testGetTraitUses(): void {\n        $traitUses = [\n            new TraitUse([new Trait_('foo')]),\n            new TraitUse([new Trait_('bar')]),\n        ];\n        $class = new Class_('Foo', [\n            'stmts' => [\n                $traitUses[0],\n                new ClassMethod('fooBar'),\n                $traitUses[1],\n            ]\n        ]);\n\n        $this->assertSame($traitUses, $class->getTraitUses());\n    }\n\n    public function testGetMethods(): void {\n        $methods = [\n            new ClassMethod('foo'),\n            new ClassMethod('bar'),\n            new ClassMethod('fooBar'),\n        ];\n        $class = new Class_('Foo', [\n            'stmts' => [\n                new TraitUse([]),\n                $methods[0],\n                new ClassConst([]),\n                $methods[1],\n                new Property(0, []),\n                $methods[2],\n            ]\n        ]);\n\n        $this->assertSame($methods, $class->getMethods());\n    }\n\n    public function testGetConstants(): void {\n        $constants = [\n            new ClassConst([new \\PhpParser\\Node\\Const_('foo', new String_('foo_value'))]),\n            new ClassConst([new \\PhpParser\\Node\\Const_('bar', new String_('bar_value'))]),\n        ];\n        $class = new Class_('Foo', [\n            'stmts' => [\n                new TraitUse([]),\n                $constants[0],\n                new ClassMethod('fooBar'),\n                $constants[1],\n            ]\n        ]);\n\n        $this->assertSame($constants, $class->getConstants());\n    }\n\n    public function testGetProperties(): void {\n        $properties = [\n            new Property(Modifiers::PUBLIC, [new PropertyItem('foo')]),\n            new Property(Modifiers::PUBLIC, [new PropertyItem('bar')]),\n        ];\n        $class = new Class_('Foo', [\n            'stmts' => [\n                new TraitUse([]),\n                $properties[0],\n                new ClassConst([]),\n                $properties[1],\n                new ClassMethod('fooBar'),\n            ]\n        ]);\n\n        $this->assertSame($properties, $class->getProperties());\n    }\n\n    public function testGetProperty(): void {\n        $properties = [\n            $fooProp = new Property(Modifiers::PUBLIC, [new PropertyItem('foo1')]),\n            $barProp = new Property(Modifiers::PUBLIC, [new PropertyItem('BAR1')]),\n            $fooBarProp = new Property(Modifiers::PUBLIC, [new PropertyItem('foo2'), new PropertyItem('bar2')]),\n        ];\n        $class = new Class_('Foo', [\n            'stmts' => [\n                new TraitUse([]),\n                $properties[0],\n                new ClassConst([]),\n                $properties[1],\n                new ClassMethod('fooBar'),\n                $properties[2],\n            ]\n        ]);\n\n        $this->assertSame($fooProp, $class->getProperty('foo1'));\n        $this->assertSame($barProp, $class->getProperty('BAR1'));\n        $this->assertSame($fooBarProp, $class->getProperty('foo2'));\n        $this->assertSame($fooBarProp, $class->getProperty('bar2'));\n        $this->assertNull($class->getProperty('bar1'));\n        $this->assertNull($class->getProperty('nonExisting'));\n    }\n\n    public function testGetMethod(): void {\n        $methodConstruct = new ClassMethod('__CONSTRUCT');\n        $methodTest = new ClassMethod('test');\n        $class = new Class_('Foo', [\n            'stmts' => [\n                new ClassConst([]),\n                $methodConstruct,\n                new Property(0, []),\n                $methodTest,\n            ]\n        ]);\n\n        $this->assertSame($methodConstruct, $class->getMethod('__construct'));\n        $this->assertSame($methodTest, $class->getMethod('test'));\n        $this->assertNull($class->getMethod('nonExisting'));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/Stmt/InterfaceTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Scalar\\String_;\n\nclass InterfaceTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testGetMethods(): void {\n        $methods = [\n            new ClassMethod('foo'),\n            new ClassMethod('bar'),\n        ];\n        $interface = new Interface_('Foo', [\n            'stmts' => [\n                new Node\\Stmt\\ClassConst([new Node\\Const_('C1', new Node\\Scalar\\String_('C1'))]),\n                $methods[0],\n                new Node\\Stmt\\ClassConst([new Node\\Const_('C2', new Node\\Scalar\\String_('C2'))]),\n                $methods[1],\n                new Node\\Stmt\\ClassConst([new Node\\Const_('C3', new Node\\Scalar\\String_('C3'))]),\n            ]\n        ]);\n\n        $this->assertSame($methods, $interface->getMethods());\n    }\n\n    public function testGetConstants(): void {\n        $constants = [\n            new ClassConst([new \\PhpParser\\Node\\Const_('foo', new String_('foo_value'))]),\n            new ClassConst([new \\PhpParser\\Node\\Const_('bar', new String_('bar_value'))]),\n        ];\n        $class = new Interface_('Foo', [\n            'stmts' => [\n                new TraitUse([]),\n                $constants[0],\n                new ClassMethod('fooBar'),\n                $constants[1],\n            ]\n        ]);\n\n        $this->assertSame($constants, $class->getConstants());\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Node/Stmt/PropertyTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Node\\Stmt;\n\nuse PhpParser\\Modifiers;\n\nclass PropertyTest extends \\PHPUnit\\Framework\\TestCase {\n    /**\n     * @dataProvider provideModifiers\n     */\n    public function testModifiers($modifier): void {\n        $node = new Property(\n            constant(Modifiers::class . '::' . strtoupper($modifier)),\n            [] // invalid\n        );\n\n        $this->assertTrue($node->{'is' . $modifier}());\n    }\n\n    public function testNoModifiers(): void {\n        $node = new Property(0, []);\n\n        $this->assertTrue($node->isPublic());\n        $this->assertFalse($node->isProtected());\n        $this->assertFalse($node->isPrivate());\n        $this->assertFalse($node->isStatic());\n        $this->assertFalse($node->isReadonly());\n        $this->assertFalse($node->isPublicSet());\n        $this->assertFalse($node->isProtectedSet());\n        $this->assertFalse($node->isPrivateSet());\n    }\n\n    public function testStaticImplicitlyPublic(): void {\n        $node = new Property(Modifiers::STATIC, []);\n        $this->assertTrue($node->isPublic());\n        $this->assertFalse($node->isProtected());\n        $this->assertFalse($node->isPrivate());\n        $this->assertTrue($node->isStatic());\n        $this->assertFalse($node->isReadonly());\n    }\n\n    public static function provideModifiers() {\n        return [\n            ['public'],\n            ['protected'],\n            ['private'],\n            ['static'],\n            ['readonly'],\n        ];\n    }\n\n    public function testSetVisibility() {\n        $node = new Property(Modifiers::PRIVATE_SET, []);\n        $this->assertTrue($node->isPrivateSet());\n        $node = new Property(Modifiers::PROTECTED_SET, []);\n        $this->assertTrue($node->isProtectedSet());\n        $node = new Property(Modifiers::PUBLIC_SET, []);\n        $this->assertTrue($node->isPublicSet());\n    }\n\n    public function testIsFinal() {\n        $node = new Property(Modifiers::FINAL, []);\n        $this->assertTrue($node->isFinal());\n    }\n\n    public function testIsAbstract() {\n        $node = new Property(Modifiers::ABSTRACT, []);\n        $this->assertTrue($node->isAbstract());\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NodeAbstractTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass DummyNode extends NodeAbstract {\n    public $subNode1;\n    public $subNode2;\n    public $notSubNode;\n\n    public function __construct($subNode1, $subNode2, $notSubNode, $attributes) {\n        parent::__construct($attributes);\n        $this->subNode1 = $subNode1;\n        $this->subNode2 = $subNode2;\n        $this->notSubNode = $notSubNode;\n    }\n\n    public function getSubNodeNames(): array {\n        return ['subNode1', 'subNode2'];\n    }\n\n    // This method is only overwritten because the node is located in an unusual namespace\n    public function getType(): string {\n        return 'Dummy';\n    }\n}\n\nclass NodeAbstractTest extends \\PHPUnit\\Framework\\TestCase {\n    public static function provideNodes() {\n        $attributes = [\n            'startLine' => 10,\n            'endLine' => 11,\n            'startTokenPos' => 12,\n            'endTokenPos' => 13,\n            'startFilePos' => 14,\n            'endFilePos' => 15,\n            'comments'  => [\n                new Comment('// Comment 1' . \"\\n\"),\n                new Comment\\Doc('/** doc comment */'),\n                new Comment('// Comment 2' . \"\\n\"),\n            ],\n        ];\n\n        $node = new DummyNode('value1', 'value2', 'value3', $attributes);\n\n        return [\n            [$attributes, $node],\n        ];\n    }\n\n    /**\n     * @dataProvider provideNodes\n     */\n    public function testConstruct(array $attributes, Node $node) {\n        $this->assertSame('Dummy', $node->getType());\n        $this->assertSame(['subNode1', 'subNode2'], $node->getSubNodeNames());\n        $this->assertSame(10, $node->getLine());\n        $this->assertSame(10, $node->getStartLine());\n        $this->assertSame(11, $node->getEndLine());\n        $this->assertSame(12, $node->getStartTokenPos());\n        $this->assertSame(13, $node->getEndTokenPos());\n        $this->assertSame(14, $node->getStartFilePos());\n        $this->assertSame(15, $node->getEndFilePos());\n        $this->assertSame('/** doc comment */', $node->getDocComment()->getText());\n        $this->assertSame('value1', $node->subNode1);\n        $this->assertSame('value2', $node->subNode2);\n        $this->assertTrue(isset($node->subNode1));\n        $this->assertTrue(isset($node->subNode2));\n        $this->assertTrue(!isset($node->subNode3));\n        $this->assertSame($attributes, $node->getAttributes());\n        $this->assertSame($attributes['comments'], $node->getComments());\n\n        return $node;\n    }\n\n    /**\n     * @dataProvider provideNodes\n     */\n    public function testGetDocComment(array $attributes, Node $node): void {\n        $this->assertSame('/** doc comment */', $node->getDocComment()->getText());\n        $comments = $node->getComments();\n\n        array_splice($comments, 1, 1, []); // remove doc comment\n        $node->setAttribute('comments', $comments);\n        $this->assertNull($node->getDocComment());\n\n        // Remove all comments.\n        $node->setAttribute('comments', []);\n        $this->assertNull($node->getDocComment());\n    }\n\n    public function testSetDocComment(): void {\n        $node = new DummyNode(null, null, null, []);\n\n        // Add doc comment to node without comments\n        $docComment = new Comment\\Doc('/** doc */');\n        $node->setDocComment($docComment);\n        $this->assertSame($docComment, $node->getDocComment());\n\n        // Replace it\n        $docComment = new Comment\\Doc('/** doc 2 */');\n        $node->setDocComment($docComment);\n        $this->assertSame($docComment, $node->getDocComment());\n\n        // Add docmment to node with other comments\n        $c1 = new Comment('/* foo */');\n        $c2 = new Comment('/* bar */');\n        $docComment = new Comment\\Doc('/** baz */');\n        $node->setAttribute('comments', [$c1, $c2]);\n        $node->setDocComment($docComment);\n        $this->assertSame([$c1, $c2, $docComment], $node->getAttribute('comments'));\n\n        // Replace doc comment that is not at the end.\n        $newDocComment = new Comment\\Doc('/** new baz */');\n        $node->setAttribute('comments', [$c1, $docComment, $c2]);\n        $node->setDocComment($newDocComment);\n        $this->assertSame([$c1, $newDocComment, $c2], $node->getAttribute('comments'));\n    }\n\n    /**\n     * @dataProvider provideNodes\n     */\n    public function testChange(array $attributes, DummyNode $node): void {\n        // direct modification\n        $node->subNode1 = 'newValue';\n        $this->assertSame('newValue', $node->subNode1);\n\n        // indirect modification\n        $subNode = &$node->subNode1;\n        $subNode = 'newNewValue';\n        $this->assertSame('newNewValue', $node->subNode1);\n\n        // removal\n        unset($node->subNode1);\n        $this->assertFalse(isset($node->subNode1));\n    }\n\n    /**\n     * @dataProvider provideNodes\n     */\n    public function testIteration(array $attributes, Node $node): void {\n        // Iteration is simple object iteration over properties,\n        // not over subnodes\n        $i = 0;\n        foreach ($node as $key => $value) {\n            if ($i === 0) {\n                $this->assertSame('subNode1', $key);\n                $this->assertSame('value1', $value);\n            } elseif ($i === 1) {\n                $this->assertSame('subNode2', $key);\n                $this->assertSame('value2', $value);\n            } elseif ($i === 2) {\n                $this->assertSame('notSubNode', $key);\n                $this->assertSame('value3', $value);\n            } else {\n                throw new \\Exception();\n            }\n            $i++;\n        }\n        $this->assertSame(3, $i);\n    }\n\n    public function testAttributes(): void {\n        /** @var $node Node */\n        $node = $this->getMockForAbstractClass(NodeAbstract::class);\n\n        $this->assertEmpty($node->getAttributes());\n\n        $node->setAttribute('key', 'value');\n        $this->assertTrue($node->hasAttribute('key'));\n        $this->assertSame('value', $node->getAttribute('key'));\n\n        $this->assertFalse($node->hasAttribute('doesNotExist'));\n        $this->assertNull($node->getAttribute('doesNotExist'));\n        $this->assertSame('default', $node->getAttribute('doesNotExist', 'default'));\n\n        $node->setAttribute('null', null);\n        $this->assertTrue($node->hasAttribute('null'));\n        $this->assertNull($node->getAttribute('null'));\n        $this->assertNull($node->getAttribute('null', 'default'));\n\n        $this->assertSame(\n            [\n                'key'  => 'value',\n                'null' => null,\n            ],\n            $node->getAttributes()\n        );\n\n        $node->setAttributes(\n            [\n                'a' => 'b',\n                'c' => null,\n            ]\n        );\n        $this->assertSame(\n            [\n                'a' => 'b',\n                'c' => null,\n            ],\n            $node->getAttributes()\n        );\n    }\n\n    public function testJsonSerialization(): void {\n        $code = <<<'PHP'\n<?php\n// comment\n/** doc comment */\nfunction functionName(&$a = 0, $b = 1.0) {\n    echo 'Foo';\n}\nPHP;\n        $expected = <<<'JSON'\n[\n    {\n        \"nodeType\": \"Stmt_Function\",\n        \"byRef\": false,\n        \"name\": {\n            \"nodeType\": \"Identifier\",\n            \"name\": \"functionName\",\n            \"attributes\": {\n                \"startLine\": 4,\n                \"startTokenPos\": 7,\n                \"startFilePos\": 45,\n                \"endLine\": 4,\n                \"endTokenPos\": 7,\n                \"endFilePos\": 56\n            }\n        },\n        \"params\": [\n            {\n                \"nodeType\": \"Param\",\n                \"type\": null,\n                \"byRef\": true,\n                \"variadic\": false,\n                \"var\": {\n                    \"nodeType\": \"Expr_Variable\",\n                    \"name\": \"a\",\n                    \"attributes\": {\n                        \"startLine\": 4,\n                        \"startTokenPos\": 10,\n                        \"startFilePos\": 59,\n                        \"endLine\": 4,\n                        \"endTokenPos\": 10,\n                        \"endFilePos\": 60\n                    }\n                },\n                \"default\": {\n                    \"nodeType\": \"Scalar_Int\",\n                    \"value\": 0,\n                    \"attributes\": {\n                        \"startLine\": 4,\n                        \"startTokenPos\": 14,\n                        \"startFilePos\": 64,\n                        \"endLine\": 4,\n                        \"endTokenPos\": 14,\n                        \"endFilePos\": 64,\n                        \"rawValue\": \"0\",\n                        \"kind\": 10\n                    }\n                },\n                \"flags\": 0,\n                \"attrGroups\": [],\n                \"hooks\": [],\n                \"attributes\": {\n                    \"startLine\": 4,\n                    \"startTokenPos\": 9,\n                    \"startFilePos\": 58,\n                    \"endLine\": 4,\n                    \"endTokenPos\": 14,\n                    \"endFilePos\": 64\n                }\n            },\n            {\n                \"nodeType\": \"Param\",\n                \"type\": null,\n                \"byRef\": false,\n                \"variadic\": false,\n                \"var\": {\n                    \"nodeType\": \"Expr_Variable\",\n                    \"name\": \"b\",\n                    \"attributes\": {\n                        \"startLine\": 4,\n                        \"startTokenPos\": 17,\n                        \"startFilePos\": 67,\n                        \"endLine\": 4,\n                        \"endTokenPos\": 17,\n                        \"endFilePos\": 68\n                    }\n                },\n                \"default\": {\n                    \"nodeType\": \"Scalar_Float\",\n                    \"value\": 1,\n                    \"attributes\": {\n                        \"startLine\": 4,\n                        \"startTokenPos\": 21,\n                        \"startFilePos\": 72,\n                        \"endLine\": 4,\n                        \"endTokenPos\": 21,\n                        \"endFilePos\": 74,\n                        \"rawValue\": \"1.0\"\n                    }\n                },\n                \"flags\": 0,\n                \"attrGroups\": [],\n                \"hooks\": [],\n                \"attributes\": {\n                    \"startLine\": 4,\n                    \"startTokenPos\": 17,\n                    \"startFilePos\": 67,\n                    \"endLine\": 4,\n                    \"endTokenPos\": 21,\n                    \"endFilePos\": 74\n                }\n            }\n        ],\n        \"returnType\": null,\n        \"stmts\": [\n            {\n                \"nodeType\": \"Stmt_Echo\",\n                \"exprs\": [\n                    {\n                        \"nodeType\": \"Scalar_String\",\n                        \"value\": \"Foo\",\n                        \"attributes\": {\n                            \"startLine\": 5,\n                            \"startTokenPos\": 28,\n                            \"startFilePos\": 88,\n                            \"endLine\": 5,\n                            \"endTokenPos\": 28,\n                            \"endFilePos\": 92,\n                            \"kind\": 1,\n                            \"rawValue\": \"'Foo'\"\n                        }\n                    }\n                ],\n                \"attributes\": {\n                    \"startLine\": 5,\n                    \"startTokenPos\": 26,\n                    \"startFilePos\": 83,\n                    \"endLine\": 5,\n                    \"endTokenPos\": 29,\n                    \"endFilePos\": 93\n                }\n            }\n        ],\n        \"attrGroups\": [],\n        \"attributes\": {\n            \"startLine\": 4,\n            \"startTokenPos\": 5,\n            \"startFilePos\": 36,\n            \"endLine\": 6,\n            \"endTokenPos\": 31,\n            \"endFilePos\": 95,\n            \"comments\": [\n                {\n                    \"nodeType\": \"Comment\",\n                    \"text\": \"\\/\\/ comment\",\n                    \"line\": 2,\n                    \"filePos\": 6,\n                    \"tokenPos\": 1,\n                    \"endLine\": 2,\n                    \"endFilePos\": 15,\n                    \"endTokenPos\": 1\n                },\n                {\n                    \"nodeType\": \"Comment_Doc\",\n                    \"text\": \"\\/** doc comment *\\/\",\n                    \"line\": 3,\n                    \"filePos\": 17,\n                    \"tokenPos\": 3,\n                    \"endLine\": 3,\n                    \"endFilePos\": 34,\n                    \"endTokenPos\": 3\n                }\n            ]\n        }\n    }\n]\nJSON;\n        $expected81 = <<<'JSON'\n[\n    {\n        \"nodeType\": \"Stmt_Function\",\n        \"attributes\": {\n            \"startLine\": 4,\n            \"startTokenPos\": 5,\n            \"startFilePos\": 36,\n            \"endLine\": 6,\n            \"endTokenPos\": 31,\n            \"endFilePos\": 95,\n            \"comments\": [\n                {\n                    \"nodeType\": \"Comment\",\n                    \"text\": \"\\/\\/ comment\",\n                    \"line\": 2,\n                    \"filePos\": 6,\n                    \"tokenPos\": 1,\n                    \"endLine\": 2,\n                    \"endFilePos\": 15,\n                    \"endTokenPos\": 1\n                },\n                {\n                    \"nodeType\": \"Comment_Doc\",\n                    \"text\": \"\\/** doc comment *\\/\",\n                    \"line\": 3,\n                    \"filePos\": 17,\n                    \"tokenPos\": 3,\n                    \"endLine\": 3,\n                    \"endFilePos\": 34,\n                    \"endTokenPos\": 3\n                }\n            ]\n        },\n        \"byRef\": false,\n        \"name\": {\n            \"nodeType\": \"Identifier\",\n            \"attributes\": {\n                \"startLine\": 4,\n                \"startTokenPos\": 7,\n                \"startFilePos\": 45,\n                \"endLine\": 4,\n                \"endTokenPos\": 7,\n                \"endFilePos\": 56\n            },\n            \"name\": \"functionName\"\n        },\n        \"params\": [\n            {\n                \"nodeType\": \"Param\",\n                \"attributes\": {\n                    \"startLine\": 4,\n                    \"startTokenPos\": 9,\n                    \"startFilePos\": 58,\n                    \"endLine\": 4,\n                    \"endTokenPos\": 14,\n                    \"endFilePos\": 64\n                },\n                \"type\": null,\n                \"byRef\": true,\n                \"variadic\": false,\n                \"var\": {\n                    \"nodeType\": \"Expr_Variable\",\n                    \"attributes\": {\n                        \"startLine\": 4,\n                        \"startTokenPos\": 10,\n                        \"startFilePos\": 59,\n                        \"endLine\": 4,\n                        \"endTokenPos\": 10,\n                        \"endFilePos\": 60\n                    },\n                    \"name\": \"a\"\n                },\n                \"default\": {\n                    \"nodeType\": \"Scalar_Int\",\n                    \"attributes\": {\n                        \"startLine\": 4,\n                        \"startTokenPos\": 14,\n                        \"startFilePos\": 64,\n                        \"endLine\": 4,\n                        \"endTokenPos\": 14,\n                        \"endFilePos\": 64,\n                        \"rawValue\": \"0\",\n                        \"kind\": 10\n                    },\n                    \"value\": 0\n                },\n                \"flags\": 0,\n                \"attrGroups\": [],\n                \"hooks\": []\n            },\n            {\n                \"nodeType\": \"Param\",\n                \"attributes\": {\n                    \"startLine\": 4,\n                    \"startTokenPos\": 17,\n                    \"startFilePos\": 67,\n                    \"endLine\": 4,\n                    \"endTokenPos\": 21,\n                    \"endFilePos\": 74\n                },\n                \"type\": null,\n                \"byRef\": false,\n                \"variadic\": false,\n                \"var\": {\n                    \"nodeType\": \"Expr_Variable\",\n                    \"attributes\": {\n                        \"startLine\": 4,\n                        \"startTokenPos\": 17,\n                        \"startFilePos\": 67,\n                        \"endLine\": 4,\n                        \"endTokenPos\": 17,\n                        \"endFilePos\": 68\n                    },\n                    \"name\": \"b\"\n                },\n                \"default\": {\n                    \"nodeType\": \"Scalar_Float\",\n                    \"attributes\": {\n                        \"startLine\": 4,\n                        \"startTokenPos\": 21,\n                        \"startFilePos\": 72,\n                        \"endLine\": 4,\n                        \"endTokenPos\": 21,\n                        \"endFilePos\": 74,\n                        \"rawValue\": \"1.0\"\n                    },\n                    \"value\": 1\n                },\n                \"flags\": 0,\n                \"attrGroups\": [],\n                \"hooks\": []\n            }\n        ],\n        \"returnType\": null,\n        \"stmts\": [\n            {\n                \"nodeType\": \"Stmt_Echo\",\n                \"attributes\": {\n                    \"startLine\": 5,\n                    \"startTokenPos\": 26,\n                    \"startFilePos\": 83,\n                    \"endLine\": 5,\n                    \"endTokenPos\": 29,\n                    \"endFilePos\": 93\n                },\n                \"exprs\": [\n                    {\n                        \"nodeType\": \"Scalar_String\",\n                        \"attributes\": {\n                            \"startLine\": 5,\n                            \"startTokenPos\": 28,\n                            \"startFilePos\": 88,\n                            \"endLine\": 5,\n                            \"endTokenPos\": 28,\n                            \"endFilePos\": 92,\n                            \"kind\": 1,\n                            \"rawValue\": \"'Foo'\"\n                        },\n                        \"value\": \"Foo\"\n                    }\n                ]\n            }\n        ],\n        \"attrGroups\": []\n    }\n]\nJSON;\n\n        if (version_compare(PHP_VERSION, '8.1', '>=')) {\n            $expected = $expected81;\n        }\n\n        $parser = new Parser\\Php7(new Lexer());\n        $stmts = $parser->parse(canonicalize($code));\n        $json = json_encode($stmts, JSON_PRETTY_PRINT);\n        $this->assertEquals(canonicalize($expected), canonicalize($json));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NodeDumperTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass NodeDumperTest extends \\PHPUnit\\Framework\\TestCase {\n    private function canonicalize($string) {\n        return str_replace(\"\\r\\n\", \"\\n\", $string);\n    }\n\n    /**\n     * @dataProvider provideTestDump\n     */\n    public function testDump($node, $dump): void {\n        $dumper = new NodeDumper();\n\n        $this->assertSame($this->canonicalize($dump), $this->canonicalize($dumper->dump($node)));\n    }\n\n    public static function provideTestDump() {\n        return [\n            [\n                [],\n'array(\n)'\n            ],\n            [\n                ['Foo', 'Bar', 'Key' => 'FooBar'],\n'array(\n    0: Foo\n    1: Bar\n    Key: FooBar\n)'\n            ],\n            [\n                new Node\\Name(['Hallo', 'World']),\n'Name(\n    name: Hallo\\World\n)'\n            ],\n            [\n                new Node\\Expr\\Array_([\n                    new Node\\ArrayItem(new Node\\Scalar\\String_('Foo'))\n                ]),\n'Expr_Array(\n    items: array(\n        0: ArrayItem(\n            key: null\n            value: Scalar_String(\n                value: Foo\n            )\n            byRef: false\n            unpack: false\n        )\n    )\n)'\n            ],\n        ];\n    }\n\n    public function testDumpWithPositions(): void {\n        $parser = (new ParserFactory())->createForHostVersion();\n        $dumper = new NodeDumper(['dumpPositions' => true]);\n\n        $code = \"<?php\\n\\$a = 1;\\necho \\$a;\";\n        $expected = <<<'OUT'\narray(\n    0: Stmt_Expression[2:1 - 2:7](\n        expr: Expr_Assign[2:1 - 2:6](\n            var: Expr_Variable[2:1 - 2:2](\n                name: a\n            )\n            expr: Scalar_Int[2:6 - 2:6](\n                value: 1\n            )\n        )\n    )\n    1: Stmt_Echo[3:1 - 3:8](\n        exprs: array(\n            0: Expr_Variable[3:6 - 3:7](\n                name: a\n            )\n        )\n    )\n)\nOUT;\n\n        $stmts = $parser->parse($code);\n        $dump = $dumper->dump($stmts, $code);\n\n        $this->assertSame($this->canonicalize($expected), $this->canonicalize($dump));\n    }\n\n    public function testError(): void {\n        $this->expectException(\\InvalidArgumentException::class);\n        $this->expectExceptionMessage('Can only dump nodes and arrays.');\n        $dumper = new NodeDumper();\n        $dumper->dump(new \\stdClass());\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NodeFinderTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Expr;\n\nclass NodeFinderTest extends \\PHPUnit\\Framework\\TestCase {\n    private function getStmtsAndVars() {\n        $assign = new Expr\\Assign(new Expr\\Variable('a'), new Expr\\BinaryOp\\Concat(\n            new Expr\\Variable('b'), new Expr\\Variable('c')\n        ));\n        $stmts = [new Node\\Stmt\\Expression($assign)];\n        $vars = [$assign->var, $assign->expr->left, $assign->expr->right];\n        return [$stmts, $vars];\n    }\n\n    public function testFind(): void {\n        $finder = new NodeFinder();\n        list($stmts, $vars) = $this->getStmtsAndVars();\n        $varFilter = function (Node $node) {\n            return $node instanceof Expr\\Variable;\n        };\n        $this->assertSame($vars, $finder->find($stmts, $varFilter));\n        $this->assertSame($vars, $finder->find($stmts[0], $varFilter));\n\n        $noneFilter = function () {\n            return false;\n        };\n        $this->assertSame([], $finder->find($stmts, $noneFilter));\n    }\n\n    public function testFindInstanceOf(): void {\n        $finder = new NodeFinder();\n        list($stmts, $vars) = $this->getStmtsAndVars();\n        $this->assertSame($vars, $finder->findInstanceOf($stmts, Expr\\Variable::class));\n        $this->assertSame($vars, $finder->findInstanceOf($stmts[0], Expr\\Variable::class));\n        $this->assertSame([], $finder->findInstanceOf($stmts, Expr\\BinaryOp\\Mul::class));\n    }\n\n    public function testFindFirst(): void {\n        $finder = new NodeFinder();\n        list($stmts, $vars) = $this->getStmtsAndVars();\n        $varFilter = function (Node $node) {\n            return $node instanceof Expr\\Variable;\n        };\n        $this->assertSame($vars[0], $finder->findFirst($stmts, $varFilter));\n        $this->assertSame($vars[0], $finder->findFirst($stmts[0], $varFilter));\n\n        $noneFilter = function () {\n            return false;\n        };\n        $this->assertNull($finder->findFirst($stmts, $noneFilter));\n    }\n\n    public function testFindFirstInstanceOf(): void {\n        $finder = new NodeFinder();\n        list($stmts, $vars) = $this->getStmtsAndVars();\n        $this->assertSame($vars[0], $finder->findFirstInstanceOf($stmts, Expr\\Variable::class));\n        $this->assertSame($vars[0], $finder->findFirstInstanceOf($stmts[0], Expr\\Variable::class));\n        $this->assertNull($finder->findFirstInstanceOf($stmts, Expr\\BinaryOp\\Mul::class));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NodeTraverserTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Scalar\\String_;\nuse PhpParser\\Node\\Stmt\\Else_;\nuse PhpParser\\Node\\Stmt\\If_;\n\nclass NodeTraverserTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testNonModifying(): void {\n        $str1Node = new String_('Foo');\n        $str2Node = new String_('Bar');\n        $echoNode = new Node\\Stmt\\Echo_([$str1Node, $str2Node]);\n        $stmts    = [$echoNode];\n\n        $visitor = new NodeVisitorForTesting();\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor);\n\n        $this->assertEquals($stmts, $traverser->traverse($stmts));\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $echoNode],\n            ['enterNode', $str1Node],\n            ['leaveNode', $str1Node],\n            ['enterNode', $str2Node],\n            ['leaveNode', $str2Node],\n            ['leaveNode', $echoNode],\n            ['afterTraverse', $stmts],\n        ], $visitor->trace);\n    }\n\n    public function testModifying(): void {\n        $str1Node  = new String_('Foo');\n        $str2Node  = new String_('Bar');\n        $printNode = new Expr\\Print_($str1Node);\n\n        // Visitor 2 performs changes, visitors 1 and 3 observe the changes.\n        $visitor1 = new NodeVisitorForTesting();\n        $visitor2 = new NodeVisitorForTesting([\n            ['beforeTraverse', [], [$str1Node]],\n            ['enterNode', $str1Node, $printNode],\n            ['enterNode', $str1Node, $str2Node],\n            ['leaveNode', $str2Node, $str1Node],\n            ['leaveNode', $printNode, $str1Node],\n            ['afterTraverse', [$str1Node], []],\n        ]);\n        $visitor3 = new NodeVisitorForTesting();\n\n        $traverser = new NodeTraverser($visitor1, $visitor2, $visitor3);\n\n        // as all operations are reversed we end where we start\n        $this->assertEquals([], $traverser->traverse([]));\n        $this->assertEquals([\n            // Sees nodes before changes on entry.\n            ['beforeTraverse', []],\n            ['enterNode', $str1Node],\n            ['enterNode', $str1Node],\n            // Sees nodes after changes on leave.\n            ['leaveNode', $str1Node],\n            ['leaveNode', $str1Node],\n            ['afterTraverse', []],\n        ], $visitor1->trace);\n        $this->assertEquals([\n            // Sees nodes after changes on entry.\n            ['beforeTraverse', [$str1Node]],\n            ['enterNode', $printNode],\n            ['enterNode', $str2Node],\n            // Sees nodes before changes on leave.\n            ['leaveNode', $str2Node],\n            ['leaveNode', $printNode],\n            ['afterTraverse', [$str1Node]],\n        ], $visitor3->trace);\n    }\n\n    public function testRemoveFromLeave(): void {\n        $str1Node = new String_('Foo');\n        $str2Node = new String_('Bar');\n\n        $visitor = new NodeVisitorForTesting([\n            ['leaveNode', $str1Node, NodeVisitor::REMOVE_NODE],\n        ]);\n        $visitor2 = new NodeVisitorForTesting();\n\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor2);\n        $traverser->addVisitor($visitor);\n\n        $stmts = [$str1Node, $str2Node];\n        $this->assertEquals([$str2Node], $traverser->traverse($stmts));\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $str1Node],\n            ['enterNode', $str2Node],\n            ['leaveNode', $str2Node],\n            ['afterTraverse', [$str2Node]],\n        ], $visitor2->trace);\n    }\n\n    public function testRemoveFromEnter(): void {\n        $str1Node = new String_('Foo');\n        $str2Node = new String_('Bar');\n\n        $visitor = new NodeVisitorForTesting([\n            ['enterNode', $str1Node, NodeVisitor::REMOVE_NODE],\n        ]);\n        $visitor2 = new NodeVisitorForTesting();\n\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor);\n        $traverser->addVisitor($visitor2);\n\n        $stmts = [$str1Node, $str2Node];\n        $this->assertEquals([$str2Node], $traverser->traverse($stmts));\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $str2Node],\n            ['leaveNode', $str2Node],\n            ['afterTraverse', [$str2Node]],\n        ], $visitor2->trace);\n    }\n\n    public function testReturnArrayFromEnter(): void {\n        $str1Node = new String_('Str1');\n        $str2Node = new String_('Str2');\n        $str3Node = new String_('Str3');\n        $str4Node = new String_('Str4');\n\n        $visitor = new NodeVisitorForTesting([\n            ['enterNode', $str1Node, [$str3Node, $str4Node]],\n        ]);\n        $visitor2 = new NodeVisitorForTesting();\n\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor);\n        $traverser->addVisitor($visitor2);\n\n        $stmts = [$str1Node, $str2Node];\n        $this->assertEquals([$str3Node, $str4Node, $str2Node], $traverser->traverse($stmts));\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $str2Node],\n            ['leaveNode', $str2Node],\n            ['afterTraverse', [$str3Node, $str4Node, $str2Node]],\n        ], $visitor2->trace);\n    }\n\n    public function testMerge(): void {\n        $strStart  = new String_('Start');\n        $strMiddle = new String_('End');\n        $strEnd    = new String_('Middle');\n        $strR1     = new String_('Replacement 1');\n        $strR2     = new String_('Replacement 2');\n\n        $visitor = new NodeVisitorForTesting([\n            ['leaveNode', $strMiddle, [$strR1, $strR2]],\n        ]);\n\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor);\n\n        $this->assertEquals(\n            [$strStart, $strR1, $strR2, $strEnd],\n            $traverser->traverse([$strStart, $strMiddle, $strEnd])\n        );\n    }\n\n    public function testInvalidDeepArray(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Invalid node structure: Contains nested arrays');\n        $strNode = new String_('Foo');\n        $stmts = [[[$strNode]]];\n\n        $traverser = new NodeTraverser();\n        $this->assertEquals($stmts, $traverser->traverse($stmts));\n    }\n\n    public function testDontTraverseChildren(): void {\n        $strNode = new String_('str');\n        $printNode = new Expr\\Print_($strNode);\n        $varNode = new Expr\\Variable('foo');\n        $mulNode = new Expr\\BinaryOp\\Mul($varNode, $varNode);\n        $negNode = new Expr\\UnaryMinus($mulNode);\n        $stmts = [$printNode, $negNode];\n\n        $visitor1 = new NodeVisitorForTesting([\n            ['enterNode', $printNode, NodeVisitor::DONT_TRAVERSE_CHILDREN],\n        ]);\n        $visitor2 = new NodeVisitorForTesting([\n            ['enterNode', $mulNode, NodeVisitor::DONT_TRAVERSE_CHILDREN],\n        ]);\n\n        $expectedTrace = [\n            ['beforeTraverse', $stmts],\n            ['enterNode', $printNode],\n            ['leaveNode', $printNode],\n            ['enterNode', $negNode],\n            ['enterNode', $mulNode],\n            ['leaveNode', $mulNode],\n            ['leaveNode', $negNode],\n            ['afterTraverse', $stmts],\n        ];\n\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor1);\n        $traverser->addVisitor($visitor2);\n\n        $this->assertEquals($stmts, $traverser->traverse($stmts));\n        $this->assertEquals($expectedTrace, $visitor1->trace);\n        $this->assertEquals($expectedTrace, $visitor2->trace);\n    }\n\n    public function testDontTraverseCurrentAndChildren(): void {\n        // print 'str'; -($foo * $foo);\n        $strNode = new String_('str');\n        $printNode = new Expr\\Print_($strNode);\n        $varNode = new Expr\\Variable('foo');\n        $mulNode = new Expr\\BinaryOp\\Mul($varNode, $varNode);\n        $divNode = new Expr\\BinaryOp\\Div($varNode, $varNode);\n        $negNode = new Expr\\UnaryMinus($mulNode);\n        $stmts = [$printNode, $negNode];\n\n        $visitor1 = new NodeVisitorForTesting([\n            ['enterNode', $printNode, NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN],\n            ['enterNode', $mulNode, NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN],\n            ['leaveNode', $mulNode, $divNode],\n        ]);\n        $visitor2 = new NodeVisitorForTesting();\n\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor1);\n        $traverser->addVisitor($visitor2);\n\n        $resultStmts = $traverser->traverse($stmts);\n        $this->assertInstanceOf(Expr\\BinaryOp\\Div::class, $resultStmts[1]->expr);\n\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $printNode],\n            ['leaveNode', $printNode],\n            ['enterNode', $negNode],\n            ['enterNode', $mulNode],\n            ['leaveNode', $mulNode],\n            ['leaveNode', $negNode],\n            ['afterTraverse', $resultStmts],\n        ], $visitor1->trace);\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $negNode],\n            ['leaveNode', $negNode],\n            ['afterTraverse', $resultStmts],\n        ], $visitor2->trace);\n    }\n\n    public function testStopTraversal(): void {\n        $varNode1 = new Expr\\Variable('a');\n        $varNode2 = new Expr\\Variable('b');\n        $varNode3 = new Expr\\Variable('c');\n        $mulNode = new Expr\\BinaryOp\\Mul($varNode1, $varNode2);\n        $printNode = new Expr\\Print_($varNode3);\n        $stmts = [$mulNode, $printNode];\n\n        // From enterNode() with array parent\n        $visitor = new NodeVisitorForTesting([\n            ['enterNode', $mulNode, NodeVisitor::STOP_TRAVERSAL],\n        ]);\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor);\n        $this->assertEquals($stmts, $traverser->traverse($stmts));\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $mulNode],\n            ['afterTraverse', $stmts],\n        ], $visitor->trace);\n\n        // From enterNode with Node parent\n        $visitor = new NodeVisitorForTesting([\n            ['enterNode', $varNode1, NodeVisitor::STOP_TRAVERSAL],\n        ]);\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor);\n        $this->assertEquals($stmts, $traverser->traverse($stmts));\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $mulNode],\n            ['enterNode', $varNode1],\n            ['afterTraverse', $stmts],\n        ], $visitor->trace);\n\n        // From leaveNode with Node parent\n        $visitor = new NodeVisitorForTesting([\n            ['leaveNode', $varNode1, NodeVisitor::STOP_TRAVERSAL],\n        ]);\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor);\n        $this->assertEquals($stmts, $traverser->traverse($stmts));\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $mulNode],\n            ['enterNode', $varNode1],\n            ['leaveNode', $varNode1],\n            ['afterTraverse', $stmts],\n        ], $visitor->trace);\n\n        // From leaveNode with array parent\n        $visitor = new NodeVisitorForTesting([\n            ['leaveNode', $mulNode, NodeVisitor::STOP_TRAVERSAL],\n        ]);\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor);\n        $this->assertEquals($stmts, $traverser->traverse($stmts));\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $mulNode],\n            ['enterNode', $varNode1],\n            ['leaveNode', $varNode1],\n            ['enterNode', $varNode2],\n            ['leaveNode', $varNode2],\n            ['leaveNode', $mulNode],\n            ['afterTraverse', $stmts],\n        ], $visitor->trace);\n\n        // Check that pending array modifications are still carried out\n        $visitor = new NodeVisitorForTesting([\n            ['leaveNode', $mulNode, NodeVisitor::REMOVE_NODE],\n            ['enterNode', $printNode, NodeVisitor::STOP_TRAVERSAL],\n        ]);\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor);\n        $this->assertEquals([$printNode], $traverser->traverse($stmts));\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $mulNode],\n            ['enterNode', $varNode1],\n            ['leaveNode', $varNode1],\n            ['enterNode', $varNode2],\n            ['leaveNode', $varNode2],\n            ['leaveNode', $mulNode],\n            ['enterNode', $printNode],\n            ['afterTraverse', [$printNode]],\n        ], $visitor->trace);\n    }\n\n    public function testReplaceWithNull(): void {\n        $one = new Int_(1);\n        $else1 = new Else_();\n        $else2 = new Else_();\n        $if1 = new If_($one, ['else' => $else1]);\n        $if2 = new If_($one, ['else' => $else2]);\n        $stmts = [$if1, $if2];\n        $visitor1 = new NodeVisitorForTesting([\n            ['enterNode', $else1, NodeVisitor::REPLACE_WITH_NULL],\n            ['leaveNode', $else2, NodeVisitor::REPLACE_WITH_NULL],\n        ]);\n        $visitor2 = new NodeVisitorForTesting();\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor1);\n        $traverser->addVisitor($visitor2);\n        $newStmts = $traverser->traverse($stmts);\n        $this->assertEquals([\n            new If_($one),\n            new If_($one),\n        ], $newStmts);\n        $this->assertEquals([\n            ['beforeTraverse', $stmts],\n            ['enterNode', $if1],\n            ['enterNode', $one],\n            // We never see the if1 Else node.\n            ['leaveNode', $one],\n            ['leaveNode', $if1],\n            ['enterNode', $if2],\n            ['enterNode', $one],\n            ['leaveNode', $one],\n            // We do see the if2 Else node, as it will only be replaced afterwards.\n            ['enterNode', $else2],\n            ['leaveNode', $else2],\n            ['leaveNode', $if2],\n            ['afterTraverse', $stmts],\n        ], $visitor2->trace);\n    }\n\n    public function testRemovingVisitor(): void {\n        $visitor1 = new class () extends NodeVisitorAbstract {};\n        $visitor2 = new class () extends NodeVisitorAbstract {};\n        $visitor3 = new class () extends NodeVisitorAbstract {};\n\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor1);\n        $traverser->addVisitor($visitor2);\n        $traverser->addVisitor($visitor3);\n\n        $getVisitors = (function () {\n            return $this->visitors;\n        })->bindTo($traverser, NodeTraverser::class);\n\n        $preExpected = [$visitor1, $visitor2, $visitor3];\n        $this->assertSame($preExpected, $getVisitors());\n\n        $traverser->removeVisitor($visitor2);\n\n        $postExpected = [$visitor1, $visitor3];\n        $this->assertSame($postExpected, $getVisitors());\n    }\n\n    public function testNoCloneNodes(): void {\n        $stmts = [new Node\\Stmt\\Echo_([new String_('Foo'), new String_('Bar')])];\n\n        $traverser = new NodeTraverser();\n\n        $this->assertSame($stmts, $traverser->traverse($stmts));\n    }\n\n    /**\n     * @dataProvider provideTestInvalidReturn\n     */\n    public function testInvalidReturn($stmts, $visitor, $message): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage($message);\n\n        $traverser = new NodeTraverser();\n        $traverser->addVisitor($visitor);\n        $traverser->traverse($stmts);\n    }\n\n    public static function provideTestInvalidReturn() {\n        $num = new Node\\Scalar\\Int_(42);\n        $expr = new Node\\Stmt\\Expression($num);\n        $stmts = [$expr];\n\n        $visitor1 = new NodeVisitorForTesting([\n            ['enterNode', $expr, 'foobar'],\n        ]);\n        $visitor2 = new NodeVisitorForTesting([\n            ['enterNode', $num, 'foobar'],\n        ]);\n        $visitor3 = new NodeVisitorForTesting([\n            ['leaveNode', $num, 'foobar'],\n        ]);\n        $visitor4 = new NodeVisitorForTesting([\n            ['leaveNode', $expr, 'foobar'],\n        ]);\n        $visitor5 = new NodeVisitorForTesting([\n            ['leaveNode', $num, [new Node\\Scalar\\Float_(42.0)]],\n        ]);\n        $visitor6 = new NodeVisitorForTesting([\n            ['leaveNode', $expr, false],\n        ]);\n        $visitor7 = new NodeVisitorForTesting([\n            ['enterNode', $expr, new Node\\Scalar\\Int_(42)],\n        ]);\n        $visitor8 = new NodeVisitorForTesting([\n            ['enterNode', $num, new Node\\Stmt\\Return_()],\n        ]);\n        $visitor9 = new NodeVisitorForTesting([\n            ['enterNode', $expr, NodeVisitor::REPLACE_WITH_NULL],\n        ]);\n        $visitor10 = new NodeVisitorForTesting([\n            ['leaveNode', $expr, NodeVisitor::REPLACE_WITH_NULL],\n        ]);\n\n        return [\n            [$stmts, $visitor1, 'enterNode() returned invalid value of type string'],\n            [$stmts, $visitor2, 'enterNode() returned invalid value of type string'],\n            [$stmts, $visitor3, 'leaveNode() returned invalid value of type string'],\n            [$stmts, $visitor4, 'leaveNode() returned invalid value of type string'],\n            [$stmts, $visitor5, 'leaveNode() may only return an array if the parent structure is an array'],\n            [$stmts, $visitor6, 'leaveNode() returned invalid value of type bool'],\n            [$stmts, $visitor7, 'Trying to replace statement (Stmt_Expression) with expression (Scalar_Int). Are you missing a Stmt_Expression wrapper?'],\n            [$stmts, $visitor8, 'Trying to replace expression (Scalar_Int) with statement (Stmt_Return)'],\n            [$stmts, $visitor9, 'REPLACE_WITH_NULL can not be used if the parent structure is an array'],\n            [$stmts, $visitor10, 'REPLACE_WITH_NULL can not be used if the parent structure is an array'],\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NodeVisitor/FindingVisitorTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\NodeTraverser;\n\nclass FindingVisitorTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testFindVariables(): void {\n        $traverser = new NodeTraverser();\n        $visitor = new FindingVisitor(function (Node $node) {\n            return $node instanceof Node\\Expr\\Variable;\n        });\n        $traverser->addVisitor($visitor);\n\n        $assign = new Expr\\Assign(new Expr\\Variable('a'), new Expr\\BinaryOp\\Concat(\n            new Expr\\Variable('b'), new Expr\\Variable('c')\n        ));\n        $stmts = [new Node\\Stmt\\Expression($assign)];\n\n        $traverser->traverse($stmts);\n        $this->assertSame([\n            $assign->var,\n            $assign->expr->left,\n            $assign->expr->right,\n        ], $visitor->getFoundNodes());\n    }\n\n    public function testFindAll(): void {\n        $traverser = new NodeTraverser();\n        $visitor = new FindingVisitor(function (Node $node) {\n            return true; // All nodes\n        });\n        $traverser->addVisitor($visitor);\n\n        $assign = new Expr\\Assign(new Expr\\Variable('a'), new Expr\\BinaryOp\\Concat(\n            new Expr\\Variable('b'), new Expr\\Variable('c')\n        ));\n        $stmts = [new Node\\Stmt\\Expression($assign)];\n\n        $traverser->traverse($stmts);\n        $this->assertSame([\n            $stmts[0],\n            $assign,\n            $assign->var,\n            $assign->expr,\n            $assign->expr->left,\n            $assign->expr->right,\n        ], $visitor->getFoundNodes());\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NodeVisitor/FirstFindingVisitorTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\NodeTraverser;\n\nclass FirstFindingVisitorTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testFindFirstVariable(): void {\n        $traverser = new NodeTraverser();\n        $visitor = new FirstFindingVisitor(function (Node $node) {\n            return $node instanceof Node\\Expr\\Variable;\n        });\n        $traverser->addVisitor($visitor);\n\n        $assign = new Expr\\Assign(new Expr\\Variable('a'), new Expr\\Variable('b'));\n        $stmts = [new Node\\Stmt\\Expression($assign)];\n\n        $traverser->traverse($stmts);\n        $this->assertSame($assign->var, $visitor->getFoundNode());\n    }\n\n    public function testFindNone(): void {\n        $traverser = new NodeTraverser();\n        $visitor = new FirstFindingVisitor(function (Node $node) {\n            return $node instanceof Node\\Expr\\BinaryOp;\n        });\n        $traverser->addVisitor($visitor);\n\n        $assign = new Expr\\Assign(new Expr\\Variable('a'), new Expr\\Variable('b'));\n        $stmts = [new Node\\Stmt\\Expression($assign)];\n\n        $traverser->traverse($stmts);\n        $this->assertNull($visitor->getFoundNode());\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NodeVisitor/NameResolverTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Stmt;\n\nclass NameResolverTest extends \\PHPUnit\\Framework\\TestCase {\n    private function canonicalize($string) {\n        return str_replace(\"\\r\\n\", \"\\n\", $string);\n    }\n\n    /**\n     * @covers \\PhpParser\\NodeVisitor\\NameResolver\n     */\n    public function testResolveNames(): void {\n        $code = <<<'EOC'\n<?php\n\nnamespace Foo {\n    use Hallo as Hi;\n\n    new Bar();\n    new Hi();\n    new Hi\\Bar();\n    new \\Bar();\n    new namespace\\Bar();\n\n    bar();\n    hi();\n    Hi\\bar();\n    foo\\bar();\n    \\bar();\n    namespace\\bar();\n}\nnamespace {\n    use Hallo as Hi;\n\n    new Bar();\n    new Hi();\n    new Hi\\Bar();\n    new \\Bar();\n    new namespace\\Bar();\n\n    bar();\n    hi();\n    Hi\\bar();\n    foo\\bar();\n    \\bar();\n    namespace\\bar();\n}\nnamespace Bar {\n    use function foo\\bar as baz;\n    use const foo\\BAR as BAZ;\n    use foo as bar;\n\n    bar();\n    baz();\n    bar\\foo();\n    baz\\foo();\n    BAR();\n    BAZ();\n    BAR\\FOO();\n    BAZ\\FOO();\n\n    bar;\n    baz;\n    bar\\foo;\n    baz\\foo;\n    BAR;\n    BAZ;\n    BAR\\FOO;\n    BAZ\\FOO;\n}\nnamespace Baz {\n    use A\\T\\{B\\C, D\\E};\n    use function X\\T\\{b\\c, d\\e};\n    use const Y\\T\\{B\\C, D\\E};\n    use Z\\T\\{G, function f, const K};\n\n    new C;\n    new E;\n    new C\\D;\n    new E\\F;\n    new G;\n\n    c();\n    e();\n    f();\n    C;\n    E;\n    K;\n}\nEOC;\n        $expectedCode = <<<'EOC'\nnamespace Foo {\n    use Hallo as Hi;\n    new \\Foo\\Bar();\n    new \\Hallo();\n    new \\Hallo\\Bar();\n    new \\Bar();\n    new \\Foo\\Bar();\n    bar();\n    hi();\n    \\Hallo\\bar();\n    \\Foo\\foo\\bar();\n    \\bar();\n    \\Foo\\bar();\n}\nnamespace {\n    use Hallo as Hi;\n    new \\Bar();\n    new \\Hallo();\n    new \\Hallo\\Bar();\n    new \\Bar();\n    new \\Bar();\n    \\bar();\n    \\hi();\n    \\Hallo\\bar();\n    \\foo\\bar();\n    \\bar();\n    \\bar();\n}\nnamespace Bar {\n    use function foo\\bar as baz;\n    use const foo\\BAR as BAZ;\n    use foo as bar;\n    bar();\n    \\foo\\bar();\n    \\foo\\foo();\n    \\Bar\\baz\\foo();\n    BAR();\n    \\foo\\bar();\n    \\foo\\FOO();\n    \\Bar\\BAZ\\FOO();\n    bar;\n    baz;\n    \\foo\\foo;\n    \\Bar\\baz\\foo;\n    BAR;\n    \\foo\\BAR;\n    \\foo\\FOO;\n    \\Bar\\BAZ\\FOO;\n}\nnamespace Baz {\n    use A\\T\\{B\\C, D\\E};\n    use function X\\T\\{b\\c, d\\e};\n    use const Y\\T\\{B\\C, D\\E};\n    use Z\\T\\{G, function f, const K};\n    new \\A\\T\\B\\C();\n    new \\A\\T\\D\\E();\n    new \\A\\T\\B\\C\\D();\n    new \\A\\T\\D\\E\\F();\n    new \\Z\\T\\G();\n    \\X\\T\\b\\c();\n    \\X\\T\\d\\e();\n    \\Z\\T\\f();\n    \\Y\\T\\B\\C;\n    \\Y\\T\\D\\E;\n    \\Z\\T\\K;\n}\nEOC;\n\n        $prettyPrinter = new PhpParser\\PrettyPrinter\\Standard();\n        $stmts = $this->parseAndResolve($code);\n\n        $this->assertSame(\n            $this->canonicalize($expectedCode),\n            $prettyPrinter->prettyPrint($stmts)\n        );\n    }\n\n    /**\n     * @covers \\PhpParser\\NodeVisitor\\NameResolver\n     */\n    public function testResolveLocations(): void {\n        $code = <<<'EOC'\n<?php\nnamespace NS;\n\n#[X]\nclass A extends B implements C, D {\n    use E, F, G {\n        f as private g;\n        E::h as i;\n        E::j insteadof F, G;\n    }\n\n    #[X]\n    public float $php = 7.4;\n    public ?Foo $person;\n    protected static ?bool $probability;\n    public A|B|int $prop;\n\n    #[X]\n    const C = 1;\n    \n    public const X A = X::Bar;\n    public const X\\Foo B = X\\Foo::Bar;\n    public const \\X\\Foo C = \\X\\Foo::Bar;\n\n    public Foo $foo {\n        #[X]\n        set(#[X] Bar $v) {}\n    }\n\n    public function __construct(\n        public Foo $bar {\n            #[X]\n            set(#[X] Bar $v) {}\n        }\n    ) {}\n}\n\n#[X]\ninterface A extends C, D {\n    public function a(A $a) : A;\n    public function b(A|B|int $a): A|B|int;\n    public function c(A&B $a): A&B;\n}\n\n#[X]\nenum E: int {\n    #[X]\n    case A = 1;\n}\n\n#[X]\ntrait A {}\n\n#[X]\nfunction f(#[X] A $a) : A {}\nfunction f2(array $a) : array {}\nfunction fn3(?A $a) : ?A {}\nfunction fn4(?array $a) : ?array {}\n\n#[X]\nfunction(A $a) : A {};\n\n#[X]\nfn(array $a): array => $a;\nfn(A $a): A => $a;\nfn(?A $a): ?A => $a;\n\n#[X]\nconst EXAMPLE = true;\n\nA::b();\nA::$b;\nA::B;\nnew A;\n$a instanceof A;\n\nnamespace\\a();\nnamespace\\A;\n\ntry {\n    $someThing;\n} catch (A $a) {\n    $someThingElse;\n}\nEOC;\n        $expectedCode = <<<'EOC'\nnamespace NS;\n\n#[\\NS\\X]\nclass A extends \\NS\\B implements \\NS\\C, \\NS\\D\n{\n    use \\NS\\E, \\NS\\F, \\NS\\G {\n        f as private g;\n        \\NS\\E::h as i;\n        \\NS\\E::j insteadof \\NS\\F, \\NS\\G;\n    }\n    #[\\NS\\X]\n    public float $php = 7.4;\n    public ?\\NS\\Foo $person;\n    protected static ?bool $probability;\n    public \\NS\\A|\\NS\\B|int $prop;\n    #[\\NS\\X]\n    const C = 1;\n    public const \\NS\\X A = \\NS\\X::Bar;\n    public const \\NS\\X\\Foo B = \\NS\\X\\Foo::Bar;\n    public const \\X\\Foo C = \\X\\Foo::Bar;\n    public \\NS\\Foo $foo {\n        #[\\NS\\X]\n        set(\n            #[\\NS\\X]\n            \\NS\\Bar $v\n        ) {\n        }\n    }\n    public function __construct(public \\NS\\Foo $bar {\n        #[\\NS\\X]\n        set(\n            #[\\NS\\X]\n            \\NS\\Bar $v\n        ) {\n        }\n    })\n    {\n    }\n}\n#[\\NS\\X]\ninterface A extends \\NS\\C, \\NS\\D\n{\n    public function a(\\NS\\A $a): \\NS\\A;\n    public function b(\\NS\\A|\\NS\\B|int $a): \\NS\\A|\\NS\\B|int;\n    public function c(\\NS\\A&\\NS\\B $a): \\NS\\A&\\NS\\B;\n}\n#[\\NS\\X]\nenum E : int\n{\n    #[\\NS\\X]\n    case A = 1;\n}\n#[\\NS\\X]\ntrait A\n{\n}\n#[\\NS\\X]\nfunction f(\n    #[\\NS\\X]\n    \\NS\\A $a\n): \\NS\\A\n{\n}\nfunction f2(array $a): array\n{\n}\nfunction fn3(?\\NS\\A $a): ?\\NS\\A\n{\n}\nfunction fn4(?array $a): ?array\n{\n}\n#[\\NS\\X] function (\\NS\\A $a): \\NS\\A {\n};\n#[\\NS\\X] fn(array $a): array => $a;\nfn(\\NS\\A $a): \\NS\\A => $a;\nfn(?\\NS\\A $a): ?\\NS\\A => $a;\n#[\\NS\\X]\nconst EXAMPLE = true;\n\\NS\\A::b();\n\\NS\\A::$b;\n\\NS\\A::B;\nnew \\NS\\A();\n$a instanceof \\NS\\A;\n\\NS\\a();\n\\NS\\A;\ntry {\n    $someThing;\n} catch (\\NS\\A $a) {\n    $someThingElse;\n}\nEOC;\n\n        $prettyPrinter = new PhpParser\\PrettyPrinter\\Standard();\n        $stmts = $this->parseAndResolve($code);\n\n        $this->assertSame(\n            $this->canonicalize($expectedCode),\n            $prettyPrinter->prettyPrint($stmts)\n        );\n    }\n\n    public function testNoResolveSpecialName(): void {\n        $stmts = [new Node\\Expr\\New_(new Name('self'))];\n\n        $traverser = new PhpParser\\NodeTraverser();\n        $traverser->addVisitor(new NameResolver());\n\n        $this->assertEquals($stmts, $traverser->traverse($stmts));\n    }\n\n    public function testAddDeclarationNamespacedName(): void {\n        $nsStmts = [\n            new Stmt\\Class_('A'),\n            new Stmt\\Interface_('B'),\n            new Stmt\\Function_('C'),\n            new Stmt\\Const_([\n                new Node\\Const_('D', new Node\\Scalar\\Int_(42))\n            ]),\n            new Stmt\\Trait_('E'),\n            new Expr\\New_(new Stmt\\Class_(null)),\n            new Stmt\\Enum_('F'),\n        ];\n\n        $traverser = new PhpParser\\NodeTraverser();\n        $traverser->addVisitor(new NameResolver());\n\n        $stmts = $traverser->traverse([new Stmt\\Namespace_(new Name('NS'), $nsStmts)]);\n        $this->assertSame('NS\\\\A', (string) $stmts[0]->stmts[0]->namespacedName);\n        $this->assertSame('NS\\\\B', (string) $stmts[0]->stmts[1]->namespacedName);\n        $this->assertSame('NS\\\\C', (string) $stmts[0]->stmts[2]->namespacedName);\n        $this->assertSame('NS\\\\D', (string) $stmts[0]->stmts[3]->consts[0]->namespacedName);\n        $this->assertSame('NS\\\\E', (string) $stmts[0]->stmts[4]->namespacedName);\n        $this->assertNull($stmts[0]->stmts[5]->class->namespacedName);\n        $this->assertSame('NS\\\\F', (string) $stmts[0]->stmts[6]->namespacedName);\n\n        $stmts = $traverser->traverse([new Stmt\\Namespace_(null, $nsStmts)]);\n        $this->assertSame('A', (string) $stmts[0]->stmts[0]->namespacedName);\n        $this->assertSame('B', (string) $stmts[0]->stmts[1]->namespacedName);\n        $this->assertSame('C', (string) $stmts[0]->stmts[2]->namespacedName);\n        $this->assertSame('D', (string) $stmts[0]->stmts[3]->consts[0]->namespacedName);\n        $this->assertSame('E', (string) $stmts[0]->stmts[4]->namespacedName);\n        $this->assertNull($stmts[0]->stmts[5]->class->namespacedName);\n        $this->assertSame('F', (string) $stmts[0]->stmts[6]->namespacedName);\n    }\n\n    public function testAddRuntimeResolvedNamespacedName(): void {\n        $stmts = [\n            new Stmt\\Namespace_(new Name('NS'), [\n                new Expr\\FuncCall(new Name('foo')),\n                new Expr\\ConstFetch(new Name('FOO')),\n            ]),\n            new Stmt\\Namespace_(null, [\n                new Expr\\FuncCall(new Name('foo')),\n                new Expr\\ConstFetch(new Name('FOO')),\n            ]),\n        ];\n\n        $traverser = new PhpParser\\NodeTraverser();\n        $traverser->addVisitor(new NameResolver());\n        $stmts = $traverser->traverse($stmts);\n\n        $this->assertSame('NS\\\\foo', (string) $stmts[0]->stmts[0]->name->getAttribute('namespacedName'));\n        $this->assertSame('NS\\\\FOO', (string) $stmts[0]->stmts[1]->name->getAttribute('namespacedName'));\n\n        $this->assertFalse($stmts[1]->stmts[0]->name->hasAttribute('namespacedName'));\n        $this->assertFalse($stmts[1]->stmts[1]->name->hasAttribute('namespacedName'));\n    }\n\n    /**\n     * @dataProvider provideTestError\n     */\n    public function testError(Node $stmt, $errorMsg): void {\n        $this->expectException(\\PhpParser\\Error::class);\n        $this->expectExceptionMessage($errorMsg);\n\n        $traverser = new PhpParser\\NodeTraverser();\n        $traverser->addVisitor(new NameResolver());\n        $traverser->traverse([$stmt]);\n    }\n\n    public static function provideTestError() {\n        return [\n            [\n                new Stmt\\Use_([\n                    new Node\\UseItem(new Name('A\\B'), 'B', 0, ['startLine' => 1]),\n                    new Node\\UseItem(new Name('C\\D'), 'B', 0, ['startLine' => 2]),\n                ], Stmt\\Use_::TYPE_NORMAL),\n                'Cannot use C\\D as B because the name is already in use on line 2'\n            ],\n            [\n                new Stmt\\Use_([\n                    new Node\\UseItem(new Name('a\\b'), 'b', 0, ['startLine' => 1]),\n                    new Node\\UseItem(new Name('c\\d'), 'B', 0, ['startLine' => 2]),\n                ], Stmt\\Use_::TYPE_FUNCTION),\n                'Cannot use function c\\d as B because the name is already in use on line 2'\n            ],\n            [\n                new Stmt\\Use_([\n                    new Node\\UseItem(new Name('A\\B'), 'B', 0, ['startLine' => 1]),\n                    new Node\\UseItem(new Name('C\\D'), 'B', 0, ['startLine' => 2]),\n                ], Stmt\\Use_::TYPE_CONSTANT),\n                'Cannot use const C\\D as B because the name is already in use on line 2'\n            ],\n            [\n                new Expr\\New_(new Name\\FullyQualified('self', ['startLine' => 3])),\n                \"'\\\\self' is an invalid class name on line 3\"\n            ],\n            [\n                new Expr\\New_(new Name\\Relative('self', ['startLine' => 3])),\n                \"'\\\\self' is an invalid class name on line 3\"\n            ],\n            [\n                new Expr\\New_(new Name\\FullyQualified('PARENT', ['startLine' => 3])),\n                \"'\\\\PARENT' is an invalid class name on line 3\"\n            ],\n            [\n                new Expr\\New_(new Name\\Relative('STATIC', ['startLine' => 3])),\n                \"'\\\\STATIC' is an invalid class name on line 3\"\n            ],\n        ];\n    }\n\n    public function testClassNameIsCaseInsensitive(): void {\n        $source = <<<'EOC'\n<?php\nnamespace Foo;\nuse Bar\\Baz;\n$test = new baz();\nEOC;\n\n        $parser = new PhpParser\\Parser\\Php7(new PhpParser\\Lexer\\Emulative());\n        $stmts = $parser->parse($source);\n\n        $traverser = new PhpParser\\NodeTraverser();\n        $traverser->addVisitor(new NameResolver());\n\n        $stmts = $traverser->traverse($stmts);\n        $stmt = $stmts[0];\n\n        $assign = $stmt->stmts[1]->expr;\n        $this->assertSame('Bar\\\\Baz', $assign->expr->class->name);\n    }\n\n    public function testSpecialClassNamesAreCaseInsensitive(): void {\n        $source = <<<'EOC'\n<?php\nnamespace Foo;\n\nclass Bar\n{\n    public static function method()\n    {\n        SELF::method();\n        PARENT::method();\n        STATIC::method();\n    }\n}\nEOC;\n\n        $parser = new PhpParser\\Parser\\Php7(new PhpParser\\Lexer\\Emulative());\n        $stmts = $parser->parse($source);\n\n        $traverser = new PhpParser\\NodeTraverser();\n        $traverser->addVisitor(new NameResolver());\n\n        $stmts = $traverser->traverse($stmts);\n        $classStmt = $stmts[0];\n        $methodStmt = $classStmt->stmts[0]->stmts[0];\n\n        $this->assertSame('SELF', (string) $methodStmt->stmts[0]->expr->class);\n        $this->assertSame('PARENT', (string) $methodStmt->stmts[1]->expr->class);\n        $this->assertSame('STATIC', (string) $methodStmt->stmts[2]->expr->class);\n    }\n\n    public function testAddOriginalNames(): void {\n        $traverser = new PhpParser\\NodeTraverser();\n        $traverser->addVisitor(new NameResolver(null, ['preserveOriginalNames' => true]));\n\n        $n1 = new Name('Bar');\n        $n2 = new Name('bar');\n        $origStmts = [\n            new Stmt\\Namespace_(new Name('Foo'), [\n                new Expr\\ClassConstFetch($n1, 'FOO'),\n                new Expr\\FuncCall($n2),\n            ])\n        ];\n\n        $stmts = $traverser->traverse($origStmts);\n\n        $this->assertSame($n1, $stmts[0]->stmts[0]->class->getAttribute('originalName'));\n        $this->assertSame($n2, $stmts[0]->stmts[1]->name->getAttribute('originalName'));\n    }\n\n    public function testAttributeOnlyMode(): void {\n        $traverser = new PhpParser\\NodeTraverser();\n        $traverser->addVisitor(new NameResolver(null, ['replaceNodes' => false]));\n\n        $n1 = new Name('Bar');\n        $n2 = new Name('bar');\n        $origStmts = [\n            new Stmt\\Namespace_(new Name('Foo'), [\n                new Expr\\ClassConstFetch($n1, 'FOO'),\n                new Expr\\FuncCall($n2),\n            ])\n        ];\n\n        $traverser->traverse($origStmts);\n\n        $this->assertEquals(\n            new Name\\FullyQualified('Foo\\Bar'), $n1->getAttribute('resolvedName'));\n        $this->assertFalse($n2->hasAttribute('resolvedName'));\n        $this->assertEquals(\n            new Name\\FullyQualified('Foo\\bar'), $n2->getAttribute('namespacedName'));\n    }\n\n    private function parseAndResolve(string $code): array {\n        $parser = new PhpParser\\Parser\\Php8(new PhpParser\\Lexer\\Emulative());\n        $traverser = new PhpParser\\NodeTraverser();\n        $traverser->addVisitor(new NameResolver());\n\n        $stmts = $parser->parse($code);\n        return $traverser->traverse($stmts);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NodeVisitor/NodeConnectingVisitorTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\Node\\Expr\\ConstFetch;\nuse PhpParser\\Node\\Stmt\\Else_;\nuse PhpParser\\Node\\Stmt\\If_;\nuse PhpParser\\NodeFinder;\nuse PhpParser\\NodeTraverser;\nuse PhpParser\\ParserFactory;\n\nfinal class NodeConnectingVisitorTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testConnectsNodeToItsParentNodeAndItsSiblingNodes(): void {\n        $ast = (new ParserFactory())->createForNewestSupportedVersion()->parse(\n            '<?php if (true) {} else {}'\n        );\n\n        $traverser = new NodeTraverser();\n\n        $traverser->addVisitor(new NodeConnectingVisitor());\n\n        $ast = $traverser->traverse($ast);\n\n        $node = (new NodeFinder())->findFirstInstanceof($ast, Else_::class);\n\n        $this->assertSame(If_::class, get_class($node->getAttribute('parent')));\n        $this->assertSame(ConstFetch::class, get_class($node->getAttribute('previous')));\n\n        $node = (new NodeFinder())->findFirstInstanceof($ast, ConstFetch::class);\n\n        $this->assertSame(Else_::class, get_class($node->getAttribute('next')));\n    }\n\n    public function testWeakReferences(): void {\n        $ast = (new ParserFactory())->createForNewestSupportedVersion()->parse(\n            '<?php if (true) {} else {}'\n        );\n\n        $traverser = new NodeTraverser();\n\n        $traverser->addVisitor(new NodeConnectingVisitor(true));\n\n        $ast = $traverser->traverse($ast);\n\n        $node = (new NodeFinder())->findFirstInstanceof($ast, Else_::class);\n\n        $this->assertInstanceOf(\\WeakReference::class, $node->getAttribute('weak_parent'));\n        $this->assertSame(If_::class, get_class($node->getAttribute('weak_parent')->get()));\n        $this->assertInstanceOf(\\WeakReference::class, $node->getAttribute('weak_previous'));\n        $this->assertSame(ConstFetch::class, get_class($node->getAttribute('weak_previous')->get()));\n\n        $node = (new NodeFinder())->findFirstInstanceof($ast, ConstFetch::class);\n\n        $this->assertInstanceOf(\\WeakReference::class, $node->getAttribute('weak_next'));\n        $this->assertSame(Else_::class, get_class($node->getAttribute('weak_next')->get()));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NodeVisitor/ParentConnectingVisitorTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\NodeVisitor;\n\nuse PhpParser\\Node\\Stmt\\ClassMethod;\nuse PhpParser\\NodeFinder;\nuse PhpParser\\NodeTraverser;\nuse PhpParser\\ParserFactory;\n\nfinal class ParentConnectingVisitorTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testConnectsChildNodeToParentNode(): void {\n        $ast = (new ParserFactory())->createForNewestSupportedVersion()->parse(\n            '<?php class C { public function m() {} }'\n        );\n\n        $traverser = new NodeTraverser();\n\n        $traverser->addVisitor(new ParentConnectingVisitor());\n\n        $ast = $traverser->traverse($ast);\n\n        $node = (new NodeFinder())->findFirstInstanceof($ast, ClassMethod::class);\n\n        $this->assertSame('C', $node->getAttribute('parent')->name->toString());\n    }\n\n    public function testWeakReferences(): void {\n        $ast = (new ParserFactory())->createForNewestSupportedVersion()->parse(\n            '<?php class C { public function m() {} }'\n        );\n\n        $traverser = new NodeTraverser();\n\n        $traverser->addVisitor(new ParentConnectingVisitor(true));\n\n        $ast = $traverser->traverse($ast);\n\n        $node = (new NodeFinder())->findFirstInstanceof($ast, ClassMethod::class);\n\n        $weakReference = $node->getAttribute('weak_parent');\n        $this->assertInstanceOf(\\WeakReference::class, $weakReference);\n        $this->assertSame('C', $weakReference->get()->name->toString());\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/NodeVisitorForTesting.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass NodeVisitorForTesting implements NodeVisitor {\n    public $trace = [];\n    private $returns;\n    private $returnsPos;\n\n    public function __construct(array $returns = []) {\n        $this->returns = $returns;\n        $this->returnsPos = 0;\n    }\n\n    public function beforeTraverse(array $nodes): ?array {\n        return $this->traceEvent('beforeTraverse', $nodes);\n    }\n\n    public function enterNode(Node $node) {\n        return $this->traceEvent('enterNode', $node);\n    }\n\n    public function leaveNode(Node $node) {\n        return $this->traceEvent('leaveNode', $node);\n    }\n\n    public function afterTraverse(array $nodes): ?array {\n        return $this->traceEvent('afterTraverse', $nodes);\n    }\n\n    private function traceEvent(string $method, $param) {\n        $this->trace[] = [$method, $param];\n        if ($this->returnsPos < count($this->returns)) {\n            $currentReturn = $this->returns[$this->returnsPos];\n            if ($currentReturn[0] === $method && $currentReturn[1] === $param) {\n                $this->returnsPos++;\n                return $currentReturn[2];\n            }\n        }\n        return null;\n    }\n\n    public function __destruct() {\n        if ($this->returnsPos !== count($this->returns)) {\n            throw new \\Exception(\"Expected event did not occur\");\n        }\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Parser/Php7Test.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Parser;\n\nuse PhpParser\\Lexer;\nuse PhpParser\\ParserTestAbstract;\n\nclass Php7Test extends ParserTestAbstract\n{\n    protected function getParser(Lexer $lexer) {\n        return new Php7($lexer);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/Parser/Php8Test.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser\\Parser;\n\nuse PhpParser\\Lexer;\nuse PhpParser\\ParserTestAbstract;\n\nclass Php8Test extends ParserTestAbstract\n{\n    protected function getParser(Lexer $lexer) {\n        return new Php8($lexer);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/ParserFactoryTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\n/* This test is very weak, because PHPUnit's assertEquals assertion is way too slow dealing with the\n * large objects involved here. So we just do some basic instanceof tests instead. */\n\nuse PhpParser\\Parser\\Php7;\nuse PhpParser\\Parser\\Php8;\n\nclass ParserFactoryTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testCreate(): void {\n        $factory = new ParserFactory();\n        $this->assertInstanceOf(Php8::class, $factory->createForNewestSupportedVersion());\n        $this->assertInstanceOf(Parser::class, $factory->createForHostVersion());\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/ParserTestAbstract.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Scalar\\String_;\nuse PhpParser\\Node\\Stmt;\n\nabstract class ParserTestAbstract extends \\PHPUnit\\Framework\\TestCase {\n    /** @returns Parser */\n    abstract protected function getParser(Lexer $lexer);\n\n    public function testParserThrowsSyntaxError(): void {\n        $this->expectException(Error::class);\n        $this->expectExceptionMessage('Syntax error, unexpected EOF on line 1');\n        $parser = $this->getParser(new Lexer());\n        $parser->parse('<?php foo');\n    }\n\n    public function testParserThrowsSpecialError(): void {\n        $this->expectException(Error::class);\n        $this->expectExceptionMessage('Cannot use foo as self because \\'self\\' is a special class name on line 1');\n        $parser = $this->getParser(new Lexer());\n        $parser->parse('<?php use foo as self;');\n    }\n\n    public function testParserThrowsLexerError(): void {\n        $this->expectException(Error::class);\n        $this->expectExceptionMessage('Unterminated comment on line 1');\n        $parser = $this->getParser(new Lexer());\n        $parser->parse('<?php /*');\n    }\n\n    public function testAttributeAssignment(): void {\n        $lexer = new Lexer();\n\n        $code = <<<'EOC'\n<?php\n/** Doc comment */\nfunction test($a) {\n    // Line\n    // Comments\n    echo $a;\n}\nEOC;\n        $code = canonicalize($code);\n\n        $parser = $this->getParser($lexer);\n        $stmts = $parser->parse($code);\n\n        /** @var Stmt\\Function_ $fn */\n        $fn = $stmts[0];\n        $this->assertInstanceOf(Stmt\\Function_::class, $fn);\n        $this->assertEquals([\n            'comments' => [\n                new Comment\\Doc('/** Doc comment */',\n                    2, 6, 1, 2, 23, 1),\n            ],\n            'startLine' => 3,\n            'endLine' => 7,\n            'startTokenPos' => 3,\n            'endTokenPos' => 21,\n            'startFilePos' => 25,\n            'endFilePos' => 86,\n        ], $fn->getAttributes());\n\n        $param = $fn->params[0];\n        $this->assertInstanceOf(Node\\Param::class, $param);\n        $this->assertEquals([\n            'startLine' => 3,\n            'endLine' => 3,\n            'startTokenPos' => 7,\n            'endTokenPos' => 7,\n            'startFilePos' => 39,\n            'endFilePos' => 40,\n        ], $param->getAttributes());\n\n        /** @var Stmt\\Echo_ $echo */\n        $echo = $fn->stmts[0];\n        $this->assertInstanceOf(Stmt\\Echo_::class, $echo);\n        $this->assertEquals([\n            'comments' => [\n                new Comment(\"// Line\",\n                    4, 49, 12, 4, 55, 12),\n                new Comment(\"// Comments\",\n                    5, 61, 14, 5, 71, 14),\n            ],\n            'startLine' => 6,\n            'endLine' => 6,\n            'startTokenPos' => 16,\n            'endTokenPos' => 19,\n            'startFilePos' => 77,\n            'endFilePos' => 84,\n        ], $echo->getAttributes());\n\n        /** @var \\PhpParser\\Node\\Expr\\Variable $var */\n        $var = $echo->exprs[0];\n        $this->assertInstanceOf(Expr\\Variable::class, $var);\n        $this->assertEquals([\n            'startLine' => 6,\n            'endLine' => 6,\n            'startTokenPos' => 18,\n            'endTokenPos' => 18,\n            'startFilePos' => 82,\n            'endFilePos' => 83,\n        ], $var->getAttributes());\n    }\n\n    public function testInvalidToken(): void {\n        $this->expectException(\\RangeException::class);\n        $this->expectExceptionMessage('The lexer returned an invalid token (id=999, value=foobar)');\n        $lexer = new InvalidTokenLexer();\n        $parser = $this->getParser($lexer);\n        $parser->parse('dummy');\n    }\n\n    /**\n     * @dataProvider provideTestExtraAttributes\n     */\n    public function testExtraAttributes($code, $expectedAttributes): void {\n        $parser = $this->getParser(new Lexer\\Emulative());\n        $stmts = $parser->parse(\"<?php $code;\");\n        $node = $stmts[0] instanceof Stmt\\Expression ? $stmts[0]->expr : $stmts[0];\n        $attributes = $node->getAttributes();\n        foreach ($expectedAttributes as $name => $value) {\n            $this->assertSame($value, $attributes[$name]);\n        }\n    }\n\n    public static function provideTestExtraAttributes() {\n        return [\n            ['0', ['kind' => Scalar\\Int_::KIND_DEC]],\n            ['9', ['kind' => Scalar\\Int_::KIND_DEC]],\n            ['07', ['kind' => Scalar\\Int_::KIND_OCT]],\n            ['0xf', ['kind' => Scalar\\Int_::KIND_HEX]],\n            ['0XF', ['kind' => Scalar\\Int_::KIND_HEX]],\n            ['0b1', ['kind' => Scalar\\Int_::KIND_BIN]],\n            ['0B1', ['kind' => Scalar\\Int_::KIND_BIN]],\n            ['0o7', ['kind' => Scalar\\Int_::KIND_OCT]],\n            ['0O7', ['kind' => Scalar\\Int_::KIND_OCT]],\n            ['[]', ['kind' => Expr\\Array_::KIND_SHORT]],\n            ['array()', ['kind' => Expr\\Array_::KIND_LONG]],\n            [\"'foo'\", ['kind' => String_::KIND_SINGLE_QUOTED]],\n            [\"b'foo'\", ['kind' => String_::KIND_SINGLE_QUOTED]],\n            [\"B'foo'\", ['kind' => String_::KIND_SINGLE_QUOTED]],\n            ['\"foo\"', ['kind' => String_::KIND_DOUBLE_QUOTED]],\n            ['b\"foo\"', ['kind' => String_::KIND_DOUBLE_QUOTED]],\n            ['B\"foo\"', ['kind' => String_::KIND_DOUBLE_QUOTED]],\n            ['\"foo$bar\"', ['kind' => String_::KIND_DOUBLE_QUOTED]],\n            ['b\"foo$bar\"', ['kind' => String_::KIND_DOUBLE_QUOTED]],\n            ['B\"foo$bar\"', ['kind' => String_::KIND_DOUBLE_QUOTED]],\n            [\"<<<'STR'\\nSTR\\n\", ['kind' => String_::KIND_NOWDOC, 'docLabel' => 'STR', 'docIndentation' => '']],\n            [\"<<<STR\\nSTR\\n\", ['kind' => String_::KIND_HEREDOC, 'docLabel' => 'STR', 'docIndentation' => '']],\n            [\"<<<\\\"STR\\\"\\nSTR\\n\", ['kind' => String_::KIND_HEREDOC, 'docLabel' => 'STR', 'docIndentation' => '']],\n            [\"b<<<'STR'\\nSTR\\n\", ['kind' => String_::KIND_NOWDOC, 'docLabel' => 'STR', 'docIndentation' => '']],\n            [\"B<<<'STR'\\nSTR\\n\", ['kind' => String_::KIND_NOWDOC, 'docLabel' => 'STR', 'docIndentation' => '']],\n            [\"<<< \\t 'STR'\\nSTR\\n\", ['kind' => String_::KIND_NOWDOC, 'docLabel' => 'STR', 'docIndentation' => '']],\n            [\"<<<'\\xff'\\n\\xff\\n\", ['kind' => String_::KIND_NOWDOC, 'docLabel' => \"\\xff\", 'docIndentation' => '']],\n            [\"<<<\\\"STR\\\"\\n\\$a\\nSTR\\n\", ['kind' => String_::KIND_HEREDOC, 'docLabel' => 'STR', 'docIndentation' => '']],\n            [\"b<<<\\\"STR\\\"\\n\\$a\\nSTR\\n\", ['kind' => String_::KIND_HEREDOC, 'docLabel' => 'STR', 'docIndentation' => '']],\n            [\"B<<<\\\"STR\\\"\\n\\$a\\nSTR\\n\", ['kind' => String_::KIND_HEREDOC, 'docLabel' => 'STR', 'docIndentation' => '']],\n            [\"<<< \\t \\\"STR\\\"\\n\\$a\\nSTR\\n\", ['kind' => String_::KIND_HEREDOC, 'docLabel' => 'STR', 'docIndentation' => '']],\n            [\"<<<STR\\n    STR\\n\", ['kind' => String_::KIND_HEREDOC, 'docLabel' => 'STR', 'docIndentation' => '    ']],\n            [\"<<<STR\\n\\tSTR\\n\", ['kind' => String_::KIND_HEREDOC, 'docLabel' => 'STR', 'docIndentation' => \"\\t\"]],\n            [\"<<<'STR'\\n    Foo\\n  STR\\n\", ['kind' => String_::KIND_NOWDOC, 'docLabel' => 'STR', 'docIndentation' => '  ']],\n            [\"die\", ['kind' => Expr\\Exit_::KIND_DIE]],\n            [\"die('done')\", ['kind' => Expr\\Exit_::KIND_DIE]],\n            [\"exit\", ['kind' => Expr\\Exit_::KIND_EXIT]],\n            [\"exit(1)\", ['kind' => Expr\\Exit_::KIND_EXIT]],\n            [\"?>Foo\", ['hasLeadingNewline' => false]],\n            [\"?>\\nFoo\", ['hasLeadingNewline' => true]],\n            [\"namespace Foo;\", ['kind' => Stmt\\Namespace_::KIND_SEMICOLON]],\n            [\"namespace Foo {}\", ['kind' => Stmt\\Namespace_::KIND_BRACED]],\n            [\"namespace {}\", ['kind' => Stmt\\Namespace_::KIND_BRACED]],\n            [\"(float) 5.0\", ['kind' => Expr\\Cast\\Double::KIND_FLOAT]],\n            [\"(double) 5.0\", ['kind' => Expr\\Cast\\Double::KIND_DOUBLE]],\n            [\"(real) 5.0\", ['kind' => Expr\\Cast\\Double::KIND_REAL]],\n            [\" (  REAL )  5.0\", ['kind' => Expr\\Cast\\Double::KIND_REAL]],\n        ];\n    }\n\n    public function testListKindAttribute(): void {\n        $parser = $this->getParser(new Lexer\\Emulative());\n        $stmts = $parser->parse('<?php list(list($x)) = $y; [[$x]] = $y;');\n        $this->assertSame($stmts[0]->expr->var->getAttribute('kind'), Expr\\List_::KIND_LIST);\n        $this->assertSame($stmts[0]->expr->var->items[0]->value->getAttribute('kind'), Expr\\List_::KIND_LIST);\n        $this->assertSame($stmts[1]->expr->var->getAttribute('kind'), Expr\\List_::KIND_ARRAY);\n        $this->assertSame($stmts[1]->expr->var->items[0]->value->getAttribute('kind'), Expr\\List_::KIND_ARRAY);\n    }\n\n    public function testGetTokens(): void {\n        $lexer = new Lexer();\n        $parser = $this->getParser($lexer);\n        $parser->parse('<?php echo \"Foo\";');\n        $this->assertEquals([\n            new Token(\\T_OPEN_TAG, '<?php ', 1, 0),\n            new Token(\\T_ECHO, 'echo', 1, 6),\n            new Token(\\T_WHITESPACE, ' ', 1, 10),\n            new Token(\\T_CONSTANT_ENCAPSED_STRING, '\"Foo\"', 1, 11),\n            new Token(ord(';'), ';', 1, 16),\n            new Token(0, \"\\0\", 1, 17),\n        ], $parser->getTokens());\n    }\n}\n\nclass InvalidTokenLexer extends Lexer {\n    public function tokenize(string $code, ?ErrorHandler $errorHandler = null): array {\n        return [\n            new Token(999, 'foobar', 42),\n        ];\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/PhpVersionTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass PhpVersionTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testConstruction(): void {\n        $version = PhpVersion::fromComponents(8, 2);\n        $this->assertSame(80200, $version->id);\n\n        $version = PhpVersion::fromString('8.2');\n        $this->assertSame(80200, $version->id);\n\n        $version = PhpVersion::fromString('8.2.14');\n        $this->assertSame(80200, $version->id);\n\n        $version = PhpVersion::fromString('8.2.14rc1');\n        $this->assertSame(80200, $version->id);\n    }\n\n    public function testInvalidVersion(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Invalid PHP version \"8\"');\n        PhpVersion::fromString('8');\n    }\n\n    public function testEquals(): void {\n        $php74 = PhpVersion::fromComponents(7, 4);\n        $php81 = PhpVersion::fromComponents(8, 1);\n        $php82 = PhpVersion::fromComponents(8, 2);\n        $this->assertTrue($php81->equals($php81));\n        $this->assertFalse($php81->equals($php82));\n\n        $this->assertTrue($php81->older($php82));\n        $this->assertFalse($php81->older($php81));\n        $this->assertFalse($php81->older($php74));\n\n        $this->assertFalse($php81->newerOrEqual($php82));\n        $this->assertTrue($php81->newerOrEqual($php81));\n        $this->assertTrue($php81->newerOrEqual($php74));\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/PrettyPrinterTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Name;\nuse PhpParser\\Node\\Scalar\\Float_;\nuse PhpParser\\Node\\Scalar\\InterpolatedString;\nuse PhpParser\\Node\\InterpolatedStringPart;\nuse PhpParser\\Node\\Scalar\\Int_;\nuse PhpParser\\Node\\Scalar\\String_;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\PrettyPrinter\\Standard;\n\nclass PrettyPrinterTest extends CodeTestAbstract {\n    /** @return array{0: Parser, 1: PrettyPrinter} */\n    private function createParserAndPrinter(array $options): array {\n        $parserVersion = $options['parserVersion'] ?? $options['version'] ?? null;\n        $printerVersion = $options['version'] ?? null;\n        $indent = isset($options['indent']) ? json_decode($options['indent']) : null;\n        $factory = new ParserFactory();\n        $parser = $factory->createForVersion($parserVersion !== null\n            ? PhpVersion::fromString($parserVersion) : PhpVersion::getNewestSupported());\n        $prettyPrinter = new Standard([\n            'phpVersion' => $printerVersion !== null ? PhpVersion::fromString($printerVersion) : null,\n            'indent' => $indent,\n        ]);\n        return [$parser, $prettyPrinter];\n    }\n\n    protected function doTestPrettyPrintMethod($method, $name, $code, $expected, $modeLine) {\n        [$parser, $prettyPrinter] = $this->createParserAndPrinter($this->parseModeLine($modeLine));\n        $output = canonicalize($prettyPrinter->$method($parser->parse($code)));\n        $this->assertSame($expected, $output, $name);\n    }\n\n    /**\n     * @dataProvider provideTestPrettyPrint\n     */\n    public function testPrettyPrint($name, $code, $expected, $mode): void {\n        $this->doTestPrettyPrintMethod('prettyPrint', $name, $code, $expected, $mode);\n    }\n\n    /**\n     * @dataProvider provideTestPrettyPrintFile\n     */\n    public function testPrettyPrintFile($name, $code, $expected, $mode): void {\n        $this->doTestPrettyPrintMethod('prettyPrintFile', $name, $code, $expected, $mode);\n    }\n\n    public static function provideTestPrettyPrint() {\n        return self::getTests(__DIR__ . '/../code/prettyPrinter', 'test');\n    }\n\n    public static function provideTestPrettyPrintFile() {\n        return self::getTests(__DIR__ . '/../code/prettyPrinter', 'file-test');\n    }\n\n    public function testPrettyPrintExpr(): void {\n        $prettyPrinter = new Standard();\n        $expr = new Expr\\BinaryOp\\Mul(\n            new Expr\\BinaryOp\\Plus(new Expr\\Variable('a'), new Expr\\Variable('b')),\n            new Expr\\Variable('c')\n        );\n        $this->assertEquals('($a + $b) * $c', $prettyPrinter->prettyPrintExpr($expr));\n\n        $expr = new Expr\\Closure([\n            'stmts' => [new Stmt\\Return_(new String_(\"a\\nb\"))]\n        ]);\n        $this->assertEquals(\"function () {\\n    return 'a\\nb';\\n}\", $prettyPrinter->prettyPrintExpr($expr));\n    }\n\n    public function testCommentBeforeInlineHTML(): void {\n        $prettyPrinter = new PrettyPrinter\\Standard();\n        $comment = new Comment\\Doc(\"/**\\n * This is a comment\\n */\");\n        $stmts = [new Stmt\\InlineHTML('Hello World!', ['comments' => [$comment]])];\n        $expected = \"<?php\\n\\n/**\\n * This is a comment\\n */\\n?>\\nHello World!\";\n        $this->assertSame($expected, $prettyPrinter->prettyPrintFile($stmts));\n    }\n\n    public function testArraySyntaxDefault(): void {\n        $prettyPrinter = new Standard(['shortArraySyntax' => true]);\n        $expr = new Expr\\Array_([\n            new Node\\ArrayItem(new String_('val'), new String_('key'))\n        ]);\n        $expected = \"['key' => 'val']\";\n        $this->assertSame($expected, $prettyPrinter->prettyPrintExpr($expr));\n    }\n\n    /**\n     * @dataProvider provideTestKindAttributes\n     */\n    public function testKindAttributes($node, $expected): void {\n        $prttyPrinter = new PrettyPrinter\\Standard();\n        $result = $prttyPrinter->prettyPrintExpr($node);\n        $this->assertSame($expected, $result);\n    }\n\n    public static function provideTestKindAttributes() {\n        $nowdoc = ['kind' => String_::KIND_NOWDOC, 'docLabel' => 'STR'];\n        $heredoc = ['kind' => String_::KIND_HEREDOC, 'docLabel' => 'STR'];\n        return [\n            // Defaults to single quoted\n            [new String_('foo'), \"'foo'\"],\n            // Explicit single/double quoted\n            [new String_('foo', ['kind' => String_::KIND_SINGLE_QUOTED]), \"'foo'\"],\n            [new String_('foo', ['kind' => String_::KIND_DOUBLE_QUOTED]), '\"foo\"'],\n            // Fallback from doc string if no label\n            [new String_('foo', ['kind' => String_::KIND_NOWDOC]), \"'foo'\"],\n            [new String_('foo', ['kind' => String_::KIND_HEREDOC]), '\"foo\"'],\n            // Fallback if string contains label\n            [new String_(\"A\\nB\\nC\", ['kind' => String_::KIND_NOWDOC, 'docLabel' => 'A']), \"'A\\nB\\nC'\"],\n            [new String_(\"A\\nB\\nC\", ['kind' => String_::KIND_NOWDOC, 'docLabel' => 'B']), \"'A\\nB\\nC'\"],\n            [new String_(\"A\\nB\\nC\", ['kind' => String_::KIND_NOWDOC, 'docLabel' => 'C']), \"'A\\nB\\nC'\"],\n            [new String_(\"STR;\", $nowdoc), \"'STR;'\"],\n            [new String_(\"STR,\", $nowdoc), \"'STR,'\"],\n            [new String_(\" STR\", $nowdoc), \"' STR'\"],\n            [new String_(\"\\tSTR\", $nowdoc), \"'\\tSTR'\"],\n            [new String_(\"STR\\x80\", $heredoc), '\"STR\\x80\"'],\n            // Doc string if label not contained (or not in ending position)\n            [new String_(\"foo\", $nowdoc), \"<<<'STR'\\nfoo\\nSTR\"],\n            [new String_(\"foo\", $heredoc), \"<<<STR\\nfoo\\nSTR\"],\n            [new String_(\"STRx\", $nowdoc), \"<<<'STR'\\nSTRx\\nSTR\"],\n            [new String_(\"xSTR\", $nowdoc), \"<<<'STR'\\nxSTR\\nSTR\"],\n            [new String_(\"STRä\", $nowdoc), \"<<<'STR'\\nSTRä\\nSTR\"],\n            [new String_(\"STR\\x80\", $nowdoc), \"<<<'STR'\\nSTR\\x80\\nSTR\"],\n            // Empty doc string variations (encapsed variant does not occur naturally)\n            [new String_(\"\", $nowdoc), \"<<<'STR'\\nSTR\"],\n            [new String_(\"\", $heredoc), \"<<<STR\\nSTR\"],\n            [new InterpolatedString([new InterpolatedStringPart('')], $heredoc), \"<<<STR\\nSTR\"],\n            // Isolated \\r in doc string\n            [new String_(\"\\r\", $heredoc), \"<<<STR\\n\\\\r\\nSTR\"],\n            [new String_(\"\\r\", $nowdoc), \"'\\r'\"],\n            [new String_(\"\\rx\", $nowdoc), \"<<<'STR'\\n\\rx\\nSTR\"],\n            // Encapsed doc string variations\n            [new InterpolatedString([new InterpolatedStringPart('foo')], $heredoc), \"<<<STR\\nfoo\\nSTR\"],\n            [new InterpolatedString([new InterpolatedStringPart('foo'), new Expr\\Variable('y')], $heredoc), \"<<<STR\\nfoo{\\$y}\\nSTR\"],\n            [new InterpolatedString([new Expr\\Variable('y'), new InterpolatedStringPart(\"STR\\n\")], $heredoc), \"<<<STR\\n{\\$y}STR\\n\\nSTR\"],\n            // Encapsed doc string fallback\n            [new InterpolatedString([new Expr\\Variable('y'), new InterpolatedStringPart(\"\\nSTR\")], $heredoc), '\"{$y}\\\\nSTR\"'],\n            [new InterpolatedString([new InterpolatedStringPart(\"STR\\n\"), new Expr\\Variable('y')], $heredoc), '\"STR\\\\n{$y}\"'],\n            [new InterpolatedString([new InterpolatedStringPart(\"STR\")], $heredoc), '\"STR\"'],\n            [new InterpolatedString([new InterpolatedStringPart(\"\\nSTR\"), new Expr\\Variable('y')], $heredoc), '\"\\nSTR{$y}\"'],\n            [new InterpolatedString([new InterpolatedStringPart(\"STR\\x80\"), new Expr\\Variable('y')], $heredoc), '\"STR\\x80{$y}\"'],\n        ];\n    }\n\n    /** @dataProvider provideTestUnnaturalLiterals */\n    public function testUnnaturalLiterals($node, $expected): void {\n        $prttyPrinter = new PrettyPrinter\\Standard();\n        $result = $prttyPrinter->prettyPrintExpr($node);\n        $this->assertSame($expected, $result);\n    }\n\n    public static function provideTestUnnaturalLiterals() {\n        return [\n            [new Int_(-1), '-1'],\n            [new Int_(-PHP_INT_MAX - 1), '(-' . PHP_INT_MAX . '-1)'],\n            [new Int_(-1, ['kind' => Int_::KIND_BIN]), '-0b1'],\n            [new Int_(-1, ['kind' => Int_::KIND_OCT]), '-01'],\n            [new Int_(-1, ['kind' => Int_::KIND_HEX]), '-0x1'],\n            [new Float_(\\INF), '1.0E+1000'],\n            [new Float_(-\\INF), '-1.0E+1000'],\n            [new Float_(-\\NAN), '\\NAN'],\n        ];\n    }\n\n    /** @dataProvider provideTestCustomRawValue */\n    public function printCustomRawValue($node, $expected): void {\n        $prettyPrinter = new PrettyPrinter\\Standard();\n        $result = $prettyPrinter->prettyPrintExpr($node);\n        $this->assertSame($expected, $result);\n    }\n\n    public static function provideTestCustomRawValue() {\n        return [\n            // Decimal with separator\n            [new Int_(1000, ['rawValue' => '10_00', 'shouldPrintRawValue' => true]), '10_00'],\n            // Hexadecimal with separator\n            [new Int_(0xDEADBEEF, ['kind' => Int_::KIND_HEX, 'rawValue' => '0xDEAD_BEEF', 'shouldPrintRawValue' => true]), '0xDEAD_BEEF'],\n            // Binary with separator\n            [new Int_(0b11110000, ['kind' => Int_::KIND_BIN, 'rawValue' => '0b1111_0000', 'shouldPrintRawValue' => true]), '0b1111_0000'],\n            // Octal with separator\n            [new Int_(0755, ['kind' => Int_::KIND_OCT, 'rawValue' => '0755_000', 'shouldPrintRawValue' => true]), '0755_000'],\n            // Without flag set, should use default formatting\n            [new Int_(1000, ['rawValue' => '10_00', 'shouldPrintRawValue' => false]), '1000'],\n        ];\n    }\n\n    public function testPrettyPrintWithError(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Cannot pretty-print AST with Error nodes');\n        $stmts = [new Stmt\\Expression(\n            new Expr\\PropertyFetch(new Expr\\Variable('a'), new Expr\\Error())\n        )];\n        $prettyPrinter = new PrettyPrinter\\Standard();\n        $prettyPrinter->prettyPrint($stmts);\n    }\n\n    public function testPrettyPrintWithErrorInClassConstFetch(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Cannot pretty-print AST with Error nodes');\n        $stmts = [new Stmt\\Expression(\n            new Expr\\ClassConstFetch(new Name('Foo'), new Expr\\Error())\n        )];\n        $prettyPrinter = new PrettyPrinter\\Standard();\n        $prettyPrinter->prettyPrint($stmts);\n    }\n\n    /**\n     * @dataProvider provideTestFormatPreservingPrint\n     */\n    public function testFormatPreservingPrint($name, $code, $modification, $expected, $modeLine): void {\n        [$parser, $printer] = $this->createParserAndPrinter($this->parseModeLine($modeLine));\n        $traverser = new NodeTraverser(new NodeVisitor\\CloningVisitor());\n\n        $oldStmts = $parser->parse($code);\n        $oldTokens = $parser->getTokens();\n\n        $newStmts = $traverser->traverse($oldStmts);\n\n        /** @var callable $fn */\n        eval(<<<CODE\nuse PhpParser\\Comment;\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\Modifiers;\n\\$fn = function(&\\$stmts) { $modification };\nCODE\n        );\n        $fn($newStmts);\n\n        $newCode = $printer->printFormatPreserving($newStmts, $oldStmts, $oldTokens);\n        $this->assertSame(canonicalize($expected), canonicalize($newCode), $name);\n    }\n\n    public static function provideTestFormatPreservingPrint() {\n        return self::getTests(__DIR__ . '/../code/formatPreservation', 'test', 3);\n    }\n\n    /**\n     * @dataProvider provideTestRoundTripPrint\n     */\n    public function testRoundTripPrint($name, $code, $expected, $modeLine): void {\n        /**\n         * This test makes sure that the format-preserving pretty printer round-trips for all\n         * the pretty printer tests (i.e. returns the input if no changes occurred).\n         */\n\n        [$parser, $printer] = $this->createParserAndPrinter($this->parseModeLine($modeLine));\n        $traverser = new NodeTraverser(new NodeVisitor\\CloningVisitor());\n\n        try {\n            $oldStmts = $parser->parse($code);\n        } catch (Error $e) {\n            // Can't do a format-preserving print on a file with errors\n            return;\n        }\n\n        $oldTokens = $parser->getTokens();\n\n        $newStmts = $traverser->traverse($oldStmts);\n\n        $newCode = $printer->printFormatPreserving($newStmts, $oldStmts, $oldTokens);\n        $this->assertSame(canonicalize($code), canonicalize($newCode), $name);\n    }\n\n    public static function provideTestRoundTripPrint() {\n        return array_merge(\n            self::getTests(__DIR__ . '/../code/prettyPrinter', 'test'),\n            self::getTests(__DIR__ . '/../code/parser', 'test')\n        );\n    }\n\n    public function testWindowsNewline(): void {\n        $prettyPrinter = new Standard([\n            'newline' => \"\\r\\n\",\n            'phpVersion' => PhpVersion::fromComponents(7, 2),\n        ]);\n        $stmts = [\n            new Stmt\\If_(new Int_(1), [\n                'stmts' => [\n                    new Stmt\\Echo_([new String_('Hello')]),\n                    new Stmt\\Echo_([new String_('World')]),\n                ],\n            ]),\n        ];\n        $code = $prettyPrinter->prettyPrint($stmts);\n        $this->assertSame(\"if (1) {\\r\\n    echo 'Hello';\\r\\n    echo 'World';\\r\\n}\", $code);\n        $code = $prettyPrinter->prettyPrintFile($stmts);\n        $this->assertSame(\"<?php\\r\\n\\r\\nif (1) {\\r\\n    echo 'Hello';\\r\\n    echo 'World';\\r\\n}\", $code);\n\n        $stmts = [new Stmt\\InlineHTML('Hello world')];\n        $code = $prettyPrinter->prettyPrintFile($stmts);\n        $this->assertSame(\"Hello world\", $code);\n\n        $stmts = [\n            new Stmt\\Expression(new String_('Test', [\n                'kind' => String_::KIND_NOWDOC,\n                'docLabel' => 'STR'\n            ])),\n            new Stmt\\Expression(new String_('Test 2', [\n                'kind' => String_::KIND_HEREDOC,\n                'docLabel' => 'STR'\n            ])),\n            new Stmt\\Expression(new InterpolatedString([new InterpolatedStringPart('Test 3')], [\n                'kind' => String_::KIND_HEREDOC,\n                'docLabel' => 'STR'\n            ])),\n        ];\n        $code = $prettyPrinter->prettyPrint($stmts);\n        $this->assertSame(\n            \"<<<'STR'\\r\\nTest\\r\\nSTR;\\r\\n<<<STR\\r\\nTest 2\\r\\nSTR;\\r\\n<<<STR\\r\\nTest 3\\r\\nSTR\\r\\n;\",\n            $code);\n    }\n\n    public function testInvalidNewline(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Option \"newline\" must be one of \"\\n\" or \"\\r\\n\"');\n        new PrettyPrinter\\Standard(['newline' => 'foo']);\n    }\n\n    public function testInvalidIndent(): void {\n        $this->expectException(\\LogicException::class);\n        $this->expectExceptionMessage('Option \"indent\" must either be all spaces or a single tab');\n        new PrettyPrinter\\Standard(['indent' => \"\\t  \"]);\n    }\n}\n"
  },
  {
    "path": "test/PhpParser/TokenTest.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nclass TokenTest extends \\PHPUnit\\Framework\\TestCase {\n    public function testGetTokenName(): void {\n        $token = new Token(\\ord(','), ',');\n        $this->assertSame(',', $token->getTokenName());\n        $token = new Token(\\T_WHITESPACE, ' ');\n        $this->assertSame('T_WHITESPACE', $token->getTokenName());\n    }\n\n    public function testIs(): void {\n        $token = new Token(\\ord(','), ',');\n        $this->assertTrue($token->is(\\ord(',')));\n        $this->assertFalse($token->is(\\ord(';')));\n        $this->assertTrue($token->is(','));\n        $this->assertFalse($token->is(';'));\n        $this->assertTrue($token->is([\\ord(','), \\ord(';')]));\n        $this->assertFalse($token->is([\\ord('!'), \\ord(';')]));\n        $this->assertTrue($token->is([',', ';']));\n        $this->assertFalse($token->is(['!', ';']));\n    }\n\n    /** @dataProvider provideTestIsIgnorable */\n    public function testIsIgnorable(int $id, string $text, bool $isIgnorable): void {\n        $token = new Token($id, $text);\n        $this->assertSame($isIgnorable, $token->isIgnorable());\n    }\n\n    public static function provideTestIsIgnorable() {\n        return [\n            [\\T_STRING, 'foo', false],\n            [\\T_WHITESPACE, ' ', true],\n            [\\T_COMMENT, '// foo', true],\n            [\\T_DOC_COMMENT, '/** foo */', true],\n            [\\T_OPEN_TAG, '<?php ', true],\n        ];\n    }\n\n    public function testToString(): void {\n        $token = new Token(\\ord(','), ',');\n        $this->assertSame(',', (string) $token);\n        $token = new Token(\\T_STRING, 'foo');\n        $this->assertSame('foo', (string) $token);\n    }\n}\n"
  },
  {
    "path": "test/bootstrap.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nfunction canonicalize($str) {\n    // normalize EOL style\n    $str = str_replace(\"\\r\\n\", \"\\n\", $str);\n\n    // trim newlines at end\n    $str = rtrim($str, \"\\n\");\n\n    // remove trailing whitespace on all lines\n    $lines = explode(\"\\n\", $str);\n    $lines = array_map(function ($line) {\n        return rtrim($line, \" \\t\");\n    }, $lines);\n    return implode(\"\\n\", $lines);\n}\n\nfunction filesInDir($directory, $fileExtension) {\n    $directory = realpath($directory);\n    $it = new \\RecursiveDirectoryIterator($directory);\n    $it = new \\RecursiveIteratorIterator($it, \\RecursiveIteratorIterator::LEAVES_ONLY);\n    $it = new \\RegexIterator($it, '(\\.' . preg_quote($fileExtension) . '$)');\n    foreach ($it as $file) {\n        $fileName = $file->getPathname();\n        yield $fileName => file_get_contents($fileName);\n    }\n}\n"
  },
  {
    "path": "test/code/formatPreservation/addingPropertyType.test",
    "content": "Adding property type\n-----\n<?php\n\nclass A\n{\n\n    public $a\n    = 1;\n}\n-----\n$stmts[0]->stmts[0]->type = new Node\\Identifier('string');\n-----\n<?php\n\nclass A\n{\n\n    public string $a\n    = 1;\n}\n-----\n<?php\n\nclass A\n{\n    public\n        $b;\n}\n-----\n$stmts[0]->stmts[0]->type = new Node\\Identifier('int');\n-----\n<?php\n\nclass A\n{\n    public\n        int $b;\n}\n"
  },
  {
    "path": "test/code/formatPreservation/anonClasses.test",
    "content": "Anonymous classes\n-----\n<?php\nnew class\n($x)\n  extends X\n{ };\n-----\n$new = $stmts[0]->expr;\n$new->class->extends = null;\n$new->args[] = new Expr\\Variable('y');\n-----\n<?php\nnew class\n($x, $y)\n{ };\n-----\n<?php\nnew class\n{};\n-----\n// Ignore name assigned to anon class\n$new = $stmts[0]->expr;\n$new->class->name = new Node\\Identifier('Anon1');\n-----\n<?php\nnew class\n{};"
  },
  {
    "path": "test/code/formatPreservation/arrayInsertionWithComments.test",
    "content": "Inserting array item with comment\n-----\n<?php\n\n$items = [\n    'a' => 'foo',\n    'b' => 'bar',\n];\n-----\n$node = new Expr\\ArrayItem(new Scalar\\String_('baz'), new Scalar\\String_('c'));\n$node->setAttribute('comments', [new Comment\\Doc(<<<COMMENT\n/**\n * A doc comment\n */\nCOMMENT\n)]);\n$array = $stmts[0]->expr->expr;\n$array->items[] = $node;\n-----\n<?php\n\n$items = [\n    'a' => 'foo',\n    'b' => 'bar',\n    /**\n     * A doc comment\n     */\n    'c' => 'baz',\n];\n-----\n<?php\n\n$items = [\n    'a' => 'foo',\n    'b' => 'bar',\n];\n-----\n$node = new Expr\\ArrayItem(new Scalar\\String_('baz'), new Scalar\\String_('c'));\n$node->setAttribute('comments', [new Comment(\"/* Block comment */\")]);\n$array = $stmts[0]->expr->expr;\n$array->items[] = $node;\n-----\n<?php\n\n$items = [\n    'a' => 'foo',\n    'b' => 'bar',\n    /* Block comment */\n    'c' => 'baz',\n];\n-----\n<?php\n\n$items = [\n    'a' => 'foo',\n    'b' => 'bar',\n];\n-----\n$node = new Expr\\ArrayItem(new Scalar\\String_('baz'), new Scalar\\String_('c'));\n$node->setAttribute('comments', [new Comment(\"// Line comment\")]);\n$array = $stmts[0]->expr->expr;\n$array->items[] = $node;\n-----\n<?php\n\n$items = [\n    'a' => 'foo',\n    'b' => 'bar',\n    // Line comment\n    'c' => 'baz',\n];\n-----\n<?php\n\n$items = [\n    'a' => 'foo',\n];\n-----\n$node = new Expr\\ArrayItem(new Scalar\\String_('bar'), new Scalar\\String_('b'));\n$node->setAttribute('comments', [new Comment(\"// Line comment\")]);\n$array = $stmts[0]->expr->expr;\n$array->items[] = $node;\n-----\n<?php\n\n$items = [\n    'a' => 'foo',\n    // Line comment\n    'b' => 'bar',\n];\n-----\n<?php\n\n$items = [];\n-----\n$node = new Expr\\ArrayItem(new Scalar\\String_('foo'), new Scalar\\String_('a'));\n$node->setAttribute('comments', [new Comment(\"// Line comment\")]);\n$array = $stmts[0]->expr->expr;\n$array->items[] = $node;\n-----\n<?php\n\n$items = [\n    // Line comment\n    'a' => 'foo',\n];"
  },
  {
    "path": "test/code/formatPreservation/array_spread.test",
    "content": "Array spread\n-----\n<?php\n$items = [\n...$value\n];\n-----\n$array = $stmts[0]->expr->expr;\n$array->items[] = new Expr\\ArrayItem(new Expr\\Variable('b'));\n-----\n<?php\n$items = [\n...$value, $b\n];\n-----\n<?php\n$items =\n[\n... $value\n];\n-----\n$array = $stmts[0]->expr->expr;\n$array->items[] = new Expr\\ArrayItem(new Expr\\Variable('c'), null, false, [], true);\n-----\n<?php\n$items =\n[\n... $value, ...$c\n];"
  },
  {
    "path": "test/code/formatPreservation/arrow_function.test",
    "content": "Arrow function\n-----\n<?php\nfn($a)\n=>\n$a;\n-----\n$stmts[0]->expr->expr = new Expr\\Variable('b');\n-----\n<?php\nfn($a)\n=>\n$b;\n-----\n<?php\nfn(\n$a\n) => $a;\n-----\n$stmts[0]->expr->params[] = new Node\\Param(new Expr\\Variable('b'));\n-----\n<?php\nfn(\n$a, $b\n) => $a;\n-----\n<?php\nfn(\n$a\n)\n=>\n$a;\n-----\n// TODO: Format preserving currently not supported\n$stmts[0]->expr->params = [];\n-----\n<?php\nfn() => $a;\n-----\n<?php\nfn($a)\n: int\n=> $a;\n-----\n$stmts[0]->expr->returnType = new Node\\Identifier('bool');\n-----\n<?php\nfn($a)\n: bool\n=> $a;\n-----\n<?php\nfn($a)\n: int\n=> $a;\n-----\n$stmts[0]->expr->returnType = null;\n-----\n<?php\nfn($a)\n=> $a;\n-----\n<?php\nfn($a)\n: int\n=> $a;\n\nstatic fn($a)\n: int\n=> $a;\n-----\n$stmts[0]->expr->static = true;\n$stmts[1]->expr->static = false;\n-----\n<?php\nstatic fn($a)\n: int\n=> $a;\n\nfn($a)\n: int\n=> $a;\n-----\n<?php\nfn($a)\n: int\n=> $a;\n\nfn&($a)\n: int\n=> $a;\n-----\n// TODO: Format preserving currently not supported\n$stmts[0]->expr->byRef = true;\n$stmts[1]->expr->byRef = false;\n-----\n<?php\nfn&($a): int => $a;\n\nfn($a): int => $a;\n"
  },
  {
    "path": "test/code/formatPreservation/attributes.test",
    "content": "Attributes\n-----\n<?php\n#[A]\nclass X {\n    #[A]\n    public function m(#[A] & $p) {}\n\n    #[A]\n    public\n        $prop;\n\n    #[A]\n    const\n        X = 42;\n}\n\n#[A]\ntrait X {}\n\n#[A]\ninterface X {}\n\n#[A]\nfunction f() {}\n\nnew #[A] class {};\n#[A] function() {};\n#[A] fn()\n    => 42;\n-----\n$attrGroup = new Node\\AttributeGroup([\n    new Node\\Attribute(new Node\\Name('B'), []),\n]);\n$stmts[0]->attrGroups[] = $attrGroup;\n$stmts[0]->stmts[0]->attrGroups[] = $attrGroup;\n$stmts[0]->stmts[0]->params[0]->attrGroups[] = $attrGroup;\n$stmts[0]->stmts[1]->attrGroups[] = $attrGroup;\n$stmts[0]->stmts[2]->attrGroups[] = $attrGroup;\n$stmts[1]->attrGroups[] = $attrGroup;\n$stmts[2]->attrGroups[] = $attrGroup;\n$stmts[3]->attrGroups[] = $attrGroup;\n$stmts[4]->expr->class->attrGroups[] = $attrGroup;\n$stmts[5]->expr->attrGroups[] = $attrGroup;\n$stmts[6]->expr->attrGroups[] = $attrGroup;\n-----\n<?php\n#[A]\n#[B]\nclass X {\n    #[A]\n    #[B]\n    public function m(#[A] #[B] & $p) {}\n\n    #[A]\n    #[B]\n    public\n        $prop;\n\n    #[A]\n    #[B]\n    const\n        X = 42;\n}\n\n#[A]\n#[B]\ntrait X {}\n\n#[A]\n#[B]\ninterface X {}\n\n#[A]\n#[B]\nfunction f() {}\n\nnew #[A] #[B] class {};\n#[A] #[B] function() {};\n#[A] #[B] fn()\n    => 42;\n-----\n<?php\nclass X {\n    public function m() {}\n\n    public\n        $prop;\n\n    const\n        X = 42;\n}\n\ntrait X {}\n\ninterface X {}\n\nfunction f() {}\n\nnew class {};\nfunction() {};\nfn()\n    => 42;\n-----\n$attrGroup = new Node\\AttributeGroup([\n    new Node\\Attribute(new Node\\Name('A'), []),\n]);\n$attrGroup2 = new Node\\AttributeGroup([\n    new Node\\Attribute(new Node\\Name('B'), []),\n]);\n$stmts[0]->attrGroups[] = $attrGroup;\n$stmts[0]->attrGroups[] = $attrGroup2;\n$stmts[0]->stmts[0]->attrGroups[] = $attrGroup;\n$stmts[0]->stmts[0]->attrGroups[] = $attrGroup2;\n$stmts[0]->stmts[1]->attrGroups[] = $attrGroup;\n$stmts[0]->stmts[2]->attrGroups[] = $attrGroup;\n$stmts[1]->attrGroups[] = $attrGroup;\n$stmts[2]->attrGroups[] = $attrGroup;\n$stmts[3]->attrGroups[] = $attrGroup;\n$stmts[4]->expr->class->attrGroups[] = $attrGroup;\n$stmts[5]->expr->attrGroups[] = $attrGroup;\n$stmts[6]->expr->attrGroups[] = $attrGroup;\n-----\n<?php\n#[A]\n#[B]\nclass X {\n    #[A]\n    #[B]\n    public function m() {}\n\n    #[A]\n    public\n        $prop;\n\n    #[A]\n    const\n        X = 42;\n}\n\n#[A]\ntrait X {}\n\n#[A]\ninterface X {}\n\n#[A]\nfunction f() {}\n\nnew #[A] class {};\n#[A] function() {};\n#[A] fn()\n    => 42;\n-----\n<?php\n\n#[ A,   B]\nclass X {};\n#[\n    A,\n    B,\n]\nclass X {};\n-----\n$attr = new Node\\Attribute(new Node\\Name('C'), []);\n$stmts[0]->attrGroups[0]->attrs[] = $attr;\n$stmts[1]->attrGroups[0]->attrs[] = $attr;\n-----\n<?php\n\n#[ A,   B, C]\nclass X {};\n#[\n    A,\n    B,\n    C,\n]\nclass X {};\n"
  },
  {
    "path": "test/code/formatPreservation/basic.test",
    "content": "abc1\n-----\n<?php\necho\n    1\n        +\n            2\n                +\n                    3;\n-----\n$stmts[0]->exprs[0]->left->right->value = 42;\n-----\n<?php\necho\n    1\n        +\n            42\n                +\n                    3;\n-----\n<?php\nfunction foo($a)\n    { return $a; }\n-----\n$stmts[0]->name = new Node\\Identifier('bar');\n-----\n<?php\nfunction bar($a)\n    { return $a; }\n-----\n<?php\nfunction\nfoo() {\n    call(\n        $bar\n    );\n}\n-----\n// This triggers a fallback\n$stmts[0]->byRef = true;\n-----\n<?php\nfunction &foo()\n{\n    call(\n        $bar\n    );\n}\n-----\n<?php\nfunction\nfoo() {\necho \"Start\nEnd\";\n}\n-----\n// This triggers a fallback\n$stmts[0]->byRef = true;\n-----\n<?php\nfunction &foo()\n{\n    echo \"Start\nEnd\";\n}\n-----\n<?php\nfunction test() {\n    call1(\n        $bar\n    );\n}\ncall2(\n    $foo\n);\n-----\n$tmp = $stmts[0]->stmts[0];\n$stmts[0]->stmts[0] = $stmts[1];\n$stmts[1] = $tmp;\n-----\n<?php\nfunction test() {\n    call2(\n        $foo\n    );\n}\ncall1(\n    $bar\n);\n-----\n<?php\nx;\nfunction test() {\n    call1(\n        $bar\n    );\n}\ncall2(\n    $foo\n);\n-----\n$tmp = $stmts[1]->stmts[0];\n$stmts[1]->stmts[0] = $stmts[2];\n$stmts[2] = $tmp;\n// Same test, but also removing first statement, triggering fallback\narray_splice($stmts, 0, 1, []);\n-----\n<?php\nfunction test() {\n    call2(\n        $foo\n    );\n}\ncall1(\n    $bar\n);\n-----\n<?php\n    echo 1;\n-----\n$stmts[0] = new Stmt\\Expression(\n    new Expr\\Assign(new Expr\\Variable('a'), new Expr\\Variable('b')));\n-----\n<?php\n    $a = $b;\n-----\n<?php\necho$a;\n-----\n$stmts[0]->exprs[0] = new Expr\\ConstFetch(new Node\\Name('C'));\n-----\n<?php\necho C;\n-----\n<?php\nfunction foo() {\n    foo();\n    /*\n     * bar\n     */\n    baz();\n}\n\n{\n    $x;\n}\n-----\n$tmp = $stmts[0];\n$stmts[0] = $stmts[1];\n$stmts[1] = $tmp;\n/* TODO This used to do two replacement operations, but with the node list diffing this is a\n * remove, keep, add (which probably makes more sense). As such, this currently triggers a\n * fallback. */\n-----\n<?php\n{\n    $x;\n}\nfunction foo() {\n    foo();\n    /*\n     * bar\n     */\n    baz();\n}\n-----\n<?php\necho \"${foo}bar\";\necho \"${foo['baz']}bar\";\n-----\n$stmts[0]->exprs[0]->parts[0] = new Expr\\Variable('bar');\n$stmts[1]->exprs[0]->parts[0] = new Expr\\Variable('bar');\n-----\n<?php\necho \"{$bar}bar\";\necho \"{$bar}bar\";\n-----\n<?php\n[$a\n,$b\n,\n,] = $b;\n-----\n/* Nothing */\n-----\n<?php\n[$a\n,$b\n,\n,] = $b;\n"
  },
  {
    "path": "test/code/formatPreservation/blockConversion.test",
    "content": "It may be necessary to convert a single statement into a block\n-----\n<?php\n\nif\n($a) $b;\n-----\n// TODO Avoid fallback\n$stmts[0]->stmts[] = new Stmt\\Expression(new Expr\\Variable('c'));\n-----\n<?php\n\nif ($a) {\n    $b;\n    $c;\n}\n-----\n<?php\n\nif\n($a) {$b;}\n-----\n$stmts[0]->stmts[] = new Stmt\\Expression(new Expr\\Variable('c'));\n-----\n<?php\n\nif\n($a) {$b;\n$c;}"
  },
  {
    "path": "test/code/formatPreservation/classMethodNop.test",
    "content": "Adding statement to Class Method containing Nop\n-----\n<?php\nclass Foo {\n    public function __construct()\n    {\n        // I'm just a comment\n    }\n}\n-----\n$stmts[0]->stmts[0]->stmts[] = new Stmt\\Expression(new Node\\Expr\\Variable('foo'));\n-----\n<?php\nclass Foo {\n    public function __construct()\n    {\n        // I'm just a comment\n        $foo;\n    }\n}\n-----\n<?php\nclass Foo {\n    public function __construct()\n    {\n        /* I'm just a comment */\n    }\n}\n-----\n$stmts[0]->stmts[0]->stmts[] = new Stmt\\Expression(new Node\\Expr\\Variable('foo'));\n-----\n<?php\nclass Foo {\n    public function __construct()\n    {\n        /* I'm just a comment */\n        $foo;\n    }\n}\n-----\n<?php\nclass Foo {\n    public function __construct()\n    {\n        /* I'm just a comment */\n    }\n}\n-----\n$stmts[0]->stmts[0]->stmts[0]->setAttribute('comments', [new Comment(\"/* I'm a new comment */\")]);\n-----\n<?php\nclass Foo {\n    public function __construct()\n    {\n        /* I'm a new comment */\n\n    }\n}\n-----\n<?php\nclass Foo {\n    public function __construct()\n    {\n        // I'm just a comment\n    }\n}\n-----\n$stmts[0]->stmts[0]->stmts[0]->setAttribute('comments', [new Comment(\"// I'm a new comment\")]);\n-----\n<?php\nclass Foo {\n    public function __construct()\n    {\n        // I'm a new comment\n\n    }\n}\n"
  },
  {
    "path": "test/code/formatPreservation/closure.test",
    "content": "Closure add static\n-----\n<?php\nfunction () {\n    if (rand(0, 1)) {\n        return true;\n    }\n\n    return false;\n};\n-----\n$stmts[0]->expr->static = true;\n-----\n<?php\nstatic function () {\n    if (rand(0, 1)) {\n        return true;\n    }\n\n    return false;\n};"
  },
  {
    "path": "test/code/formatPreservation/comments.test",
    "content": "Comment changes\n-----\n<?php\n// Test\nfoo();\n-----\n$stmts[0]->setAttribute('comments', []);\n-----\n<?php\nfoo();\n-----\n<?php\n$foo;\n\n\n/* bar */\n$baz;\n-----\n$comments = $stmts[1]->getComments();\n$comments[] = new Comment(\"// foo\");\n$stmts[1]->setAttribute('comments', $comments);\n-----\n<?php\n$foo;\n\n\n/* bar */\n// foo\n$baz;\n-----\n<?php\nclass Test {\n    /**\n     * @expectedException \\FooException\n     */\n    public function test() {\n        // some code\n    }\n}\n-----\n$method = $stmts[0]->stmts[0];\n$method->setAttribute('comments', [new Comment\\Doc(\"/**\\n *\\n */\")]);\n-----\n<?php\nclass Test {\n    /**\n     *\n     */\n    public function test() {\n        // some code\n    }\n}\n-----\n<?php\n    class Example {\n    }\n-----\n$stmts[0]->setDocComment(new Comment\\Doc(\"/** foo */\"));\n-----\n<?php\n    /** foo */\n    class Example {\n    }\n"
  },
  {
    "path": "test/code/formatPreservation/constants.test",
    "content": "Constants\n-----\n<?php\n\nconst FOO = true;\n\n#[A]\nconst BAR = true;\n-----\n$attrGroup = new Node\\AttributeGroup([\n    new Node\\Attribute(new Node\\Name('B'), []),\n]);\n$stmts[0]->attrGroups[] = $attrGroup;\n$stmts[1]->attrGroups[] = $attrGroup;\n-----\n<?php\n\n#[B]\nconst FOO = true;\n\n#[A]\n#[B]\nconst BAR = true;\n-----\n<?php\n\n#[ A,   B]\nconst FOO = true;\n\n#[\n    A,\n    B,\n]\nconst BAR = true;\n-----\n$attr = new Node\\Attribute(new Node\\Name('C'), []);\n$stmts[0]->attrGroups[0]->attrs[] = $attr;\n$stmts[1]->attrGroups[0]->attrs[] = $attr;\n-----\n<?php\n\n#[ A,   B, C]\nconst FOO = true;\n\n#[\n    A,\n    B,\n    C,\n]\nconst BAR = true;\n"
  },
  {
    "path": "test/code/formatPreservation/delAfterIdentifier.test",
    "content": "DEL after identifier\n-----\n<?php\n\"$a@@{ \"\\x7f\" }@@\";\n-----\n/* do nothing */\n-----\n<?php\n\"$a@@{ \"\\x7f\" }@@\";\n"
  },
  {
    "path": "test/code/formatPreservation/emptyListInsertion.test",
    "content": "Inserting into an empty list\n-----\n<?php\nclass\nTest {}\n\ninterface\nTest {}\n-----\n$stmts[0]->implements[] = new Node\\Name('Iface');\n$stmts[0]->implements[] = new Node\\Name('Iface2');\n$stmts[1]->extends[] = new Node\\Name('Iface');\n$stmts[1]->extends[] = new Node\\Name('Iface2');\n-----\n<?php\nclass\nTest implements Iface, Iface2 {}\n\ninterface\nTest extends Iface, Iface2 {}\n-----\n<?php\nfunction test\n() {}\n\nclass Test {\n    public function\n    test\n    () {}\n}\n\nfunction\n() {};\n\nfn()\n=> 42;\n-----\n$stmts[0]->params[] = new Node\\Param(new Node\\Expr\\Variable('a'));\n$stmts[0]->params[] = new Node\\Param(new Node\\Expr\\Variable('b'));\n$stmts[1]->stmts[0]->params[] = new Node\\Param(new Node\\Expr\\Variable('a'));\n$stmts[1]->stmts[0]->params[] = new Node\\Param(new Node\\Expr\\Variable('b'));\n$stmts[2]->expr->params[] = new Node\\Param(new Node\\Expr\\Variable('a'));\n$stmts[2]->expr->params[] = new Node\\Param(new Node\\Expr\\Variable('b'));\n$stmts[2]->expr->uses[] = new Node\\Expr\\Variable('c');\n$stmts[2]->expr->uses[] = new Node\\Expr\\Variable('d');\n$stmts[3]->expr->params[] = new Node\\Param(new Node\\Expr\\Variable('a'));\n$stmts[3]->expr->params[] = new Node\\Param(new Node\\Expr\\Variable('b'));\n-----\n<?php\nfunction test\n($a, $b) {}\n\nclass Test {\n    public function\n    test\n    ($a, $b) {}\n}\n\nfunction\n($a, $b) use ($c, $d) {};\n\nfn($a, $b)\n=> 42;\n-----\n<?php\nfoo\n();\n\n$foo->\nbar();\n\nFoo\n::bar ();\n\nnew\nFoo\n();\n\nnew class\n()\nextends Foo {};\n-----\n$stmts[0]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[0]->expr->args[] = new Node\\Expr\\Variable('b');\n$stmts[1]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[1]->expr->args[] = new Node\\Expr\\Variable('b');\n$stmts[2]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[2]->expr->args[] = new Node\\Expr\\Variable('b');\n$stmts[3]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[3]->expr->args[] = new Node\\Expr\\Variable('b');\n$stmts[4]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[4]->expr->args[] = new Node\\Expr\\Variable('b');\n-----\n<?php\nfoo\n($a, $b);\n\n$foo->\nbar($a, $b);\n\nFoo\n::bar ($a, $b);\n\nnew\nFoo\n($a, $b);\n\nnew class\n($a, $b)\nextends Foo {};\n-----\n<?php\nnew  Foo;\nnew  Foo  ;\nnew  Foo();\nnew  Foo  ();\nnew  class  {};\nnew  class()  {};\nnew  class  ()  {};\n-----\n$stmts[0]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[1]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[2]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[3]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[4]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[5]->expr->args[] = new Node\\Expr\\Variable('a');\n$stmts[6]->expr->args[] = new Node\\Expr\\Variable('a');\n-----\n<?php\nnew  Foo($a);\nnew  Foo($a)  ;\nnew  Foo($a);\nnew  Foo  ($a);\nnew  class($a)  {};\nnew  class($a)  {};\nnew  class  ($a)  {};"
  },
  {
    "path": "test/code/formatPreservation/enum.test",
    "content": "Enum formatting preservation\n-----\n<?php\nenum X: int\n{}\n-----\n$stmts[0]->scalarType = null;\n-----\n<?php\nenum X\n{}\n-----\n<?php\nenum X {\n    case\n        Y = 1;\n}\n-----\n$stmts[0]->stmts[0]->expr = null;\n-----\n<?php\nenum X {\n    case\n        Y;\n}\n-----\n<?php\nenum X\n{}\n-----\n$stmts[0]->scalarType = new Node\\Identifier('int');\n-----\n<?php\nenum X : int\n{}\n-----\n<?php\nenum X\nimplements Y\n{}\n-----\n$stmts[0]->scalarType = new Node\\Identifier('int');\n-----\n<?php\nenum X : int\nimplements Y\n{}\n-----\n<?php\nenum X {\n    case\n        Y;\n}\n-----\n$stmts[0]->stmts[0]->expr = new Scalar\\LNumber(1);\n-----\n<?php\nenum X {\n    case\n        Y = 1;\n}\n-----\n<?php\nenum X {\n    case A;\n\n    case B;\n}\n-----\n$stmts[0]->stmts[] = new Node\\Stmt\\EnumCase('C');\n-----\n<?php\nenum X {\n    case A;\n\n    case B;\n    case C;\n}\n-----\n<?php\nenum X\nimplements Y\n{}\n-----\n$stmts[0]->implements[] = new Node\\Name('Z');\n-----\n<?php\nenum X\nimplements Y, Z\n{}\n-----\n<?php\nenum X\n{}\n-----\n$stmts[0]->implements[] = new Node\\Name('Y');\n-----\n<?php\nenum X implements Y\n{}"
  },
  {
    "path": "test/code/formatPreservation/fixup.test",
    "content": "Fixup for precedence and some special syntax\n-----\n<?php\n$a ** $b  *  $c;\n$a  +  $b * $c;\n$a * $b  +  $c;\n$a  ?  $b  :  $c;\n($a ** $b)  *  $c;\n( $a ** $b )  *  $c;\n!$a = $b;\n-----\n// Parens necessary\n$stmts[0]->expr->left = new Expr\\BinaryOp\\Plus(new Expr\\Variable('a'), new Expr\\Variable('b'));\n// The parens here are \"correct\", because add is left assoc\n$stmts[1]->expr->right = new Expr\\BinaryOp\\Plus(new Expr\\Variable('b'), new Expr\\Variable('c'));\n// No parens necessary\n$stmts[2]->expr->left = new Expr\\BinaryOp\\Plus(new Expr\\Variable('a'), new Expr\\Variable('b'));\n// Parens for RHS not strictly necessary due to assign speciality\n$stmts[3]->expr->cond = new Expr\\Assign(new Expr\\Variable('a'), new Expr\\Variable('b'));\n$stmts[3]->expr->if = new Expr\\Assign(new Expr\\Variable('a'), new Expr\\Variable('b'));\n$stmts[3]->expr->else = new Expr\\Assign(new Expr\\Variable('a'), new Expr\\Variable('b'));\n// Already has parens\n$stmts[4]->expr->left = new Expr\\BinaryOp\\Plus(new Expr\\Variable('a'), new Expr\\Variable('b'));\n$stmts[5]->expr->left = new Expr\\BinaryOp\\Plus(new Expr\\Variable('a'), new Expr\\Variable('b'));\n-----\n<?php\n($a + $b)  *  $c;\n$a  +  ($b + $c);\n$a + $b  +  $c;\n($a = $b)  ?  $a = $b  :  ($a = $b);\n($a + $b)  *  $c;\n( $a + $b )  *  $c;\n!$a = $b;\n-----\n<?php\nfoo ();\nfoo ();\n$foo -> bar;\n$foo -> bar;\n$foo -> bar;\n$foo -> bar;\n$foo -> bar;\nself :: $foo;\nself :: $foo;\nnew Foo();\n$x instanceof Foo;\nFoo :: bar;\nFoo :: $bar;\nFoo :: bar();\nFoo :: bar;\n-----\n$stmts[0]->expr->name = new Expr\\Variable('a');\n$stmts[1]->expr->name = new Expr\\BinaryOp\\Concat(new Expr\\Variable('a'), new Expr\\Variable('b'));\n$stmts[2]->expr->var = new Expr\\Variable('bar');\n$stmts[3]->expr->var = new Expr\\BinaryOp\\Concat(new Expr\\Variable('a'), new Expr\\Variable('b'));\n$stmts[4]->expr->name = new Node\\Identifier('foo');\n// In this case the braces are not strictly necessary. However, on PHP 5 they may be required\n// depending on where the property fetch node itself occurs.\n$stmts[5]->expr->name = new Expr\\Variable('bar');\n$stmts[6]->expr->name = new Expr\\BinaryOp\\Concat(new Expr\\Variable('a'), new Expr\\Variable('b'));\n$stmts[7]->expr->name = new Node\\VarLikeIdentifier('bar');\n$stmts[8]->expr->name = new Expr\\BinaryOp\\Concat(new Expr\\Variable('a'), new Expr\\Variable('b'));\n$stmts[9]->expr->class = new Scalar\\String_('Foo');\n$stmts[10]->expr->class = new Scalar\\String_('Foo');\n$stmts[11]->expr->class = new Expr\\ConstFetch(new Node\\Name('FOO'));\n$stmts[12]->expr->class = new Expr\\ConstFetch(new Node\\Name('FOO'));\n$stmts[13]->expr->class = new Expr\\ConstFetch(new Node\\Name('FOO'));\n$stmts[14]->expr->name = new Expr\\Variable('bar');\n-----\n<?php\n$a ();\n($a . $b) ();\n$bar -> bar;\n($a . $b) -> bar;\n$foo -> foo;\n$foo -> {$bar};\n$foo -> {$a . $b};\nself :: $bar;\nself :: ${$a . $b};\nnew ('Foo')();\n$x instanceof ('Foo');\n(FOO) :: bar;\n(FOO) :: $bar;\n(FOO) :: bar();\nFoo :: {$bar};\n"
  },
  {
    "path": "test/code/formatPreservation/group_use.test",
    "content": "Group use should include trailing semicolon\n-----\n<?php\nuse A\\{B, C};\n-----\n$stmts[0] = new Stmt\\Use_([new Node\\UseItem(new Node\\Name('A\\B'))]);\n-----\n<?php\nuse A\\B;\n"
  },
  {
    "path": "test/code/formatPreservation/indent.test",
    "content": "Indentation\n-----\n<?php\n$x;\n-----\n$stmts[0] = new Stmt\\If_(new Expr\\Variable('a'), ['stmts' => $stmts]);\n-----\n!!indent=\"  \"\n<?php\nif ($a) {\n  $x;\n}\n-----\n<?php\n$x;\n-----\n$stmts[0] = new Stmt\\If_(new Expr\\Variable('a'), ['stmts' => $stmts]);\n-----\n!!indent=\"\\t\"\n<?php\nif ($a) {\n@@{\"\\t\"}@@$x;\n}\n-----\n<?php\nif ($a) {\n@@{\"\\t\"}@@$x;\n}\n-----\n$stmts[0]->stmts[] = new Stmt\\Expression(new Expr\\Variable('y'));\n-----\n!!indent=\"\\t\"\n<?php\nif ($a) {\n@@{\"\\t\"}@@$x;\n@@{\"\\t\"}@@$y;\n}\n-----\n<?php\narray_merge(\n    [\n$x,\n        $y,\n    ]\n);\n-----\n$call = $stmts[0]->expr;\n$stmts[0]->expr = new Expr\\StaticCall(new Node\\Name\\FullyQualified('Compat'), $call->name, $call->args);\n-----\n<?php\n\\Compat::array_merge([\n$x,\n    $y,\n]);\n-----\n<?php\nif ($a) {\n        if (\n$b\n        ) {}\n}\n-----\n$stmts[0] = new Stmt\\While_($stmts[0]->cond, $stmts[0]->stmts);\n-----\n<?php\nwhile ($a) {\n    if (\n$b\n    ) {}\n}\n"
  },
  {
    "path": "test/code/formatPreservation/inlineHtml.test",
    "content": "Handling of inline HTML\n-----\n<?php\n\nfunction test() {\n    ?>Foo<?php\n}\n-----\n$stmts[0]->setAttribute('origNode', null);\n-----\n<?php\n\nfunction test()\n{\n    ?>Foo<?php\n}\n-----\n<?php\n\nfunction test() {\n    foo();\n    ?>Bar<?php\n    baz();\n}\n-----\n// TODO Fix broken result\n$stmts[0]->stmts[2] = $stmts[0]->stmts[1];\n-----\n<?php\n\nfunction test() {\n    foo();\n    ?>Bar<?php\n    Bar\n}\n-----\n<?php\n\nfunction test() {\n    foo();\n    ?>Bar<?php\n    baz();\n}\n-----\n// TODO Preserve formatting\n$stmts[0]->stmts[1] = $stmts[0]->stmts[2];\n-----\n<?php\n\nfunction test()\n{\n    foo();\n    baz();\n    baz();\n}\n-----\n<?php\n\nfunction test() {\n    foo();\n    ?>Bar<?php\n    baz();\n}\n-----\n// TODO Preserve formatting\nunset($stmts[0]->stmts[2]);\n-----\n<?php\n\nfunction test()\n{\n    foo();\n    ?>Bar<?php\n}\n-----\n<?php\n\nfunction test() {\n    foo();\n    ?>Bar<?php\n    baz();\n}\n-----\n// TODO Preserve formatting\narray_splice($stmts[0]->stmts, 0, 1, []);\n-----\n<?php\n\nfunction test()\n{\n    ?>Bar<?php\n    baz();\n}\n-----\n<?php\n\nfunction test() {\n    foo();\n    ?>Bar<?php\n    baz();\n}\n-----\n// TODO Preserve formatting\narray_splice($stmts[0]->stmts, 1, 1, []);\n-----\n<?php\n\nfunction test()\n{\n    foo();\n    baz();\n}\n-----\n\n\n<?php $x;\n-----\n/* Do nothing, but make sure leading newlines are preserved. */\n-----\n\n\n<?php $x;\n"
  },
  {
    "path": "test/code/formatPreservation/insertionOfNullable.test",
    "content": "Insertion of a nullable node\n-----\n<?php\n\n// TODO: The result spacing isn't always optimal. We may want to skip whitespace in some cases.\n\nfunction\nfoo(\n$x,\n&$y\n)\n{}\n\n$foo\n[\n];\n\n[\n    & $value\n];\n\nfunction\n()\n{};\n\n$x\n?\n:\n$y;\n\nyield\n$v  ;\nyield  ;\n\nbreak\n;\ncontinue\n;\nreturn\n;\n\nclass\nX\n{\n    public\n    function y()\n    {}\n\n    private\n        $x\n    ;\n\n    const\n    X\n    = 1;\n}\n\nforeach (\n    $x\n    as\n    $y\n) {}\n\nstatic\n$var\n;\n\ntry {\n} catch (X\n$y) {\n}\n\nif ($cond) { // Foo\n} elseif ($cond2) { // Bar\n}\n-----\n$stmts[0]->returnType = new Node\\Name('Foo');\n$stmts[0]->params[0]->type = new Node\\Identifier('int');\n$stmts[0]->params[1]->type = new Node\\Identifier('array');\n$stmts[0]->params[1]->default = new Expr\\ConstFetch(new Node\\Name('null'));\n$stmts[1]->expr->dim = new Expr\\Variable('a');\n$stmts[2]->expr->items[0]->key = new Scalar\\String_('X');\n$stmts[3]->expr->returnType = new Node\\Name('Bar');\n$stmts[4]->expr->if = new Expr\\Variable('z');\n$stmts[5]->expr->key = new Expr\\Variable('k');\n$stmts[6]->expr->value = new Expr\\Variable('v');\n$stmts[7]->num = new Scalar\\LNumber(2);\n$stmts[8]->num = new Scalar\\LNumber(2);\n$stmts[9]->expr = new Expr\\Variable('x');\n$stmts[10]->extends = new Node\\Name\\FullyQualified('Bar');\n$stmts[10]->stmts[0]->returnType = new Node\\Name('Y');\n$stmts[10]->stmts[1]->props[0]->default = new Scalar\\DNumber(42.0);\n$stmts[10]->stmts[2]->type = new Node\\Identifier('int');\n$stmts[11]->keyVar = new Expr\\Variable('z');\n$stmts[12]->vars[0]->default = new Scalar\\String_('abc');\n$stmts[13]->finally = new Stmt\\Finally_([]);\n$stmts[14]->else = new Stmt\\Else_([]);\n-----\n<?php\n\n// TODO: The result spacing isn't always optimal. We may want to skip whitespace in some cases.\n\nfunction\nfoo(\nint $x,\narray &$y = null\n): Foo\n{}\n\n$foo\n[$a\n];\n\n[\n    'X' => & $value\n];\n\nfunction\n(): Bar\n{};\n\n$x\n? $z\n:\n$y;\n\nyield\n$k => $v  ;\nyield $v  ;\n\nbreak 2\n;\ncontinue 2\n;\nreturn $x\n;\n\nclass\nX extends \\Bar\n{\n    public\n    function y(): Y\n    {}\n\n    private\n        $x = 42.0\n    ;\n\n    const int\n    X\n    = 1;\n}\n\nforeach (\n    $x\n    as\n    $z => $y\n) {}\n\nstatic\n$var = 'abc'\n;\n\ntry {\n} catch (X\n$y) {\n} finally {\n}\n\nif ($cond) { // Foo\n} elseif ($cond2) { // Bar\n} else {\n}\n-----\n<?php\n\nnamespace\n{ echo 42; }\n-----\n$stmts[0]->name = new Node\\Name('Foo');\n-----\n<?php\n\nnamespace Foo\n{ echo 42; }\n-----\n<?php\ntry\n{\n}\ncatch (Exception)\n{\n}\n-----\n$stmts[0]->catches[0]->var = new Expr\\Variable('e');\n-----\n<?php\ntry\n{\n}\ncatch (Exception $e)\n{\n}\n"
  },
  {
    "path": "test/code/formatPreservation/listInsertion.test",
    "content": "Insertion into list nodes\n-----\n<?php\n$foo;\n\n$bar;\n-----\n$stmts[] = new Stmt\\Expression(new Expr\\Variable('baz'));\n-----\n<?php\n$foo;\n\n$bar;\n$baz;\n-----\n<?php\n\nfunction test() {\n    $foo;\n\n    $bar;\n}\n-----\n$stmts[0]->stmts[] = new Stmt\\Expression(new Expr\\Variable('baz'));\n-----\n<?php\n\nfunction test() {\n    $foo;\n\n    $bar;\n    $baz;\n}\n-----\n<?php\n\nfunction test(Foo     $param1) {}\n-----\n$stmts[0]->params[] = new Node\\Param(new Expr\\Variable('param2'));\n-----\n<?php\n\nfunction test(Foo     $param1, $param2) {}\n-----\n<?php\n\ntry {\n    /* stuff */\n} catch\n(Foo $x) {}\n-----\n$stmts[0]->catches[0]->types[] = new Node\\Name('Bar');\n-----\n<?php\n\ntry {\n    /* stuff */\n} catch\n(Foo|Bar $x) {}\n-----\n<?php\n\nfunction test(Foo     $param1) {}\n-----\narray_unshift($stmts[0]->params, new Node\\Param(new Expr\\Variable('param0')));\n-----\n<?php\n\nfunction test($param0, Foo     $param1) {}\n-----\n<?php\n\nfunction test() {}\n-----\n$stmts[0]->params[] = new Node\\Param(new Expr\\Variable('param0'));\n-----\n<?php\n\nfunction test($param0) {}\n-----\n<?php\n\nif ($cond) {\n} elseif ($cond2) {\n}\n-----\n$stmts[0]->elseifs[] = new Stmt\\ElseIf_(new Expr\\Variable('cond3'), []);\n-----\n<?php\n\nif ($cond) {\n} elseif ($cond2) {\n} elseif ($cond3) {\n}\n-----\n<?php\n\ntry {\n} catch (Foo $foo) {\n}\n-----\n$stmts[0]->catches[] = new Stmt\\Catch_([new Node\\Name('Bar')], new Expr\\Variable('bar'), []);\n-----\n<?php\n\ntry {\n} catch (Foo $foo) {\n} catch (Bar $bar) {\n}\n-----\n<?php\n$foo; $bar;\n-----\n$node = new Stmt\\Expression(new Expr\\Variable('baz'));\n$node->setAttribute('comments', [new Comment('// Test')]);\n$stmts[] = $node;\n-----\n<?php\n$foo; $bar;\n// Test\n$baz;\n-----\n<?php\nfunction test() {\n    $foo; $bar;\n}\n-----\n$node = new Stmt\\Expression(new Expr\\Variable('baz'));\n$node->setAttribute('comments', [new Comment('// Test'), new Comment('// Test 2')]);\n$stmts[0]->stmts[] = $node;\n-----\n<?php\nfunction test() {\n    $foo; $bar;\n    // Test\n    // Test 2\n    $baz;\n}\n-----\n<?php\nnamespace\nFoo;\n-----\n$stmts[0]->name->name = 'Xyz';\n-----\n<?php\nnamespace\nXyz;\n-----\n<?php\nfunction test() {\n    $foo; $bar;\n}\n-----\n$node = new Stmt\\Expression(new Expr\\Variable('baz'));\narray_unshift($stmts[0]->stmts, $node);\n-----\n<?php\nfunction test() {\n    $baz;\n    $foo; $bar;\n}\n-----\n<?php\nfunction test() {\n    $foo; $bar;\n}\n-----\n$node = new Stmt\\Expression(new Expr\\Variable('baz'));\n$node->setAttribute('comments', [new Comment('// Test')]);\narray_unshift($stmts[0]->stmts, $node);\n-----\n<?php\nfunction test() {\n    // Test\n    $baz;\n    $foo; $bar;\n}\n-----\n<?php\nfunction test() {\n\n    // Foo bar\n    $foo; $bar;\n}\n-----\n$node = new Stmt\\Expression(new Expr\\Variable('baz'));\n$node->setAttribute('comments', [new Comment('// Test')]);\narray_unshift($stmts[0]->stmts, $node);\n-----\n<?php\nfunction test() {\n\n    // Test\n    $baz;\n    // Foo bar\n    $foo; $bar;\n}\n-----\n<?php\nfunction test() {\n\n    // Foo bar\n    $foo; $bar;\n}\n-----\n$node = new Stmt\\Expression(new Expr\\Variable('baz'));\n$node->setAttribute('comments', [new Comment('// Test')]);\narray_unshift($stmts[0]->stmts, $node);\n$stmts[0]->stmts[1]->setAttribute('comments', [new Comment('// Bar foo')]);\n-----\n<?php\nfunction test() {\n\n    // Test\n    $baz;\n    // Bar foo\n    $foo; $bar;\n}\n-----\n<?php\nfunction test() {\n\n    // Foo bar\n    $foo; $bar;\n}\n-----\n$node = new Stmt\\Expression(new Expr\\Variable('baz'));\n$node->setAttribute('comments', [new Comment('// Test')]);\narray_unshift($stmts[0]->stmts, $node);\n$stmts[0]->stmts[1]->setAttribute('comments', []);\n-----\n<?php\nfunction test() {\n\n    // Test\n    $baz;\n    $foo; $bar;\n}\n-----\n<?php\nfunction test() {\n\n    // Foo bar\n    $foo; $bar;\n}\n-----\narray_unshift(\n    $stmts[0]->stmts,\n    new Stmt\\Expression(new Expr\\Variable('a')),\n    new Stmt\\Expression(new Expr\\Variable('b')));\n-----\n<?php\nfunction test() {\n\n    $a;\n    $b;\n    // Foo bar\n    $foo; $bar;\n}\n-----\n<?php\nfunction test() {}\n-----\n/* Insertion into empty list not handled yet */\n$stmts[0]->stmts = [\n    new Stmt\\Expression(new Expr\\Variable('a')),\n    new Stmt\\Expression(new Expr\\Variable('b')),\n];\n-----\n<?php\nfunction test()\n{\n    $a;\n    $b;\n}\n-----\n<?php\n$array = [\n    1,\n    2,\n    3,\n];\n-----\narray_unshift($stmts[0]->expr->expr->items, new Expr\\ArrayItem(new Scalar\\LNumber(42)));\n$stmts[0]->expr->expr->items[] = new Expr\\ArrayItem(new Scalar\\LNumber(24));\n-----\n<?php\n$array = [\n    42,\n    1,\n    2,\n    3,\n    24,\n];\n-----\n<?php\n$array = [\n    1, 2,\n    3,\n];\n-----\n$stmts[0]->expr->expr->items[] = new Expr\\ArrayItem(new Scalar\\LNumber(24));\n-----\n<?php\n$array = [\n    1, 2,\n    3, 24,\n];\n-----\n<?php\nfunction test(): A\n|B {}\n-----\n$stmts[0]->returnType->types[] = new Node\\Name('C');\n-----\n<?php\nfunction test(): A\n|B|C {}\n-----\n<?php\nfunction test(): A\n&B {}\n-----\n$stmts[0]->returnType->types[] = new Node\\Name('C');\n-----\n<?php\nfunction test(): A\n&B&C {}\n-----\n<?php\nfunction test() {\n    if ($x) {\n        $a;\n        $b;\n    }\n    $z;\n}\n-----\n$fnStmts =& $stmts[0]->stmts;\narray_splice($fnStmts, 0, 1, $fnStmts[0]->stmts);\n-----\n<?php\nfunction test() {\n    $a;\n    $b;\n    $z;\n}\n-----\n<?php\nlist($x, $y) = $z;\n-----\narray_splice($stmts[0]->expr->var->items, 1, 0, [null]);\n-----\n<?php\nlist($x, , $y) = $z;\n-----\n<?php\n{\n    $a; $b;\n}\n-----\n$stmts[0]->stmts[] = new Stmt\\Expression(new Expr\\Variable('c'));\n-----\n<?php\n{\n    $a; $b;\n    $c;\n}\n"
  },
  {
    "path": "test/code/formatPreservation/listInsertionIndentation.test",
    "content": "Check correct indentation use when inserting into list node\n-----\n<?php\n$this->foo = new Foo;\n$this->foo->a()\n          ->b();\n-----\n$outerCall = $stmts[1]->expr;\n$innerCall = $outerCall->var;\n$var = $innerCall->var;\n$stmts[1]->expr = $innerCall;\n$stmts[2] = new Stmt\\Expression(new Expr\\MethodCall($var, $outerCall->name));\n-----\n<?php\n$this->foo = new Foo;\n$this->foo->a();\n$this->foo->b();"
  },
  {
    "path": "test/code/formatPreservation/listRemoval.test",
    "content": "Removing from list nodes\n-----\n<?php $foo; $bar; $baz;\n-----\narray_splice($stmts, 1, 1, []);\n-----\n<?php $foo; $baz;\n-----\n<?php\nfunction foo(\n    $a,\n    $b,\n    $c\n) {}\n-----\narray_pop($stmts[0]->params);\n-----\n<?php\nfunction foo(\n    $a,\n    $b\n) {}\n-----\n<?php\nfunction foo(\n    $a,\n    $b,\n    $c\n) {}\n-----\narray_pop($stmts[0]->params);\n$stmts[0]->params[] = new Node\\Param(new Expr\\Variable('x'));\n$stmts[0]->params[] = new Node\\Param(new Expr\\Variable('y'));\n-----\n<?php\nfunction foo(\n    $a,\n    $b,\n    $x,\n    $y\n) {}\n-----\n<?php\nfunction test(): A\n|B\n|C {}\n-----\narray_pop($stmts[0]->returnType->types);\n-----\n<?php\nfunction test(): A\n|B {}\n-----\n<?php $a; $b; $c;\n-----\narray_splice($stmts, 0, 1, []);\n-----\n<?php $b; $c;\n-----\n<?php $a; $b; $c;\n-----\narray_splice($stmts, 0, 2, []);\n-----\n<?php $c;\n-----\n<?php\n{ $x; }\n$y;\n-----\narray_splice($stmts, 0, 1, []);\n-----\n<?php\n$y;\n-----\n<?php\n$x;\n{ $y; }\n-----\narray_splice($stmts, 0, 1, []);\n-----\n<?php\n{ $y; }\n-----\n<?php\n$x;\n{ $y; }\n-----\narray_pop($stmts);\n-----\n<?php\n$x;\n-----\n<?php\n{ $x; }\n$y;\n-----\narray_pop($stmts);\n-----\n<?php\n{ $x; }\n-----\n<?php\n// Foo\n$x;\n$y;\n-----\narray_splice($stmts, 0, 1, []);\n-----\n<?php\n$y;\n-----\n<?php\n\ntry {\n\n} catch (\\InvalidArgumentException $e) {\n\n} catch (\\Exception $e) {\n\n} catch (\\LogicException $e) {\n\n} catch (\\Throwable $e) {\n\n}\n-----\n$catch = $stmts[0]->catches[2];\nunset($stmts[0]->catches[2]);\n$stmts[0]->catches = array_values($stmts[0]->catches);\narray_splice($stmts[0]->catches, 1, 0, [$catch]);\n-----\n<?php\n\ntry {\n\n} catch (\\InvalidArgumentException $e) {\n\n} catch (\\LogicException $e) {\n\n} catch (\\Exception $e) {\n\n} catch (\\Throwable $e) {\n\n}\n-----\n<?php\n\ntry {\n\n} catch (\\InvalidArgumentException $e) {\n\n} catch (\\Exception $e) {\n\n} catch (\\LogicException $e) {\n\n} catch (\\Throwable $e) {\n\n}\n-----\nunset($stmts[0]->catches[2]);\n$stmts[0]->catches = array_values($stmts[0]->catches);\n-----\n<?php\n\ntry {\n\n} catch (\\InvalidArgumentException $e) {\n\n} catch (\\Exception $e) {\n\n} catch (\\Throwable $e) {\n\n}\n\n-----\n<?php\nclass Foo\n{\n    private $id;\n\n    public function getId()\n    {\n    }\n\n    public function getFoo()\n    {\n    }\n}\n-----\n$stmts[0]->stmts[2] = new Node\\Stmt\\ClassMethod('getBar');\n$stmts[0]->stmts[3] = new Node\\Stmt\\ClassMethod('getBaz');\n-----\n<?php\nclass Foo\n{\n    private $id;\n\n    public function getId()\n    {\n    }\n    function getBar()\n    {\n    }\n    function getBaz()\n    {\n    }\n}\n-----\n<?php\nclass Test {\n    use A, B;\n}\n-----\nunset($stmts[0]->stmts[0]->traits[0]);\n-----\n<?php\nclass Test {\n    use B;\n}\n"
  },
  {
    "path": "test/code/formatPreservation/match.test",
    "content": "Matches\n-----\n<?php\n$value = match (1)\n{\n    1\n    =>\n    'one'\n};\n-----\n$stmts[0]->expr->expr->arms[] = new Node\\MatchArm(null, new Scalar\\String_('two'));\n-----\n<?php\n$value = match (1)\n{\n    1\n    =>\n    'one',\n    default => 'two'\n};\n-----\n<?php\n$value = match (1) {\n    1, 2 =>\n    'test',\n};\n-----\n$stmts[0]->expr->expr->arms[0]->conds[] = new Scalar\\LNumber(3);\n-----\n<?php\n$value = match (1) {\n    1, 2, 3 =>\n    'test',\n};\n-----\n<?php\n$value = match (1) {\n    1\n    =>\n    'one',\n    2\n    =>\n    'two',\n    3\n    =>\n    'three',\n};\n-----\narray_splice($stmts[0]->expr->expr->arms, 1, 1, []);\n-----\n<?php\n$value = match (1) {\n    1\n    =>\n    'one',\n    3\n    =>\n    'three',\n};\n-----\n<?php\n// TODO: Preserve formatting?\n$value = match (1) {\n    default\n    =>\n    'test',\n};\n-----\n$stmts[0]->expr->expr->arms[0]->conds = [new Scalar\\LNumber(1)];\n-----\n<?php\n// TODO: Preserve formatting?\n$value = match (1) {\n    1 => 'test',\n};\n-----\n<?php\n// TODO: Preserve formatting?\n$value = match (1) {\n    1\n    =>\n    'test',\n};\n-----\n$stmts[0]->expr->expr->arms[0]->conds = null;\n-----\n<?php\n// TODO: Preserve formatting?\n$value = match (1) {\n    default => 'test',\n};\n"
  },
  {
    "path": "test/code/formatPreservation/modifierChange.test",
    "content": "Modifier change\n-----\n<?php\nclass Foo {}\nabstract class Bar {\n    const\n    FOO = 42;\n\n    var $foo\n    = 24;\n\n    public function\n    foo() {}\n}\n-----\n$stmts[0]->flags = Stmt\\Class_::MODIFIER_ABSTRACT;\n$stmts[1]->flags = 0;\n$stmts[1]->stmts[0]->flags = Stmt\\Class_::MODIFIER_PRIVATE;\n$stmts[1]->stmts[1]->flags = Stmt\\Class_::MODIFIER_PROTECTED;\n$stmts[1]->stmts[2]->flags |= Stmt\\Class_::MODIFIER_FINAL;\n-----\n<?php\nabstract class Foo {}\nclass Bar {\n    private const\n    FOO = 42;\n\n    protected $foo\n    = 24;\n\n    final public function\n    foo() {}\n}\n-----\n<?php\nfunction test(\n    public T1 $x\n        = 'y',\n    private T2 $y\n        = 'z',\n    T3 $z\n        = 'x',\n) {}\n-----\n$stmts[0]->params[0]->flags = Stmt\\Class_::MODIFIER_PRIVATE;\n$stmts[0]->params[1]->flags = 0;\n$stmts[0]->params[2]->flags = Stmt\\Class_::MODIFIER_PUBLIC;\n-----\n<?php\nfunction test(\n    private T1 $x\n        = 'y',\n    T2 $y\n        = 'z',\n    public T3 $z\n        = 'x',\n) {}\n-----\n<?php\nnew class {};\nnew readonly class {};\n-----\n$stmts[0]->expr->class->flags = Modifiers::READONLY;\n$stmts[1]->expr->class->flags = 0;\n-----\n<?php\nnew readonly class {};\nnew class {};\n-----\n<?php\nclass X {\n    #[A]\n    public function m() {}\n    /** A */\n    public function m2() {}\n}\n-----\n$stmts[0]->stmts[0]->flags = Modifiers::PROTECTED;\n$stmts[0]->stmts[1]->flags = Modifiers::PROTECTED;\n-----\n<?php\nclass X {\n    #[A]\n    protected function m() {}\n    /** A */\n    protected function m2() {}\n}"
  },
  {
    "path": "test/code/formatPreservation/namedArgs.test",
    "content": "Named arguments\n-----\n<?php\nfoo(\n    a: $b,\n);\n-----\n$stmts[0]->expr->args[0]->name = null;\n-----\n<?php\nfoo(\n    $b,\n);\n-----\n<?php\nfoo(\n    $b,\n);\n-----\n$stmts[0]->expr->args[0]->name = new Node\\Identifier('a');\n-----\n<?php\nfoo(\n    a: $b,\n);\n-----\n<?php\nfoo(\n    a:\n    $b,\n);\n-----\n$stmts[0]->expr->args[0]->name = new Node\\Identifier('XYZ');\n-----\n<?php\nfoo(\n    XYZ:\n    $b,\n);"
  },
  {
    "path": "test/code/formatPreservation/nopCommentAtEnd.test",
    "content": "Nop statement with comment at end (#513)\n-----\n<?php\n$foo;\n$bar;\n-----\n$stmts[1] = new Stmt\\Nop(['comments' => [new Comment('//Some comment here')]]);\n-----\n<?php\n$foo;\n//Some comment here"
  },
  {
    "path": "test/code/formatPreservation/property_hooks.test",
    "content": "Property hooks\n-----\n<?php\nclass Test {\n    public $prop\n    {\n        get => 42;\n    }\n}\n-----\n$stmts[0]->stmts[0]->hooks[] = new Node\\PropertyHook('set', new Scalar\\Int_(123));\n-----\n<?php\nclass Test {\n    public $prop\n    {\n        get => 42;\n        set => 123;\n    }\n}\n-----\n<?php\nclass Test {\n    public function __construct(\n        public $prop\n        { get => 42; }\n    ) {}\n}\n-----\n$stmts[0]->stmts[0]->params[0]->hooks[] = new Node\\PropertyHook('set', new Scalar\\Int_(123));\n-----\n<?php\nclass Test {\n    public function __construct(\n        public $prop\n        { get => 42;\n        set => 123; }\n    ) {}\n}\n-----\n<?php\nclass Test {\n    public $prop {\n        set\n        {\n            $a;\n        }\n    }\n}\n-----\n$stmts[0]->stmts[0]->hooks[0]->body[] = new Stmt\\Expression(new Expr\\Variable('b'));\n-----\n<?php\nclass Test {\n    public $prop {\n        set\n        {\n            $a;\n            $b;\n        }\n    }\n}\n-----\n<?php\nclass Test {\n    public $prop {\n        get\n        => 42;\n    }\n}\n-----\n$stmts[0]->stmts[0]->hooks[0]->flags = Modifiers::FINAL;\n-----\n<?php\nclass Test {\n    public $prop {\n        final get\n        => 42;\n    }\n}\n-----\n<?php\n// For now, just make sure this works.\nclass Test {\n    public $prop {\n        get\n        => 42;\n    }\n}\n-----\n$stmts[0]->stmts[0]->hooks[0]->body = [new Stmt\\Return_(new Scalar\\Int_(24))];\n-----\n<?php\n// For now, just make sure this works.\nclass Test {\n    public $prop {\n        get {\n            return 24;\n        }\n    }\n}\n-----\n<?php\n// For now, just make sure this works.\nclass Test {\n    public $prop1 {\n        & get;\n    }\n    public $prop2 {\n        & get;\n    }\n}\n-----\n$stmts[0]->stmts[0]->hooks[0]->body = new Scalar\\Int_(24);\n$stmts[0]->stmts[1]->hooks[0]->body = [new Stmt\\Return_(new Scalar\\Int_(24))];\n-----\n<?php\n// For now, just make sure this works.\nclass Test {\n    public $prop1 {\n        &get => 24;\n    }\n    public $prop2 {\n        &get {\n            return 24;\n        }\n    }\n}\n"
  },
  {
    "path": "test/code/formatPreservation/removalViaNull.test",
    "content": "Removing subnodes by setting them to null\n-----\n<?php\nfunction\nfoo (\n    Bar $foo\n        = null,\n    Foo $bar) : baz\n{}\n\nfunction\n()\n: int\n{};\n\nclass\nFoo\nextends\nBar\n{\n    public\n    function\n    foo() : ?X {}\n\n    public\n      $prop = 'x'\n    ;\n\n    use T {\n        T\n        ::\n        x\n        as\n        public\n        y\n        ;\n    }\n\n    const\n    int\n    X\n    = 1;\n}\n\n$foo [ $bar ];\nexit ( $bar );\n$foo\n? $bar :\n$baz;\n[ $a => $b\n, $c => & $d];\n\nyield\n$foo\n=>\n$bar;\nyield\n$bar;\n\nbreak\n2\n;\ncontinue\n2\n;\n\nforeach(\n    $array\nas\n    $key\n =>\n    $value\n) {}\n\nif\n($x)\n{\n}\n\nelse {}\n\nreturn\n$val\n;\nstatic\n  $x\n  =\n  $y\n;\n\ntry {} catch\n  (X $y)\n  {}\nfinally\n{}\n-----\n$stmts[0]->returnType = null;\n$stmts[0]->params[0]->default = null;\n$stmts[0]->params[1]->type = null;\n$stmts[1]->expr->returnType = null;\n$stmts[2]->extends = null;\n$stmts[2]->stmts[0]->returnType = null;\n$stmts[2]->stmts[1]->props[0]->default = null;\n$stmts[2]->stmts[2]->adaptations[0]->newName = null;\n$stmts[2]->stmts[3]->type = null;\n$stmts[3]->expr->dim = null;\n$stmts[4]->expr->expr = null;\n$stmts[5]->expr->if = null;\n$stmts[6]->expr->items[1]->key = null;\n$stmts[7]->expr->key = null;\n$stmts[8]->expr->value = null;\n$stmts[9]->num = null;\n$stmts[10]->num = null;\n$stmts[11]->keyVar = null;\n$stmts[12]->else = null;\n$stmts[13]->expr = null;\n$stmts[14]->vars[0]->default = null;\n$stmts[15]->finally = null;\n-----\n<?php\nfunction\nfoo (\n    Bar $foo,\n    $bar)\n{}\n\nfunction\n()\n{};\n\nclass\nFoo\n{\n    public\n    function\n    foo() {}\n\n    public\n      $prop\n    ;\n\n    use T {\n        T\n        ::\n        x\n        as\n        public\n        ;\n    }\n\n    const\n    X\n    = 1;\n}\n\n$foo [];\nexit ();\n$foo\n?:\n$baz;\n[ $a => $b\n, & $d];\n\nyield\n$bar;\nyield;\n\nbreak;\ncontinue;\n\nforeach(\n    $array\nas\n    $value\n) {}\n\nif\n($x)\n{\n}\n\nreturn;\nstatic\n  $x\n;\n\ntry {} catch\n  (X $y)\n  {}\n-----\n<?php\n\nnamespace\nA\n    {\n    }\n-----\n$stmts[0]->name = null;\n-----\n<?php\n\nnamespace\n    {\n    }\n-----\n<?php\ntry\n{\n}\ncatch (Exception $e)\n{\n}\n-----\n$stmts[0]->catches[0]->var = null;\n-----\n<?php\ntry\n{\n}\ncatch (Exception)\n{\n}\n"
  },
  {
    "path": "test/code/formatPreservation/removingPropertyType.test",
    "content": "Removing property type\n-----\n<?php\n\nclass B\n{\n\n    public\n    ?float\n    $b;\n}\n-----\n$stmts[0]->stmts[0]->type = null;\n-----\n<?php\n\nclass B\n{\n\n    public\n    $b;\n}\n"
  },
  {
    "path": "test/code/formatPreservation/rewriteVariableInterpolationString.test",
    "content": "Rewrite string with variable interpolation\n-----\n<?php\n\"{$e}\";\n-----\n$stmts[0]->expr->parts[0]->setAttribute('origNode', null);\n-----\n<?php\n\"{$e}\";\n"
  },
  {
    "path": "test/code/formatPreservation/traitAlias.test",
    "content": "Trait alias\n-----\n<?php\nclass X {\n    use T {\n        exit\n            as die;\n    }\n}\n-----\n/* do nothing */\n-----\n<?php\nclass X {\n    use T {\n        exit\n            as die;\n    }\n}"
  },
  {
    "path": "test/code/parser/blockComments.test",
    "content": "Comments on blocks\n-----\n<?php\n\n// foo\n{\n    // bar\n    {\n        // baz\n        $a;\n    }\n}\n\n// empty\n{}\n-----\narray(\n    0: Stmt_Block(\n        stmts: array(\n            0: Stmt_Block(\n                stmts: array(\n                    0: Stmt_Expression(\n                        expr: Expr_Variable(\n                            name: a\n                        )\n                        comments: array(\n                            0: // baz\n                        )\n                    )\n                )\n                comments: array(\n                    0: // bar\n                )\n            )\n        )\n        comments: array(\n            0: // foo\n        )\n    )\n    1: Stmt_Block(\n        stmts: array(\n        )\n        comments: array(\n            0: // empty\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/commentAtEndOfClass.test",
    "content": "Comment at end of class (#509)\n-----\n<?php\nclass MyClass {\n    protected $a;\n    // my comment\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: MyClass\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PROTECTED (2)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: a\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Stmt_Nop(\n                comments: array(\n                    0: // my comment\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/comments.test",
    "content": "Comments\n-----\n<?php\n\n/** doc 1 */\n/* foobar 1 */\n// foo 1\n// bar 1\n$var;\n\nif ($cond) {\n    /** doc 2 */\n    /* foobar 2 */\n    // foo 2\n    // bar 2\n}\n\n/** doc 3 */\n/* foobar 3 */\n// foo 3\n// bar 3\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Variable(\n            name: var\n        )\n        comments: array(\n            0: /** doc 1 */\n            1: /* foobar 1 */\n            2: // foo 1\n            3: // bar 1\n        )\n    )\n    1: Stmt_If(\n        cond: Expr_Variable(\n            name: cond\n        )\n        stmts: array(\n            0: Stmt_Nop(\n                comments: array(\n                    0: /** doc 2 */\n                    1: /* foobar 2 */\n                    2: // foo 2\n                    3: // bar 2\n                )\n            )\n        )\n        elseifs: array(\n        )\n        else: null\n    )\n    2: Stmt_Nop(\n        comments: array(\n            0: /** doc 3 */\n            1: /* foobar 3 */\n            2: // foo 3\n            3: // bar 3\n        )\n    )\n)\n-----\n<?php\n\n/** doc */\n/* foobar */\n// foo\n// bar\n\n?>\n-----\narray(\n    0: Stmt_Nop(\n        comments: array(\n            0: /** doc */\n            1: /* foobar */\n            2: // foo\n            3: // bar\n        )\n    )\n)\n-----\n<?php\n\n// comment\nif (42) {}\n-----\narray(\n    0: Stmt_If(\n        cond: Scalar_Int(\n            value: 42\n        )\n        stmts: array(\n        )\n        elseifs: array(\n        )\n        else: null\n        comments: array(\n            0: // comment\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/emptyFile.test",
    "content": "Empty file\n-----\n\n-----\narray(\n)\n"
  },
  {
    "path": "test/code/parser/errorHandling/eofError.test",
    "content": "Error positions\n-----\n<?php foo\n-----\nSyntax error, unexpected EOF from 1:10 to 1:10\narray(\n    0: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: foo\n            )\n        )\n    )\n)\n-----\n<?php foo /* bar */\n-----\nSyntax error, unexpected EOF from 1:20 to 1:20\narray(\n    0: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: foo\n            )\n        )\n    )\n    1: Stmt_Nop(\n        comments: array(\n            0: /* bar */\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/errorHandling/lexerErrors.test",
    "content": "Lexer errors\n-----\n<?php\n\n$a = 42;\n/*\n$b = 24;\n-----\nUnterminated comment from 4:1 to 5:9\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Scalar_Int(\n                value: 42\n            )\n        )\n    )\n    1: Stmt_Nop(\n        comments: array(\n            0: /*\n            $b = 24;\n        )\n    )\n)\n-----\n<?php\n\n$a = 42;\n@@{ \"\\1\" }@@\n$b = 24;\n-----\n!!positions\nUnexpected character \"\u0001\" (ASCII 1) from 4:1 to 4:1\narray(\n    0: Stmt_Expression[3:1 - 3:8](\n        expr: Expr_Assign[3:1 - 3:7](\n            var: Expr_Variable[3:1 - 3:2](\n                name: a\n            )\n            expr: Scalar_Int[3:6 - 3:7](\n                value: 42\n            )\n        )\n    )\n    1: Stmt_Expression[5:1 - 5:8](\n        expr: Expr_Assign[5:1 - 5:7](\n            var: Expr_Variable[5:1 - 5:2](\n                name: b\n            )\n            expr: Scalar_Int[5:6 - 5:7](\n                value: 24\n            )\n        )\n    )\n)\n-----\n<?php\n\n$a = 42;\n@@{ \"\\0\" }@@\n$b = 24;\n-----\n!!positions\nUnexpected null byte from 4:1 to 4:1\narray(\n    0: Stmt_Expression[3:1 - 3:8](\n        expr: Expr_Assign[3:1 - 3:7](\n            var: Expr_Variable[3:1 - 3:2](\n                name: a\n            )\n            expr: Scalar_Int[3:6 - 3:7](\n                value: 42\n            )\n        )\n    )\n    1: Stmt_Expression[5:1 - 5:8](\n        expr: Expr_Assign[5:1 - 5:7](\n            var: Expr_Variable[5:1 - 5:2](\n                name: b\n            )\n            expr: Scalar_Int[5:6 - 5:7](\n                value: 24\n            )\n        )\n    )\n)\n-----\n<?php\n\n$a = 1;\n@@{ \"\\1\" }@@\n$b = 2;\n@@{ \"\\2\" }@@\n$c = 3;\n-----\n!!positions\nUnexpected character \"\u0001\" (ASCII 1) from 4:1 to 4:1\nUnexpected character \"\u0002\" (ASCII 2) from 6:1 to 6:1\narray(\n    0: Stmt_Expression[3:1 - 3:7](\n        expr: Expr_Assign[3:1 - 3:6](\n            var: Expr_Variable[3:1 - 3:2](\n                name: a\n            )\n            expr: Scalar_Int[3:6 - 3:6](\n                value: 1\n            )\n        )\n    )\n    1: Stmt_Expression[5:1 - 5:7](\n        expr: Expr_Assign[5:1 - 5:6](\n            var: Expr_Variable[5:1 - 5:2](\n                name: b\n            )\n            expr: Scalar_Int[5:6 - 5:6](\n                value: 2\n            )\n        )\n    )\n    2: Stmt_Expression[7:1 - 7:7](\n        expr: Expr_Assign[7:1 - 7:6](\n            var: Expr_Variable[7:1 - 7:2](\n                name: c\n            )\n            expr: Scalar_Int[7:6 - 7:6](\n                value: 3\n            )\n        )\n    )\n)\n-----\n<?php\n\nif ($b) {\n    $a = 1;\n    /* unterminated\n}\n-----\nUnterminated comment from 5:5 to 6:2\nSyntax error, unexpected EOF from 6:2 to 6:2\n"
  },
  {
    "path": "test/code/parser/errorHandling/recovery.test",
    "content": "Error recovery\n-----\n<?php\n\nfoo()\nbar()\nbaz()\n-----\nSyntax error, unexpected T_STRING from 4:1 to 4:3\nSyntax error, unexpected T_STRING from 5:1 to 5:3\nSyntax error, unexpected EOF from 5:6 to 5:6\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: foo\n            )\n            args: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: bar\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: baz\n            )\n            args: array(\n            )\n        )\n    )\n)\n-----\n<?php\n\nfoo()\nbar();\nbaz();\n-----\nSyntax error, unexpected T_STRING from 4:1 to 4:3\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: foo\n            )\n            args: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: bar\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: baz\n            )\n            args: array(\n            )\n        )\n    )\n)\n-----\n<?php\n\nfoo();\nbar()\nbaz();\n-----\nSyntax error, unexpected T_STRING from 5:1 to 5:3\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: foo\n            )\n            args: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: bar\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: baz\n            )\n            args: array(\n            )\n        )\n    )\n)\n-----\n<?php\nabc;\n1 + ;\n-----\nSyntax error, unexpected ';' from 3:5 to 3:5\narray(\n    0: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: abc\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 1\n        )\n    )\n)\n-----\n<?php\nfunction test() {\n    1 +\n}\n-----\nSyntax error, unexpected '}' from 4:1 to 4:1\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Scalar_Int(\n                    value: 1\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\n$i = 0;\nwhile\n\n$j = 1;\n$k = 2;\n-----\nSyntax error, unexpected T_VARIABLE, expecting '(' from 6:1 to 6:2\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: i\n            )\n            expr: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: j\n            )\n            expr: Scalar_Int(\n                value: 1\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: k\n            )\n            expr: Scalar_Int(\n                value: 2\n            )\n        )\n    )\n)\n-----\n<?php\n\n$i = 0;\nwhile () {\n    $j = 1;\n}\n$k = 2;\n// The output here drops the loop - would require Error node to handle this\n-----\nSyntax error, unexpected ')' from 4:8 to 4:8\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: i\n            )\n            expr: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    1: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Assign(\n                    var: Expr_Variable(\n                        name: j\n                    )\n                    expr: Scalar_Int(\n                        value: 1\n                    )\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: k\n            )\n            expr: Scalar_Int(\n                value: 2\n            )\n        )\n    )\n    3: Stmt_Nop(\n        comments: array(\n            0: // The output here drops the loop - would require Error node to handle this\n        )\n    )\n)\n-----\n<?php\n// Can't recover this yet, as the '}' for the inner_statement_list\n// is always required.\n\n$i = 0;\nwhile (true) {\n    $i = 1;\n    $i = 2;\n-----\nSyntax error, unexpected EOF from 8:12 to 8:12\n-----\n<?php\n$foo->\n;\n-----\n!!positions\nSyntax error, unexpected ';', expecting T_STRING or T_VARIABLE or '{' or '$' from 3:1 to 3:1\narray(\n    0: Stmt_Expression[2:1 - 3:1](\n        expr: Expr_PropertyFetch[2:1 - 2:6](\n            var: Expr_Variable[2:1 - 2:4](\n                name: foo\n            )\n            name: Expr_Error[3:1 - 2:6](\n            )\n        )\n    )\n)\n-----\n<?php\nfunction foo() {\n    $bar->\n}\n-----\n!!positions\nSyntax error, unexpected '}', expecting T_STRING or T_VARIABLE or '{' or '$' from 4:1 to 4:1\narray(\n    0: Stmt_Function[2:1 - 4:1](\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier[2:10 - 2:12](\n            name: foo\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Expression[3:5 - 3:10](\n                expr: Expr_PropertyFetch[3:5 - 3:10](\n                    var: Expr_Variable[3:5 - 3:8](\n                        name: bar\n                    )\n                    name: Expr_Error[4:1 - 3:10](\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nnew T\n-----\nSyntax error, unexpected EOF from 2:6 to 2:6\narray(\n    0: Stmt_Expression(\n        expr: Expr_New(\n            class: Name(\n                name: T\n            )\n            args: array(\n            )\n        )\n    )\n)\n-----\n<?php\nnew\n-----\n!!positions\nSyntax error, unexpected EOF from 2:4 to 2:4\narray(\n    0: Stmt_Expression[2:1 - 2:3](\n        expr: Expr_New[2:1 - 2:3](\n            class: Expr_Error[2:4 - 2:3](\n            )\n            args: array(\n            )\n        )\n    )\n)\n-----\n<?php\n$foo instanceof\n-----\nSyntax error, unexpected EOF from 2:16 to 2:16\narray(\n    0: Stmt_Expression(\n        expr: Expr_Instanceof(\n            expr: Expr_Variable(\n                name: foo\n            )\n            class: Expr_Error(\n            )\n        )\n    )\n)\n-----\n<?php\n$\n-----\nSyntax error, unexpected EOF, expecting T_VARIABLE or '{' or '$' from 2:2 to 2:2\narray(\n    0: Stmt_Expression(\n        expr: Expr_Variable(\n            name: Expr_Error(\n            )\n        )\n    )\n)\n-----\n<?php\nFoo::$\n-----\nSyntax error, unexpected EOF, expecting T_VARIABLE or '{' or '$' from 2:7 to 2:7\narray(\n    0: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Name(\n                name: Foo\n            )\n            name: Expr_Error(\n            )\n        )\n    )\n)\n-----\n<?php\nFoo::\n-----\nSyntax error, unexpected EOF from 2:6 to 2:6\narray(\n    0: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Name(\n                name: Foo\n            )\n            name: Expr_Error(\n            )\n        )\n    )\n)\n-----\n<?php\nnamespace Foo\nuse A\nuse function a\nuse A\\{B}\nconst A = 1\nbreak\nbreak 2\ncontinue\ncontinue 2\nreturn\nreturn 2\necho $a\nunset($a)\nthrow $x\ngoto label\n-----\nSyntax error, unexpected T_USE, expecting ';' or '{' from 3:1 to 3:3\nSyntax error, unexpected T_USE, expecting ';' from 5:1 to 5:3\nSyntax error, unexpected T_CONST, expecting ';' from 6:1 to 6:5\nSyntax error, unexpected T_BREAK, expecting ';' from 7:1 to 7:5\nSyntax error, unexpected T_THROW, expecting ';' from 15:1 to 15:5\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: Foo\n        )\n        stmts: array(\n            0: Stmt_Use(\n                type: TYPE_NORMAL (1)\n                uses: array(\n                    0: UseItem(\n                        type: TYPE_UNKNOWN (0)\n                        name: Name(\n                            name: A\n                        )\n                        alias: null\n                    )\n                )\n            )\n            1: Stmt_Use(\n                type: TYPE_FUNCTION (2)\n                uses: array(\n                    0: UseItem(\n                        type: TYPE_UNKNOWN (0)\n                        name: Name(\n                            name: a\n                        )\n                        alias: null\n                    )\n                )\n            )\n            2: Stmt_GroupUse(\n                type: TYPE_UNKNOWN (0)\n                prefix: Name(\n                    name: A\n                )\n                uses: array(\n                    0: UseItem(\n                        type: TYPE_NORMAL (1)\n                        name: Name(\n                            name: B\n                        )\n                        alias: null\n                    )\n                )\n            )\n            3: Stmt_Const(\n                attrGroups: array(\n                )\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: A\n                        )\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n            4: Stmt_Break(\n                num: null\n            )\n            5: Stmt_Break(\n                num: Scalar_Int(\n                    value: 2\n                )\n            )\n            6: Stmt_Continue(\n                num: null\n            )\n            7: Stmt_Continue(\n                num: Scalar_Int(\n                    value: 2\n                )\n            )\n            8: Stmt_Return(\n                expr: null\n            )\n            9: Stmt_Return(\n                expr: Scalar_Int(\n                    value: 2\n                )\n            )\n            10: Stmt_Echo(\n                exprs: array(\n                    0: Expr_Variable(\n                        name: a\n                    )\n                )\n            )\n            11: Stmt_Unset(\n                vars: array(\n                    0: Expr_Variable(\n                        name: a\n                    )\n                )\n            )\n            12: Stmt_Expression(\n                expr: Expr_Throw(\n                    expr: Expr_Variable(\n                        name: x\n                    )\n                )\n            )\n            13: Stmt_Goto(\n                name: Identifier(\n                    name: label\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\nuse A\\{B, };\nuse function A\\{b, };\nuse A, ;\nconst A = 42, ;\n\nclass X implements Y, {\n    use A, ;\n    use A, {\n        A::b insteadof C, ;\n    }\n    const A = 42, ;\n    public $x, ;\n}\ninterface I extends J, {}\n\nunset($x, );\nisset($x, );\n\ndeclare(a=42, );\n\nglobal $a, ;\nstatic $a, ;\necho $a, ;\n\nfor ($a, ; $b, ; $c, );\n-----\nA trailing comma is not allowed here from 5:6 to 5:6\nA trailing comma is not allowed here from 6:13 to 6:13\nA trailing comma is not allowed here from 8:21 to 8:21\nA trailing comma is not allowed here from 9:10 to 9:10\nA trailing comma is not allowed here from 10:10 to 10:10\nA trailing comma is not allowed here from 11:25 to 11:25\nA trailing comma is not allowed here from 13:17 to 13:17\nA trailing comma is not allowed here from 14:14 to 14:14\nA trailing comma is not allowed here from 16:22 to 16:22\nA trailing comma is not allowed here from 21:13 to 21:13\nA trailing comma is not allowed here from 23:10 to 23:10\nA trailing comma is not allowed here from 24:10 to 24:10\nA trailing comma is not allowed here from 25:8 to 25:8\nA trailing comma is not allowed here from 27:8 to 27:8\nA trailing comma is not allowed here from 27:14 to 27:14\nA trailing comma is not allowed here from 27:20 to 27:20\narray(\n    0: Stmt_GroupUse(\n        type: TYPE_UNKNOWN (0)\n        prefix: Name(\n            name: A\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_NORMAL (1)\n                name: Name(\n                    name: B\n                )\n                alias: null\n            )\n        )\n    )\n    1: Stmt_GroupUse(\n        type: TYPE_FUNCTION (2)\n        prefix: Name(\n            name: A\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: b\n                )\n                alias: null\n            )\n        )\n    )\n    2: Stmt_Use(\n        type: TYPE_NORMAL (1)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: A\n                )\n                alias: null\n            )\n        )\n    )\n    3: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: A\n                )\n                value: Scalar_Int(\n                    value: 42\n                )\n            )\n        )\n    )\n    4: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: X\n        )\n        extends: null\n        implements: array(\n            0: Name(\n                name: Y\n            )\n        )\n        stmts: array(\n            0: Stmt_TraitUse(\n                traits: array(\n                    0: Name(\n                        name: A\n                    )\n                )\n                adaptations: array(\n                )\n            )\n            1: Stmt_TraitUse(\n                traits: array(\n                    0: Name(\n                        name: A\n                    )\n                )\n                adaptations: array(\n                    0: Stmt_TraitUseAdaptation_Precedence(\n                        trait: Name(\n                            name: A\n                        )\n                        method: Identifier(\n                            name: b\n                        )\n                        insteadof: array(\n                            0: Name(\n                                name: C\n                            )\n                        )\n                    )\n                )\n            )\n            2: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: A\n                        )\n                        value: Scalar_Int(\n                            value: 42\n                        )\n                    )\n                )\n            )\n            3: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: x\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n    5: Stmt_Interface(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: I\n        )\n        extends: array(\n            0: Name(\n                name: J\n            )\n        )\n        stmts: array(\n        )\n    )\n    6: Stmt_Unset(\n        vars: array(\n            0: Expr_Variable(\n                name: x\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_Isset(\n            vars: array(\n                0: Expr_Variable(\n                    name: x\n                )\n            )\n        )\n    )\n    8: Stmt_Declare(\n        declares: array(\n            0: DeclareItem(\n                key: Identifier(\n                    name: a\n                )\n                value: Scalar_Int(\n                    value: 42\n                )\n            )\n        )\n        stmts: null\n    )\n    9: Stmt_Global(\n        vars: array(\n            0: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    10: Stmt_Static(\n        vars: array(\n            0: StaticVar(\n                var: Expr_Variable(\n                    name: a\n                )\n                default: null\n            )\n        )\n    )\n    11: Stmt_Echo(\n        exprs: array(\n            0: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    12: Stmt_For(\n        init: array(\n            0: Expr_Variable(\n                name: a\n            )\n        )\n        cond: array(\n            0: Expr_Variable(\n                name: b\n            )\n        )\n        loop: array(\n            0: Expr_Variable(\n                name: c\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php\n\nfoo(Bar::);\n-----\n!!positions\nSyntax error, unexpected ')' from 3:10 to 3:10\narray(\n    0: Stmt_Expression[3:1 - 3:11](\n        expr: Expr_FuncCall[3:1 - 3:10](\n            name: Name[3:1 - 3:3](\n                name: foo\n            )\n            args: array(\n                0: Arg[3:5 - 3:9](\n                    name: null\n                    value: Expr_ClassConstFetch[3:5 - 3:9](\n                        class: Name[3:5 - 3:7](\n                            name: Bar\n                        )\n                        name: Expr_Error[3:10 - 3:9](\n                        )\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\nclass Foo {\n    public $bar1;\n    publi $foo;\n    public $bar;\n}\n-----\nSyntax error, unexpected T_STRING from 5:5 to 5:9\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Foo\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: bar1\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: bar\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\nforeach ($foo) { $bar; }\nforeach ($foo as ) { $bar; }\n-----\nSyntax error, unexpected ')' from 3:14 to 3:14\nSyntax error, unexpected ')' from 4:18 to 4:18\narray(\n    0: Stmt_Foreach(\n        expr: Expr_Variable(\n            name: foo\n        )\n        keyVar: null\n        byRef: false\n        valueVar: Expr_Error(\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: bar\n                )\n            )\n        )\n    )\n    1: Stmt_Foreach(\n        expr: Expr_Variable(\n            name: foo\n        )\n        keyVar: null\n        byRef: false\n        valueVar: Expr_Error(\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: bar\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\nfunction foo(Type) {\n    $foo;\n}\n\nfunction foo(Type1 $foo, Type2) {\n    $bar;\n}\n\nfunction foo(...) {\n    $baz;\n}\n\nfunction foo(&) {\n    $qux;\n}\n\nfunction foo(Bar)\n\nclass Bar {\n    function foo(Baz)\n}\n\nfunction(Foo);\n-----\nSyntax error, unexpected ')', expecting T_VARIABLE from 3:18 to 3:18\nSyntax error, unexpected ')', expecting T_VARIABLE from 7:31 to 7:31\nSyntax error, unexpected ')', expecting T_VARIABLE from 11:17 to 11:17\nSyntax error, unexpected T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG, expecting T_VARIABLE from 15:14 to 15:14\nSyntax error, unexpected ')', expecting T_VARIABLE from 19:17 to 19:17\nSyntax error, unexpected ')', expecting T_VARIABLE from 22:21 to 22:21\nSyntax error, unexpected ')', expecting T_VARIABLE from 25:13 to 25:13\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: Type\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Error(\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: foo\n                )\n            )\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: Type1\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: foo\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: Type2\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Error(\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: bar\n                )\n            )\n        )\n    )\n    2: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: true\n                var: Expr_Error(\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: baz\n                )\n            )\n        )\n    )\n    3: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Error(\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: qux\n                )\n            )\n        )\n    )\n    4: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: Bar\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Error(\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n    5: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Bar\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: 0\n                byRef: false\n                name: Identifier(\n                    name: foo\n                )\n                params: array(\n                    0: Param(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        type: Name(\n                            name: Baz\n                        )\n                        byRef: false\n                        variadic: false\n                        var: Expr_Error(\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_Closure(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: Name(\n                        name: Foo\n                    )\n                    byRef: false\n                    variadic: false\n                    var: Expr_Error(\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            uses: array(\n            )\n            returnType: null\n            stmts: array(\n            )\n        )\n    )\n)\n-----\n<?php\n$array = [\n    $this->value $oopsAnotherValue->get()\n];\n$array = [\n    $value $oopsAnotherValue\n];\n$array = [\n    'key' => $value $oopsAnotherValue\n];\n-----\nSyntax error, unexpected T_VARIABLE, expecting ',' or ']' or ')' from 3:18 to 3:34\nSyntax error, unexpected T_VARIABLE, expecting ',' or ']' or ')' from 6:12 to 6:28\nSyntax error, unexpected T_VARIABLE, expecting ',' or ']' or ')' from 9:21 to 9:37\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: array\n            )\n            expr: Expr_Array(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_PropertyFetch(\n                            var: Expr_Variable(\n                                name: this\n                            )\n                            name: Identifier(\n                                name: value\n                            )\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Expr_MethodCall(\n                            var: Expr_Variable(\n                                name: oopsAnotherValue\n                            )\n                            name: Identifier(\n                                name: get\n                            )\n                            args: array(\n                            )\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: array\n            )\n            expr: Expr_Array(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: value\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: oopsAnotherValue\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: array\n            )\n            expr: Expr_Array(\n                items: array(\n                    0: ArrayItem(\n                        key: Scalar_String(\n                            value: key\n                        )\n                        value: Expr_Variable(\n                            name: value\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: oopsAnotherValue\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nfunction foo() :\n{\n    return $a;\n}\n-----\nSyntax error, unexpected '{' from 3:1 to 3:1\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Return(\n                expr: Expr_Variable(\n                    name: a\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n$a = [\"a \"thing\"];\n-----\nSyntax error, unexpected T_STRING, expecting ',' or ']' or ')' from 2:11 to 2:15\n-----\n<?php\nclass A {\n    /** @var ?string */\n    private $foo\n\n    public function __construct(string $s) {\n        $this->foo = $s;\n    }\n}\nclass B {\n    const X = 1\n}\n-----\nSyntax error, unexpected T_PUBLIC, expecting ';' or '{' from 6:5 to 6:10\nSyntax error, unexpected '}', expecting ';' from 12:1 to 12:1\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PRIVATE (4)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: foo\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n                comments: array(\n                    0: /** @var ?string */\n                )\n            )\n            1: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                byRef: false\n                name: Identifier(\n                    name: __construct\n                )\n                params: array(\n                    0: Param(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        type: Identifier(\n                            name: string\n                        )\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: s\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                )\n                returnType: null\n                stmts: array(\n                    0: Stmt_Expression(\n                        expr: Expr_Assign(\n                            var: Expr_PropertyFetch(\n                                var: Expr_Variable(\n                                    name: this\n                                )\n                                name: Identifier(\n                                    name: foo\n                                )\n                            )\n                            expr: Expr_Variable(\n                                name: s\n                            )\n                        )\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: B\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: X\n                        )\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/alternative_array_syntax.test",
    "content": "Alternative array syntax\n-----\n<?php\n\n$a{'b'};\n$a{'b'}();\n$a->b{'c'};\n$a->b(){'c'};\nA::$b{'c'};\nA{0};\nA::B{0};\nnew $array{'className'};\nnew $a->b{'c'}();\n-----\n!!version=7.4\narray(\n    0: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_Variable(\n                name: a\n            )\n            dim: Scalar_String(\n                value: b\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_ArrayDimFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                dim: Scalar_String(\n                    value: b\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_PropertyFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                name: Identifier(\n                    name: b\n                )\n            )\n            dim: Scalar_String(\n                value: c\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_MethodCall(\n                var: Expr_Variable(\n                    name: a\n                )\n                name: Identifier(\n                    name: b\n                )\n                args: array(\n                )\n            )\n            dim: Scalar_String(\n                value: c\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_StaticPropertyFetch(\n                class: Name(\n                    name: A\n                )\n                name: VarLikeIdentifier(\n                    name: b\n                )\n            )\n            dim: Scalar_String(\n                value: c\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ConstFetch(\n                name: Name(\n                    name: A\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ClassConstFetch(\n                class: Name(\n                    name: A\n                )\n                name: Identifier(\n                    name: B\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_ArrayDimFetch(\n                var: Expr_Variable(\n                    name: array\n                )\n                dim: Scalar_String(\n                    value: className\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_ArrayDimFetch(\n                var: Expr_PropertyFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    name: Identifier(\n                        name: b\n                    )\n                )\n                dim: Scalar_String(\n                    value: c\n                )\n            )\n            args: array(\n            )\n        )\n    )\n)\n-----\n<?php\n\n$a{'b'};\n$a{'b'}();\n$a->b{'c'};\n$a->b(){'c'};\nA::$b{'c'};\nA{0};\nA::B{0};\nnew $array{'className'};\nnew $a->b{'c'}();\n-----\nSyntax error, unexpected '{' from 3:3 to 3:3\nSyntax error, unexpected '{' from 4:3 to 4:3\nSyntax error, unexpected '{' from 5:6 to 5:6\nSyntax error, unexpected '{' from 6:8 to 6:8\nSyntax error, unexpected '{' from 7:6 to 7:6\nSyntax error, unexpected '{' from 8:2 to 8:2\nSyntax error, unexpected '{' from 9:5 to 9:5\nSyntax error, unexpected '{' from 10:11 to 10:11\nSyntax error, unexpected '{' from 11:10 to 11:10\narray(\n    0: Stmt_Expression(\n        expr: Expr_Variable(\n            name: a\n        )\n    )\n    1: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Scalar_String(\n                    value: b\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Variable(\n            name: a\n        )\n    )\n    3: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Scalar_String(\n                    value: b\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_PropertyFetch(\n            var: Expr_Variable(\n                name: a\n            )\n            name: Identifier(\n                name: b\n            )\n        )\n    )\n    5: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Scalar_String(\n                    value: c\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_Variable(\n                name: a\n            )\n            name: Identifier(\n                name: b\n            )\n            args: array(\n            )\n        )\n    )\n    7: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Scalar_String(\n                    value: c\n                )\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Name(\n                name: A\n            )\n            name: VarLikeIdentifier(\n                name: b\n            )\n        )\n    )\n    9: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Scalar_String(\n                    value: c\n                )\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: A\n            )\n        )\n    )\n    11: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Scalar_Int(\n                    value: 0\n                )\n            )\n        )\n    )\n    12: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Name(\n                name: A\n            )\n            name: Identifier(\n                name: B\n            )\n        )\n    )\n    13: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Scalar_Int(\n                    value: 0\n                )\n            )\n        )\n    )\n    14: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_Variable(\n                name: array\n            )\n            args: array(\n            )\n        )\n    )\n    15: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Scalar_String(\n                    value: className\n                )\n            )\n        )\n    )\n    16: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_PropertyFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                name: Identifier(\n                    name: b\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    17: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Scalar_String(\n                    value: c\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/arrayDef.test",
    "content": "Array definitions\n-----\n<?php\n\narray();\narray('a');\narray('a', );\narray('a', 'b');\narray('a', &$b, 'c' => 'd', 'e' => &$f);\n\n// short array syntax\n[];\n[1, 2, 3];\n['a' => 'b'];\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Scalar_String(\n                        value: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Scalar_String(\n                        value: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Scalar_String(\n                        value: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: ArrayItem(\n                    key: null\n                    value: Scalar_String(\n                        value: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Scalar_String(\n                        value: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: ArrayItem(\n                    key: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: true\n                    unpack: false\n                )\n                2: ArrayItem(\n                    key: Scalar_String(\n                        value: c\n                    )\n                    value: Scalar_String(\n                        value: d\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                3: ArrayItem(\n                    key: Scalar_String(\n                        value: e\n                    )\n                    value: Expr_Variable(\n                        name: f\n                    )\n                    byRef: true\n                    unpack: false\n                )\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n            )\n        )\n        comments: array(\n            0: // short array syntax\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Scalar_Int(\n                        value: 1\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: ArrayItem(\n                    key: null\n                    value: Scalar_Int(\n                        value: 2\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                2: ArrayItem(\n                    key: null\n                    value: Scalar_Int(\n                        value: 3\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: Scalar_String(\n                        value: a\n                    )\n                    value: Scalar_String(\n                        value: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/arrayDestructuring.test",
    "content": "Array destructuring\n-----\n<?php\n\n[$a, $b] = [$c, $d];\n[, $a, , , $b, ,] = $foo;\n[, [[$a, , $x]], $b] = $bar;\n['a' => $b, 'b' => $a] = $baz;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: a\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: b\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Array(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: c\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: d\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: null\n                    1: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: a\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    2: null\n                    3: null\n                    4: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: b\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    5: null\n                )\n            )\n            expr: Expr_Variable(\n                name: foo\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: null\n                    1: ArrayItem(\n                        key: null\n                        value: Expr_List(\n                            items: array(\n                                0: ArrayItem(\n                                    key: null\n                                    value: Expr_List(\n                                        items: array(\n                                            0: ArrayItem(\n                                                key: null\n                                                value: Expr_Variable(\n                                                    name: a\n                                                )\n                                                byRef: false\n                                                unpack: false\n                                            )\n                                            1: null\n                                            2: ArrayItem(\n                                                key: null\n                                                value: Expr_Variable(\n                                                    name: x\n                                                )\n                                                byRef: false\n                                                unpack: false\n                                            )\n                                        )\n                                    )\n                                    byRef: false\n                                    unpack: false\n                                )\n                            )\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    2: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: b\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: bar\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: Scalar_String(\n                            value: a\n                        )\n                        value: Expr_Variable(\n                            name: b\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: Scalar_String(\n                            value: b\n                        )\n                        value: Expr_Variable(\n                            name: a\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: baz\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/arrayEmptyElemens.test",
    "content": "Array with empty elements\n-----\n<?php\n\n[1, , 2];\narray(1, , 2);\n-----\n!!positions\nCannot use empty array elements in arrays from 3:5 to 3:5\nCannot use empty array elements in arrays from 4:10 to 4:10\narray(\n    0: Stmt_Expression[3:1 - 3:9](\n        expr: Expr_Array[3:1 - 3:8](\n            items: array(\n                0: ArrayItem[3:2 - 3:2](\n                    key: null\n                    value: Scalar_Int[3:2 - 3:2](\n                        value: 1\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: ArrayItem[3:5 - 3:5](\n                    key: null\n                    value: Expr_Error[3:5 - 3:5](\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                2: ArrayItem[3:7 - 3:7](\n                    key: null\n                    value: Scalar_Int[3:7 - 3:7](\n                        value: 2\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    1: Stmt_Expression[4:1 - 4:14](\n        expr: Expr_Array[4:1 - 4:13](\n            items: array(\n                0: ArrayItem[4:7 - 4:7](\n                    key: null\n                    value: Scalar_Int[4:7 - 4:7](\n                        value: 1\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: ArrayItem[4:10 - 4:10](\n                    key: null\n                    value: Expr_Error[4:10 - 4:10](\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                2: ArrayItem[4:12 - 4:12](\n                    key: null\n                    value: Scalar_Int[4:12 - 4:12](\n                        value: 2\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/arraySpread.test",
    "content": "Spread array\n-----\n<?php\n$array = [1, 2, 3];\n\nfunction getArr() {\n\treturn [4, 5];\n}\n\nfunction arrGen() {\n\tfor($i = 11; $i < 15; $i++) {\n\t\tyield $i;\n\t}\n}\n\n[...[]];\n[...[1, 2, 3]];\n[...$array];\n[...getArr()];\n[...arrGen()];\n[...new ArrayIterator(['a', 'b', 'c'])];\n[0, ...$array, ...getArr(), 6, 7, 8, 9, 10, ...arrGen()];\n[0, ...$array, ...$array, 'end'];\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: array\n            )\n            expr: Expr_Array(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 2\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    2: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 3\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: getArr\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Return(\n                expr: Expr_Array(\n                    items: array(\n                        0: ArrayItem(\n                            key: null\n                            value: Scalar_Int(\n                                value: 4\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                        1: ArrayItem(\n                            key: null\n                            value: Scalar_Int(\n                                value: 5\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n            )\n        )\n    )\n    2: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: arrGen\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_For(\n                init: array(\n                    0: Expr_Assign(\n                        var: Expr_Variable(\n                            name: i\n                        )\n                        expr: Scalar_Int(\n                            value: 11\n                        )\n                    )\n                )\n                cond: array(\n                    0: Expr_BinaryOp_Smaller(\n                        left: Expr_Variable(\n                            name: i\n                        )\n                        right: Scalar_Int(\n                            value: 15\n                        )\n                    )\n                )\n                loop: array(\n                    0: Expr_PostInc(\n                        var: Expr_Variable(\n                            name: i\n                        )\n                    )\n                )\n                stmts: array(\n                    0: Stmt_Expression(\n                        expr: Expr_Yield(\n                            key: null\n                            value: Expr_Variable(\n                                name: i\n                            )\n                        )\n                    )\n                )\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Expr_Array(\n                        items: array(\n                        )\n                    )\n                    byRef: false\n                    unpack: true\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Expr_Array(\n                        items: array(\n                            0: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 1\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            1: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 2\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            2: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 3\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    byRef: false\n                    unpack: true\n                )\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Expr_Variable(\n                        name: array\n                    )\n                    byRef: false\n                    unpack: true\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Expr_FuncCall(\n                        name: Name(\n                            name: getArr\n                        )\n                        args: array(\n                        )\n                    )\n                    byRef: false\n                    unpack: true\n                )\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Expr_FuncCall(\n                        name: Name(\n                            name: arrGen\n                        )\n                        args: array(\n                        )\n                    )\n                    byRef: false\n                    unpack: true\n                )\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Expr_New(\n                        class: Name(\n                            name: ArrayIterator\n                        )\n                        args: array(\n                            0: Arg(\n                                name: null\n                                value: Expr_Array(\n                                    items: array(\n                                        0: ArrayItem(\n                                            key: null\n                                            value: Scalar_String(\n                                                value: a\n                                            )\n                                            byRef: false\n                                            unpack: false\n                                        )\n                                        1: ArrayItem(\n                                            key: null\n                                            value: Scalar_String(\n                                                value: b\n                                            )\n                                            byRef: false\n                                            unpack: false\n                                        )\n                                        2: ArrayItem(\n                                            key: null\n                                            value: Scalar_String(\n                                                value: c\n                                            )\n                                            byRef: false\n                                            unpack: false\n                                        )\n                                    )\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    byRef: false\n                    unpack: true\n                )\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Scalar_Int(\n                        value: 0\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: ArrayItem(\n                    key: null\n                    value: Expr_Variable(\n                        name: array\n                    )\n                    byRef: false\n                    unpack: true\n                )\n                2: ArrayItem(\n                    key: null\n                    value: Expr_FuncCall(\n                        name: Name(\n                            name: getArr\n                        )\n                        args: array(\n                        )\n                    )\n                    byRef: false\n                    unpack: true\n                )\n                3: ArrayItem(\n                    key: null\n                    value: Scalar_Int(\n                        value: 6\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                4: ArrayItem(\n                    key: null\n                    value: Scalar_Int(\n                        value: 7\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                5: ArrayItem(\n                    key: null\n                    value: Scalar_Int(\n                        value: 8\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                6: ArrayItem(\n                    key: null\n                    value: Scalar_Int(\n                        value: 9\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                7: ArrayItem(\n                    key: null\n                    value: Scalar_Int(\n                        value: 10\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                8: ArrayItem(\n                    key: null\n                    value: Expr_FuncCall(\n                        name: Name(\n                            name: arrGen\n                        )\n                        args: array(\n                        )\n                    )\n                    byRef: false\n                    unpack: true\n                )\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Scalar_Int(\n                        value: 0\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: ArrayItem(\n                    key: null\n                    value: Expr_Variable(\n                        name: array\n                    )\n                    byRef: false\n                    unpack: true\n                )\n                2: ArrayItem(\n                    key: null\n                    value: Expr_Variable(\n                        name: array\n                    )\n                    byRef: false\n                    unpack: true\n                )\n                3: ArrayItem(\n                    key: null\n                    value: Scalar_String(\n                        value: end\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/arrow_function.test",
    "content": "Arrow Functions\n-----\n<?php\nfn(bool $a) => $a;\nfn($x = 42) => $x;\nstatic fn(&$x) => $x;\nfn&($x) => $x;\nfn($x, ...$rest) => $rest;\nfn(): int => $x;\n\nfn($a, $b) => $a and $b;\nfn($a, $b) => $a && $b;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_ArrowFunction(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: Identifier(\n                        name: bool\n                    )\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            returnType: null\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_ArrowFunction(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: x\n                    )\n                    default: Scalar_Int(\n                        value: 42\n                    )\n                    hooks: array(\n                    )\n                )\n            )\n            returnType: null\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ArrowFunction(\n            attrGroups: array(\n            )\n            static: true\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: true\n                    variadic: false\n                    var: Expr_Variable(\n                        name: x\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            returnType: null\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_ArrowFunction(\n            attrGroups: array(\n            )\n            static: false\n            byRef: true\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: x\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            returnType: null\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_ArrowFunction(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: x\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n                1: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: true\n                    var: Expr_Variable(\n                        name: rest\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            returnType: null\n            expr: Expr_Variable(\n                name: rest\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_ArrowFunction(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n            )\n            returnType: Identifier(\n                name: int\n            )\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_ArrowFunction(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n                1: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: b\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            returnType: null\n            expr: Expr_BinaryOp_LogicalAnd(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_ArrowFunction(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n                1: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: b\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            returnType: null\n            expr: Expr_BinaryOp_BooleanAnd(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/assign.test",
    "content": "Assignments\n-----\n<?php\n// simple assign\n$a = $b;\n\n// combined assign\n$a &= $b;\n$a |= $b;\n$a ^= $b;\n$a .= $b;\n$a /= $b;\n$a -= $b;\n$a %= $b;\n$a *= $b;\n$a += $b;\n$a <<= $b;\n$a >>= $b;\n$a **= $b;\n$a ??= $b;\n\n// chained assign\n$a = $b *= $c **= $d;\n\n// by ref assign\n$a =& $b;\n\n// list() assign\nlist($a) = $b;\nlist($a, , $b) = $c;\nlist($a, list(, $c), $d) = $e;\n\n// inc/dec\n++$a;\n$a++;\n--$a;\n$a--;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n        comments: array(\n            0: // simple assign\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_AssignOp_BitwiseAnd(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n        comments: array(\n            0: // combined assign\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_AssignOp_BitwiseOr(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_AssignOp_BitwiseXor(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_AssignOp_Concat(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_AssignOp_Div(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_AssignOp_Minus(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_AssignOp_Mod(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_AssignOp_Mul(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_AssignOp_Plus(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_AssignOp_ShiftLeft(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    11: Stmt_Expression(\n        expr: Expr_AssignOp_ShiftRight(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    12: Stmt_Expression(\n        expr: Expr_AssignOp_Pow(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    13: Stmt_Expression(\n        expr: Expr_AssignOp_Coalesce(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    14: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_AssignOp_Mul(\n                var: Expr_Variable(\n                    name: b\n                )\n                expr: Expr_AssignOp_Pow(\n                    var: Expr_Variable(\n                        name: c\n                    )\n                    expr: Expr_Variable(\n                        name: d\n                    )\n                )\n            )\n        )\n        comments: array(\n            0: // chained assign\n        )\n    )\n    15: Stmt_Expression(\n        expr: Expr_AssignRef(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n        comments: array(\n            0: // by ref assign\n        )\n    )\n    16: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: a\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n        comments: array(\n            0: // list() assign\n        )\n    )\n    17: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: a\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: null\n                    2: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: b\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: c\n            )\n        )\n    )\n    18: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: a\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Expr_List(\n                            items: array(\n                                0: null\n                                1: ArrayItem(\n                                    key: null\n                                    value: Expr_Variable(\n                                        name: c\n                                    )\n                                    byRef: false\n                                    unpack: false\n                                )\n                            )\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    2: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: d\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: e\n            )\n        )\n    )\n    19: Stmt_Expression(\n        expr: Expr_PreInc(\n            var: Expr_Variable(\n                name: a\n            )\n        )\n        comments: array(\n            0: // inc/dec\n        )\n    )\n    20: Stmt_Expression(\n        expr: Expr_PostInc(\n            var: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    21: Stmt_Expression(\n        expr: Expr_PreDec(\n            var: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    22: Stmt_Expression(\n        expr: Expr_PostDec(\n            var: Expr_Variable(\n                name: a\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/assignNewByRef.test",
    "content": "Assigning new by reference (PHP 5 only)\n-----\n<?php\n$a =& new B;\n-----\n!!version=5.6\narray(\n    0: Stmt_Expression(\n        expr: Expr_AssignRef(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_New(\n                class: Name(\n                    name: B\n                )\n                args: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n$a =& new B;\n-----\n!!version=7.0\nCannot assign new by reference from 2:1 to 2:11\narray(\n    0: Stmt_Expression(\n        expr: Expr_AssignRef(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_New(\n                class: Name(\n                    name: B\n                )\n                args: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/cast.test",
    "content": "Casts\n-----\n<?php\n(array)   $a;\n(bool)    $a;\n(boolean) $a;\n(real)    $a;\n(double)  $a;\n(float)   $a;\n(int)     $a;\n(integer) $a;\n(object)  $a;\n(string)  $a;\n(unset)   $a;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Cast_Array(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Cast_Bool(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Cast_Bool(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Cast_Double(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Cast_Double(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_Cast_Double(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_Cast_Int(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_Cast_Int(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_Cast_Object(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_Cast_String(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_Cast_Unset(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/clone.test",
    "content": "Clone\n-----\n<?php\n\nclone $a;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Clone(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/closure.test",
    "content": "Closures\n-----\n<?php\nfunction($a) { $a; };\nfunction($a) use($b) {};\nfunction() use($a, &$b) {};\nfunction &($a) {};\nstatic function() {};\nfunction($a) : array {};\nfunction() use($a) : \\Foo\\Bar {};\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Closure(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            uses: array(\n            )\n            returnType: null\n            stmts: array(\n                0: Stmt_Expression(\n                    expr: Expr_Variable(\n                        name: a\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Closure(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            uses: array(\n                0: ClosureUse(\n                    var: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                )\n            )\n            returnType: null\n            stmts: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Closure(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n            )\n            uses: array(\n                0: ClosureUse(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                )\n                1: ClosureUse(\n                    var: Expr_Variable(\n                        name: b\n                    )\n                    byRef: true\n                )\n            )\n            returnType: null\n            stmts: array(\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Closure(\n            attrGroups: array(\n            )\n            static: false\n            byRef: true\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            uses: array(\n            )\n            returnType: null\n            stmts: array(\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Closure(\n            attrGroups: array(\n            )\n            static: true\n            byRef: false\n            params: array(\n            )\n            uses: array(\n            )\n            returnType: null\n            stmts: array(\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_Closure(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            uses: array(\n            )\n            returnType: Identifier(\n                name: array\n            )\n            stmts: array(\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_Closure(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n            )\n            uses: array(\n                0: ClosureUse(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                )\n            )\n            returnType: Name_FullyQualified(\n                name: Foo\\Bar\n            )\n            stmts: array(\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/closure_use_trailing_comma.test",
    "content": "Trailing comma in use list\n-----\n<?php\nfunction() use($a,) {};\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Closure(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n            )\n            uses: array(\n                0: ClosureUse(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                )\n            )\n            returnType: null\n            stmts: array(\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/comparison.test",
    "content": "Comparison operators\n-----\n<?php\n$a < $b;\n$a <= $b;\n$a > $b;\n$a >= $b;\n$a == $b;\n$a === $b;\n$a != $b;\n$a !== $b;\n$a <=> $b;\n$a instanceof B;\n$a instanceof $b;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_BinaryOp_Smaller(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_BinaryOp_SmallerOrEqual(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_BinaryOp_Greater(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_BinaryOp_GreaterOrEqual(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_BinaryOp_Equal(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_BinaryOp_Identical(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_BinaryOp_NotEqual(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_BinaryOp_NotIdentical(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_BinaryOp_Spaceship(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_Instanceof(\n            expr: Expr_Variable(\n                name: a\n            )\n            class: Name(\n                name: B\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_Instanceof(\n            expr: Expr_Variable(\n                name: a\n            )\n            class: Expr_Variable(\n                name: b\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/concatPrecedence.test",
    "content": "Precedence of concatenation in PHP 7 and PHP 8\n-----\n<?php\n1 + 2 . 3 + 4;\n1 << 2 . 3 << 4;\n-----\n!!version=8.0\narray(\n    0: Stmt_Expression(\n        expr: Expr_BinaryOp_Concat(\n            left: Expr_BinaryOp_Plus(\n                left: Scalar_Int(\n                    value: 1\n                )\n                right: Scalar_Int(\n                    value: 2\n                )\n            )\n            right: Expr_BinaryOp_Plus(\n                left: Scalar_Int(\n                    value: 3\n                )\n                right: Scalar_Int(\n                    value: 4\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_BinaryOp_Concat(\n            left: Expr_BinaryOp_ShiftLeft(\n                left: Scalar_Int(\n                    value: 1\n                )\n                right: Scalar_Int(\n                    value: 2\n                )\n            )\n            right: Expr_BinaryOp_ShiftLeft(\n                left: Scalar_Int(\n                    value: 3\n                )\n                right: Scalar_Int(\n                    value: 4\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n1 + 2 . 3 + 4;\n1 << 2 . 3 << 4;\n-----\n!!version=7.4\narray(\n    0: Stmt_Expression(\n        expr: Expr_BinaryOp_Plus(\n            left: Expr_BinaryOp_Concat(\n                left: Expr_BinaryOp_Plus(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 2\n                    )\n                )\n                right: Scalar_Int(\n                    value: 3\n                )\n            )\n            right: Scalar_Int(\n                value: 4\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_BinaryOp_ShiftLeft(\n            left: Expr_BinaryOp_ShiftLeft(\n                left: Scalar_Int(\n                    value: 1\n                )\n                right: Expr_BinaryOp_Concat(\n                    left: Scalar_Int(\n                        value: 2\n                    )\n                    right: Scalar_Int(\n                        value: 3\n                    )\n                )\n            )\n            right: Scalar_Int(\n                value: 4\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/constant_expr.test",
    "content": "Expressions in static scalar context\n-----\n<?php\n\nconst T_1 = 1 << 1;\nconst T_2 = 1 / 2;\nconst T_3 = 1.5 + 1.5;\nconst T_4 = \"foo\" . \"bar\";\nconst T_5 = (1.5 + 1.5) * 2;\nconst T_6 = \"foo\" . 2 . 3 . 4.0;\nconst T_7 = __LINE__;\nconst T_8 = <<<ENDOFSTRING\nThis is a test string\nENDOFSTRING;\nconst T_9 = ~-1;\nconst T_10 = (-1?:1) + (0?2:3);\nconst T_11 = 1 && 0;\nconst T_12 = 1 and 1;\nconst T_13 = 0 || 0;\nconst T_14 = 1 or 0;\nconst T_15 = 1 xor 1;\nconst T_16 = 1 xor 0;\nconst T_17 = 1 < 0;\nconst T_18 = 0 <= 0;\nconst T_19 = 1 > 0;\nconst T_20 = 1 >= 0;\nconst T_21 = 1 === 1;\nconst T_22 = 1 !== 1;\nconst T_23 = 0 != \"0\";\nconst T_24 = 1 == \"1\";\nconst T_25 = 1 + 2 * 3;\nconst T_26 = \"1\" + 2 + \"3\";\nconst T_27 = 2 ** 3;\nconst T_28 = [1, 2, 3][1];\nconst T_29 = 12 - 13;\nconst T_30 = 12 ^ 13;\nconst T_31 = 12 & 13;\nconst T_32 = 12 | 13;\nconst T_33 = 12 % 3;\nconst T_34 = 100 >> 4;\nconst T_35 = !false;\n-----\narray(\n    0: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_1\n                )\n                value: Expr_BinaryOp_ShiftLeft(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 1\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_2\n                )\n                value: Expr_BinaryOp_Div(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 2\n                    )\n                )\n            )\n        )\n    )\n    2: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_3\n                )\n                value: Expr_BinaryOp_Plus(\n                    left: Scalar_Float(\n                        value: 1.5\n                    )\n                    right: Scalar_Float(\n                        value: 1.5\n                    )\n                )\n            )\n        )\n    )\n    3: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_4\n                )\n                value: Expr_BinaryOp_Concat(\n                    left: Scalar_String(\n                        value: foo\n                    )\n                    right: Scalar_String(\n                        value: bar\n                    )\n                )\n            )\n        )\n    )\n    4: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_5\n                )\n                value: Expr_BinaryOp_Mul(\n                    left: Expr_BinaryOp_Plus(\n                        left: Scalar_Float(\n                            value: 1.5\n                        )\n                        right: Scalar_Float(\n                            value: 1.5\n                        )\n                    )\n                    right: Scalar_Int(\n                        value: 2\n                    )\n                )\n            )\n        )\n    )\n    5: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_6\n                )\n                value: Expr_BinaryOp_Concat(\n                    left: Expr_BinaryOp_Concat(\n                        left: Expr_BinaryOp_Concat(\n                            left: Scalar_String(\n                                value: foo\n                            )\n                            right: Scalar_Int(\n                                value: 2\n                            )\n                        )\n                        right: Scalar_Int(\n                            value: 3\n                        )\n                    )\n                    right: Scalar_Float(\n                        value: 4\n                    )\n                )\n            )\n        )\n    )\n    6: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_7\n                )\n                value: Scalar_MagicConst_Line(\n                )\n            )\n        )\n    )\n    7: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_8\n                )\n                value: Scalar_String(\n                    value: This is a test string\n                )\n            )\n        )\n    )\n    8: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_9\n                )\n                value: Expr_BitwiseNot(\n                    expr: Expr_UnaryMinus(\n                        expr: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n        )\n    )\n    9: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_10\n                )\n                value: Expr_BinaryOp_Plus(\n                    left: Expr_Ternary(\n                        cond: Expr_UnaryMinus(\n                            expr: Scalar_Int(\n                                value: 1\n                            )\n                        )\n                        if: null\n                        else: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                    right: Expr_Ternary(\n                        cond: Scalar_Int(\n                            value: 0\n                        )\n                        if: Scalar_Int(\n                            value: 2\n                        )\n                        else: Scalar_Int(\n                            value: 3\n                        )\n                    )\n                )\n            )\n        )\n    )\n    10: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_11\n                )\n                value: Expr_BinaryOp_BooleanAnd(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    11: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_12\n                )\n                value: Expr_BinaryOp_LogicalAnd(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 1\n                    )\n                )\n            )\n        )\n    )\n    12: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_13\n                )\n                value: Expr_BinaryOp_BooleanOr(\n                    left: Scalar_Int(\n                        value: 0\n                    )\n                    right: Scalar_Int(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    13: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_14\n                )\n                value: Expr_BinaryOp_LogicalOr(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    14: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_15\n                )\n                value: Expr_BinaryOp_LogicalXor(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 1\n                    )\n                )\n            )\n        )\n    )\n    15: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_16\n                )\n                value: Expr_BinaryOp_LogicalXor(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    16: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_17\n                )\n                value: Expr_BinaryOp_Smaller(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    17: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_18\n                )\n                value: Expr_BinaryOp_SmallerOrEqual(\n                    left: Scalar_Int(\n                        value: 0\n                    )\n                    right: Scalar_Int(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    18: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_19\n                )\n                value: Expr_BinaryOp_Greater(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    19: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_20\n                )\n                value: Expr_BinaryOp_GreaterOrEqual(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    20: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_21\n                )\n                value: Expr_BinaryOp_Identical(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 1\n                    )\n                )\n            )\n        )\n    )\n    21: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_22\n                )\n                value: Expr_BinaryOp_NotIdentical(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 1\n                    )\n                )\n            )\n        )\n    )\n    22: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_23\n                )\n                value: Expr_BinaryOp_NotEqual(\n                    left: Scalar_Int(\n                        value: 0\n                    )\n                    right: Scalar_String(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    23: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_24\n                )\n                value: Expr_BinaryOp_Equal(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_String(\n                        value: 1\n                    )\n                )\n            )\n        )\n    )\n    24: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_25\n                )\n                value: Expr_BinaryOp_Plus(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Expr_BinaryOp_Mul(\n                        left: Scalar_Int(\n                            value: 2\n                        )\n                        right: Scalar_Int(\n                            value: 3\n                        )\n                    )\n                )\n            )\n        )\n    )\n    25: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_26\n                )\n                value: Expr_BinaryOp_Plus(\n                    left: Expr_BinaryOp_Plus(\n                        left: Scalar_String(\n                            value: 1\n                        )\n                        right: Scalar_Int(\n                            value: 2\n                        )\n                    )\n                    right: Scalar_String(\n                        value: 3\n                    )\n                )\n            )\n        )\n    )\n    26: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_27\n                )\n                value: Expr_BinaryOp_Pow(\n                    left: Scalar_Int(\n                        value: 2\n                    )\n                    right: Scalar_Int(\n                        value: 3\n                    )\n                )\n            )\n        )\n    )\n    27: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_28\n                )\n                value: Expr_ArrayDimFetch(\n                    var: Expr_Array(\n                        items: array(\n                            0: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 1\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            1: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 2\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            2: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 3\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    dim: Scalar_Int(\n                        value: 1\n                    )\n                )\n            )\n        )\n    )\n    28: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_29\n                )\n                value: Expr_BinaryOp_Minus(\n                    left: Scalar_Int(\n                        value: 12\n                    )\n                    right: Scalar_Int(\n                        value: 13\n                    )\n                )\n            )\n        )\n    )\n    29: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_30\n                )\n                value: Expr_BinaryOp_BitwiseXor(\n                    left: Scalar_Int(\n                        value: 12\n                    )\n                    right: Scalar_Int(\n                        value: 13\n                    )\n                )\n            )\n        )\n    )\n    30: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_31\n                )\n                value: Expr_BinaryOp_BitwiseAnd(\n                    left: Scalar_Int(\n                        value: 12\n                    )\n                    right: Scalar_Int(\n                        value: 13\n                    )\n                )\n            )\n        )\n    )\n    31: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_32\n                )\n                value: Expr_BinaryOp_BitwiseOr(\n                    left: Scalar_Int(\n                        value: 12\n                    )\n                    right: Scalar_Int(\n                        value: 13\n                    )\n                )\n            )\n        )\n    )\n    32: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_33\n                )\n                value: Expr_BinaryOp_Mod(\n                    left: Scalar_Int(\n                        value: 12\n                    )\n                    right: Scalar_Int(\n                        value: 3\n                    )\n                )\n            )\n        )\n    )\n    33: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_34\n                )\n                value: Expr_BinaryOp_ShiftRight(\n                    left: Scalar_Int(\n                        value: 100\n                    )\n                    right: Scalar_Int(\n                        value: 4\n                    )\n                )\n            )\n        )\n    )\n    34: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: T_35\n                )\n                value: Expr_BooleanNot(\n                    expr: Expr_ConstFetch(\n                        name: Name(\n                            name: false\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/dynamicClassConst.test",
    "content": "Dynamic class constant fetch\n-----\n<?php\nFoo::{bar()};\n$foo::{bar()};\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Name(\n                name: Foo\n            )\n            name: Expr_FuncCall(\n                name: Name(\n                    name: bar\n                )\n                args: array(\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Expr_Variable(\n                name: foo\n            )\n            name: Expr_FuncCall(\n                name: Name(\n                    name: bar\n                )\n                args: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/errorSuppress.test",
    "content": "Error suppression\n-----\n<?php\n@$a;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_ErrorSuppress(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/exit.test",
    "content": "Exit\n-----\n<?php\nexit;\nexit();\nexit('Die!');\ndie;\ndie();\ndie('Exit!');\n\nexit(status: 42);\nexit(...$args);\nexit($a, $b);\n\\exit($a);\nexit(...);\nDIE($a, $b);\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Exit(\n            expr: null\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Exit(\n            expr: null\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Exit(\n            expr: Scalar_String(\n                value: Die!\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Exit(\n            expr: null\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Exit(\n            expr: null\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_Exit(\n            expr: Scalar_String(\n                value: Exit!\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: exit\n            )\n            args: array(\n                0: Arg(\n                    name: Identifier(\n                        name: status\n                    )\n                    value: Scalar_Int(\n                        value: 42\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: exit\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: args\n                    )\n                    byRef: false\n                    unpack: true\n                )\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: exit\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name_FullyQualified(\n                name: exit\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: exit\n            )\n            args: array(\n                0: VariadicPlaceholder(\n                )\n            )\n        )\n    )\n    11: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: DIE\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/exprInIsset.test",
    "content": "Expressions in isset()\n-----\n<?php\n// This is legal.\nisset(($a), (($b)));\n// This is illegal, but not a syntax error.\nisset(1 + 1);\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Isset(\n            vars: array(\n                0: Expr_Variable(\n                    name: a\n                )\n                1: Expr_Variable(\n                    name: b\n                )\n            )\n        )\n        comments: array(\n            0: // This is legal.\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Isset(\n            vars: array(\n                0: Expr_BinaryOp_Plus(\n                    left: Scalar_Int(\n                        value: 1\n                    )\n                    right: Scalar_Int(\n                        value: 1\n                    )\n                )\n            )\n        )\n        comments: array(\n            0: // This is illegal, but not a syntax error.\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/exprInList.test",
    "content": "Expressions in list()\n-----\n<?php\n\n// This is legal.\nlist(($a), ((($b)))) = $x;\n// This is illegal, but not a syntax error.\nlist(1 + 1) = $x;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: a\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: b\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n        comments: array(\n            0: // This is legal.\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_BinaryOp_Plus(\n                            left: Scalar_Int(\n                                value: 1\n                            )\n                            right: Scalar_Int(\n                                value: 1\n                            )\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n        comments: array(\n            0: // This is illegal, but not a syntax error.\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/fetchAndCall/args.test",
    "content": "Arguments\n-----\n<?php\n\nf();\nf($a);\nf($a, $b);\nf(&$a);\nf($a, ...$b);\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: f\n            )\n            args: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: f\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: f\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: f\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: true\n                    unpack: false\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: f\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: true\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/fetchAndCall/constFetch.test",
    "content": "Constant fetches\n-----\n<?php\n\nA;\nA::B;\nA::class;\n$a::B;\n$a::class;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: A\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Name(\n                name: A\n            )\n            name: Identifier(\n                name: B\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Name(\n                name: A\n            )\n            name: Identifier(\n                name: class\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Expr_Variable(\n                name: a\n            )\n            name: Identifier(\n                name: B\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Expr_Variable(\n                name: a\n            )\n            name: Identifier(\n                name: class\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/fetchAndCall/constantDeref.test",
    "content": "Array/string dereferencing\n-----\n<?php\n\n\"abc\"[2];\n\"abc\"[2][0][0];\n\n[1, 2, 3][2];\n[1, 2, 3][2][0][0];\n\narray(1, 2, 3)[2];\narray(1, 2, 3)[2][0][0];\n\nFOO[0];\nFoo::BAR[1];\n$foo::BAR[2][1][0];\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Scalar_String(\n                value: abc\n            )\n            dim: Scalar_Int(\n                value: 2\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ArrayDimFetch(\n                var: Expr_ArrayDimFetch(\n                    var: Scalar_String(\n                        value: abc\n                    )\n                    dim: Scalar_Int(\n                        value: 2\n                    )\n                )\n                dim: Scalar_Int(\n                    value: 0\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_Array(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 2\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    2: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 3\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            dim: Scalar_Int(\n                value: 2\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ArrayDimFetch(\n                var: Expr_ArrayDimFetch(\n                    var: Expr_Array(\n                        items: array(\n                            0: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 1\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            1: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 2\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            2: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 3\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    dim: Scalar_Int(\n                        value: 2\n                    )\n                )\n                dim: Scalar_Int(\n                    value: 0\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_Array(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 2\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    2: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 3\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            dim: Scalar_Int(\n                value: 2\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ArrayDimFetch(\n                var: Expr_ArrayDimFetch(\n                    var: Expr_Array(\n                        items: array(\n                            0: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 1\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            1: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 2\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            2: ArrayItem(\n                                key: null\n                                value: Scalar_Int(\n                                    value: 3\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    dim: Scalar_Int(\n                        value: 2\n                    )\n                )\n                dim: Scalar_Int(\n                    value: 0\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ConstFetch(\n                name: Name(\n                    name: FOO\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ClassConstFetch(\n                class: Name(\n                    name: Foo\n                )\n                name: Identifier(\n                    name: BAR\n                )\n            )\n            dim: Scalar_Int(\n                value: 1\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ArrayDimFetch(\n                var: Expr_ArrayDimFetch(\n                    var: Expr_ClassConstFetch(\n                        class: Expr_Variable(\n                            name: foo\n                        )\n                        name: Identifier(\n                            name: BAR\n                        )\n                    )\n                    dim: Scalar_Int(\n                        value: 2\n                    )\n                )\n                dim: Scalar_Int(\n                    value: 1\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/fetchAndCall/funcCall.test",
    "content": "Function calls\n-----\n<?php\n\n// function name variations\na();\n$a();\n${'a'}();\n$$a();\n$$$a();\n$a['b']();\n$a->b['c']();\n\n// array dereferencing\na()['b'];\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: a\n            )\n            args: array(\n            )\n        )\n        comments: array(\n            0: // function name variations\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_Variable(\n                name: a\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_Variable(\n                name: Scalar_String(\n                    value: a\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_Variable(\n                name: Expr_Variable(\n                    name: a\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_Variable(\n                name: Expr_Variable(\n                    name: Expr_Variable(\n                        name: a\n                    )\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_ArrayDimFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                dim: Scalar_String(\n                    value: b\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_ArrayDimFetch(\n                var: Expr_PropertyFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    name: Identifier(\n                        name: b\n                    )\n                )\n                dim: Scalar_String(\n                    value: c\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_FuncCall(\n                name: Name(\n                    name: a\n                )\n                args: array(\n                )\n            )\n            dim: Scalar_String(\n                value: b\n            )\n        )\n        comments: array(\n            0: // array dereferencing\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/fetchAndCall/namedArgs.test",
    "content": "Named arguments\n-----\n<?php\nfoo(a: $b, c: $d);\nbar(class: 0);\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: foo\n            )\n            args: array(\n                0: Arg(\n                    name: Identifier(\n                        name: a\n                    )\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: Identifier(\n                        name: c\n                    )\n                    value: Expr_Variable(\n                        name: d\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: bar\n            )\n            args: array(\n                0: Arg(\n                    name: Identifier(\n                        name: class\n                    )\n                    value: Scalar_Int(\n                        value: 0\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/fetchAndCall/newDeref.test",
    "content": "New expression dereferencing\n-----\n<?php\n\n(new A)->b;\n(new A)->b();\n(new A)['b'];\n(new A)['b']['c'];\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_PropertyFetch(\n            var: Expr_New(\n                class: Name(\n                    name: A\n                )\n                args: array(\n                )\n            )\n            name: Identifier(\n                name: b\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_New(\n                class: Name(\n                    name: A\n                )\n                args: array(\n                )\n            )\n            name: Identifier(\n                name: b\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_New(\n                class: Name(\n                    name: A\n                )\n                args: array(\n                )\n            )\n            dim: Scalar_String(\n                value: b\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ArrayDimFetch(\n                var: Expr_New(\n                    class: Name(\n                        name: A\n                    )\n                    args: array(\n                    )\n                )\n                dim: Scalar_String(\n                    value: b\n                )\n            )\n            dim: Scalar_String(\n                value: c\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/fetchAndCall/objectAccess.test",
    "content": "Object access\n-----\n<?php\n\n// property fetch variations\n$a->b;\n$a->b['c'];\n\n// method call variations\n$a->b();\n$a->{'b'}();\n$a->$b();\n$a->$b['c']();\n\n// array dereferencing\n$a->b()['c'];\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_PropertyFetch(\n            var: Expr_Variable(\n                name: a\n            )\n            name: Identifier(\n                name: b\n            )\n        )\n        comments: array(\n            0: // property fetch variations\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_PropertyFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                name: Identifier(\n                    name: b\n                )\n            )\n            dim: Scalar_String(\n                value: c\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_Variable(\n                name: a\n            )\n            name: Identifier(\n                name: b\n            )\n            args: array(\n            )\n        )\n        comments: array(\n            0: // method call variations\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_Variable(\n                name: a\n            )\n            name: Scalar_String(\n                value: b\n            )\n            args: array(\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_Variable(\n                name: a\n            )\n            name: Expr_Variable(\n                name: b\n            )\n            args: array(\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_ArrayDimFetch(\n                var: Expr_PropertyFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    name: Expr_Variable(\n                        name: b\n                    )\n                )\n                dim: Scalar_String(\n                    value: c\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_MethodCall(\n                var: Expr_Variable(\n                    name: a\n                )\n                name: Identifier(\n                    name: b\n                )\n                args: array(\n                )\n            )\n            dim: Scalar_String(\n                value: c\n            )\n        )\n        comments: array(\n            0: // array dereferencing\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/fetchAndCall/simpleArrayAccess.test",
    "content": "Simple array access\n-----\n<?php\n\n$a['b'];\n$a['b']['c'];\n$a[] = $b;\n${$a}['b'];\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_Variable(\n                name: a\n            )\n            dim: Scalar_String(\n                value: b\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ArrayDimFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                dim: Scalar_String(\n                    value: b\n                )\n            )\n            dim: Scalar_String(\n                value: c\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_ArrayDimFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                dim: null\n            )\n            expr: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_Variable(\n                name: Expr_Variable(\n                    name: a\n                )\n            )\n            dim: Scalar_String(\n                value: b\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/fetchAndCall/staticCall.test",
    "content": "Static calls\n-----\n<?php\n\n// method name variations\nA::b();\nA::{'b'}();\nA::$b();\nA::$b['c']();\nA::$b['c']['d']();\n\n// array dereferencing\nA::b()['c'];\n\n// class name variations\nstatic::b();\n$a::b();\n${'a'}::b();\n$a['b']::c();\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Name(\n                name: A\n            )\n            name: Identifier(\n                name: b\n            )\n            args: array(\n            )\n        )\n        comments: array(\n            0: // method name variations\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Name(\n                name: A\n            )\n            name: Scalar_String(\n                value: b\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Name(\n                name: A\n            )\n            name: Expr_Variable(\n                name: b\n            )\n            args: array(\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_ArrayDimFetch(\n                var: Expr_StaticPropertyFetch(\n                    class: Name(\n                        name: A\n                    )\n                    name: VarLikeIdentifier(\n                        name: b\n                    )\n                )\n                dim: Scalar_String(\n                    value: c\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_ArrayDimFetch(\n                var: Expr_ArrayDimFetch(\n                    var: Expr_StaticPropertyFetch(\n                        class: Name(\n                            name: A\n                        )\n                        name: VarLikeIdentifier(\n                            name: b\n                        )\n                    )\n                    dim: Scalar_String(\n                        value: c\n                    )\n                )\n                dim: Scalar_String(\n                    value: d\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_StaticCall(\n                class: Name(\n                    name: A\n                )\n                name: Identifier(\n                    name: b\n                )\n                args: array(\n                )\n            )\n            dim: Scalar_String(\n                value: c\n            )\n        )\n        comments: array(\n            0: // array dereferencing\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Name(\n                name: static\n            )\n            name: Identifier(\n                name: b\n            )\n            args: array(\n            )\n        )\n        comments: array(\n            0: // class name variations\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Expr_Variable(\n                name: a\n            )\n            name: Identifier(\n                name: b\n            )\n            args: array(\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Expr_Variable(\n                name: Scalar_String(\n                    value: a\n                )\n            )\n            name: Identifier(\n                name: b\n            )\n            args: array(\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Expr_ArrayDimFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                dim: Scalar_String(\n                    value: b\n                )\n            )\n            name: Identifier(\n                name: c\n            )\n            args: array(\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/fetchAndCall/staticPropertyFetch.test",
    "content": "Static property fetches\n-----\n<?php\n\n// property name variations\nA::$b;\nA::$$b;\nA::${'b'};\n\n// array access\nA::$b['c'];\n\n// class name variations can be found in staticCall.test\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Name(\n                name: A\n            )\n            name: VarLikeIdentifier(\n                name: b\n            )\n        )\n        comments: array(\n            0: // property name variations\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Name(\n                name: A\n            )\n            name: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Name(\n                name: A\n            )\n            name: Scalar_String(\n                value: b\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_StaticPropertyFetch(\n                class: Name(\n                    name: A\n                )\n                name: VarLikeIdentifier(\n                    name: b\n                )\n            )\n            dim: Scalar_String(\n                value: c\n            )\n        )\n        comments: array(\n            0: // array access\n        )\n    )\n    4: Stmt_Nop(\n        comments: array(\n            0: // class name variations can be found in staticCall.test\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/firstClassCallables.test",
    "content": "First-class callables\n-----\n<?php\nfoo(...);\n$this->foo(...);\nA::foo(...);\n\n// These are invalid, but accepted on the parser level.\nnew Foo(...);\n$this?->foo(...);\n\n#[Foo(...)]\nfunction foo() {}\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: foo\n            )\n            args: array(\n                0: VariadicPlaceholder(\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_Variable(\n                name: this\n            )\n            name: Identifier(\n                name: foo\n            )\n            args: array(\n                0: VariadicPlaceholder(\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Name(\n                name: A\n            )\n            name: Identifier(\n                name: foo\n            )\n            args: array(\n                0: VariadicPlaceholder(\n                )\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_New(\n            class: Name(\n                name: Foo\n            )\n            args: array(\n                0: VariadicPlaceholder(\n                )\n            )\n        )\n        comments: array(\n            0: // These are invalid, but accepted on the parser level.\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_NullsafeMethodCall(\n            var: Expr_Variable(\n                name: this\n            )\n            name: Identifier(\n                name: foo\n            )\n            args: array(\n                0: VariadicPlaceholder(\n                )\n            )\n        )\n    )\n    5: Stmt_Function(\n        attrGroups: array(\n            0: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: Foo\n                        )\n                        args: array(\n                            0: VariadicPlaceholder(\n                            )\n                        )\n                    )\n                )\n            )\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/includeAndEval.test",
    "content": "Include and eval\n-----\n<?php\ninclude 'A.php';\ninclude_once 'A.php';\nrequire 'A.php';\nrequire_once 'A.php';\neval('A');\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Include(\n            expr: Scalar_String(\n                value: A.php\n            )\n            type: TYPE_INCLUDE (1)\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Include(\n            expr: Scalar_String(\n                value: A.php\n            )\n            type: TYPE_INCLUDE_ONCE (2)\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Include(\n            expr: Scalar_String(\n                value: A.php\n            )\n            type: TYPE_REQUIRE (3)\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Include(\n            expr: Scalar_String(\n                value: A.php\n            )\n            type: TYPE_REQUIRE_ONCE (4)\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Eval(\n            expr: Scalar_String(\n                value: A\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/issetAndEmpty.test",
    "content": "isset() and empty()\n-----\n<?php\nisset($a);\nisset($a, $b, $c);\n\nempty($a);\nempty(foo());\nempty(array(1, 2, 3));\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Isset(\n            vars: array(\n                0: Expr_Variable(\n                    name: a\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Isset(\n            vars: array(\n                0: Expr_Variable(\n                    name: a\n                )\n                1: Expr_Variable(\n                    name: b\n                )\n                2: Expr_Variable(\n                    name: c\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Empty(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Empty(\n            expr: Expr_FuncCall(\n                name: Name(\n                    name: foo\n                )\n                args: array(\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Empty(\n            expr: Expr_Array(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 2\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    2: ArrayItem(\n                        key: null\n                        value: Scalar_Int(\n                            value: 3\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/keywordsInNamespacedName.test",
    "content": "Keywords in namespaced name\n-----\n<?php\nnamespace fn;\nnamespace fn\\use;\nnamespace self;\nnamespace parent;\nnamespace static;\nfn\\use();\n\\fn\\use();\nnamespace\\fn\\use();\nprivate\\protected\\public\\static\\abstract\\final();\n-----\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: fn\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Namespace(\n        name: Name(\n            name: fn\\use\n        )\n        stmts: array(\n        )\n    )\n    2: Stmt_Namespace(\n        name: Name(\n            name: self\n        )\n        stmts: array(\n        )\n    )\n    3: Stmt_Namespace(\n        name: Name(\n            name: parent\n        )\n        stmts: array(\n        )\n    )\n    4: Stmt_Namespace(\n        name: Name(\n            name: static\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name(\n                        name: fn\\use\n                    )\n                    args: array(\n                    )\n                )\n            )\n            1: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name_FullyQualified(\n                        name: fn\\use\n                    )\n                    args: array(\n                    )\n                )\n            )\n            2: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name_Relative(\n                        name: fn\\use\n                    )\n                    args: array(\n                    )\n                )\n            )\n            3: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name(\n                        name: private\\protected\\public\\static\\abstract\\final\n                    )\n                    args: array(\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/listReferences.test",
    "content": "List reference assignments (PHP 7.3)\n-----\n<?php\n\nlist(&$v) = $x;\nlist('k' => &$v) = $x;\n[&$v] = $x;\n['k' => &$v] = $x;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: v\n                        )\n                        byRef: true\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: Scalar_String(\n                            value: k\n                        )\n                        value: Expr_Variable(\n                            name: v\n                        )\n                        byRef: true\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: v\n                        )\n                        byRef: true\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: Scalar_String(\n                            value: k\n                        )\n                        value: Expr_Variable(\n                            name: v\n                        )\n                        byRef: true\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/listWithKeys.test",
    "content": "List destructing with keys\n-----\n<?php\n\nlist('a' => $b) = ['a' => 'b'];\nlist('a' => list($b => $c), 'd' => $e) = $x;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: Scalar_String(\n                            value: a\n                        )\n                        value: Expr_Variable(\n                            name: b\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Array(\n                items: array(\n                    0: ArrayItem(\n                        key: Scalar_String(\n                            value: a\n                        )\n                        value: Scalar_String(\n                            value: b\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: Scalar_String(\n                            value: a\n                        )\n                        value: Expr_List(\n                            items: array(\n                                0: ArrayItem(\n                                    key: Expr_Variable(\n                                        name: b\n                                    )\n                                    value: Expr_Variable(\n                                        name: c\n                                    )\n                                    byRef: false\n                                    unpack: false\n                                )\n                            )\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: Scalar_String(\n                            value: d\n                        )\n                        value: Expr_Variable(\n                            name: e\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/logic.test",
    "content": "Logical operators\n-----\n<?php\n\n// boolean ops\n$a && $b;\n$a || $b;\n!$a;\n!!$a;\n\n// logical ops\n$a and $b;\n$a or $b;\n$a xor $b;\n\n// precedence\n$a && $b || $c && $d;\n$a && ($b || $c) && $d;\n\n$a = $b || $c;\n$a = $b or $c;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_BinaryOp_BooleanAnd(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n        comments: array(\n            0: // boolean ops\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_BinaryOp_BooleanOr(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_BooleanNot(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_BooleanNot(\n            expr: Expr_BooleanNot(\n                expr: Expr_Variable(\n                    name: a\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_BinaryOp_LogicalAnd(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n        comments: array(\n            0: // logical ops\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_BinaryOp_LogicalOr(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_BinaryOp_LogicalXor(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_BinaryOp_BooleanOr(\n            left: Expr_BinaryOp_BooleanAnd(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n            right: Expr_BinaryOp_BooleanAnd(\n                left: Expr_Variable(\n                    name: c\n                )\n                right: Expr_Variable(\n                    name: d\n                )\n            )\n        )\n        comments: array(\n            0: // precedence\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_BinaryOp_BooleanAnd(\n            left: Expr_BinaryOp_BooleanAnd(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_BinaryOp_BooleanOr(\n                    left: Expr_Variable(\n                        name: b\n                    )\n                    right: Expr_Variable(\n                        name: c\n                    )\n                )\n            )\n            right: Expr_Variable(\n                name: d\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_BinaryOp_BooleanOr(\n                left: Expr_Variable(\n                    name: b\n                )\n                right: Expr_Variable(\n                    name: c\n                )\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_BinaryOp_LogicalOr(\n            left: Expr_Assign(\n                var: Expr_Variable(\n                    name: a\n                )\n                expr: Expr_Variable(\n                    name: b\n                )\n            )\n            right: Expr_Variable(\n                name: c\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/match.test",
    "content": "Match\n-----\n<?php\n\necho match (1) {\n    0 => 'Foo',\n    1 => 'Bar',\n};\n-----\narray(\n    0: Stmt_Echo(\n        exprs: array(\n            0: Expr_Match(\n                cond: Scalar_Int(\n                    value: 1\n                )\n                arms: array(\n                    0: MatchArm(\n                        conds: array(\n                            0: Scalar_Int(\n                                value: 0\n                            )\n                        )\n                        body: Scalar_String(\n                            value: Foo\n                        )\n                    )\n                    1: MatchArm(\n                        conds: array(\n                            0: Scalar_Int(\n                                value: 1\n                            )\n                        )\n                        body: Scalar_String(\n                            value: Bar\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\n$value = match (1) {\n    // list of conditions\n    0, 1 => 'Foo',\n};\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: value\n            )\n            expr: Expr_Match(\n                cond: Scalar_Int(\n                    value: 1\n                )\n                arms: array(\n                    0: MatchArm(\n                        conds: array(\n                            0: Scalar_Int(\n                                value: 0\n                            )\n                            1: Scalar_Int(\n                                value: 1\n                            )\n                        )\n                        body: Scalar_String(\n                            value: Foo\n                        )\n                        comments: array(\n                            0: // list of conditions\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\n$result = match ($operator) {\n    BinaryOperator::ADD => $lhs + $rhs,\n};\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: result\n            )\n            expr: Expr_Match(\n                cond: Expr_Variable(\n                    name: operator\n                )\n                arms: array(\n                    0: MatchArm(\n                        conds: array(\n                            0: Expr_ClassConstFetch(\n                                class: Name(\n                                    name: BinaryOperator\n                                )\n                                name: Identifier(\n                                    name: ADD\n                                )\n                            )\n                        )\n                        body: Expr_BinaryOp_Plus(\n                            left: Expr_Variable(\n                                name: lhs\n                            )\n                            right: Expr_Variable(\n                                name: rhs\n                            )\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\n$value = match ($char) {\n    1 => '1',\n    default => 'default'\n};\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: value\n            )\n            expr: Expr_Match(\n                cond: Expr_Variable(\n                    name: char\n                )\n                arms: array(\n                    0: MatchArm(\n                        conds: array(\n                            0: Scalar_Int(\n                                value: 1\n                            )\n                        )\n                        body: Scalar_String(\n                            value: 1\n                        )\n                    )\n                    1: MatchArm(\n                        conds: null\n                        body: Scalar_String(\n                            value: default\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\n$value = match (1) {\n    0, 1, => 'Foo',\n    default, => 'Bar',\n};\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: value\n            )\n            expr: Expr_Match(\n                cond: Scalar_Int(\n                    value: 1\n                )\n                arms: array(\n                    0: MatchArm(\n                        conds: array(\n                            0: Scalar_Int(\n                                value: 0\n                            )\n                            1: Scalar_Int(\n                                value: 1\n                            )\n                        )\n                        body: Scalar_String(\n                            value: Foo\n                        )\n                    )\n                    1: MatchArm(\n                        conds: null\n                        body: Scalar_String(\n                            value: Bar\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/math.test",
    "content": "Mathematical operators\n-----\n<?php\n\n// unary ops\n~$a;\n+$a;\n-$a;\n\n// binary ops\n$a & $b;\n$a | $b;\n$a ^ $b;\n$a . $b;\n$a / $b;\n$a - $b;\n$a % $b;\n$a * $b;\n$a + $b;\n$a << $b;\n$a >> $b;\n$a ** $b;\n\n// associativity\n$a * $b * $c;\n$a * ($b * $c);\n\n// precedence\n$a + $b * $c;\n($a + $b) * $c;\n\n// pow is special\n$a ** $b ** $c;\n($a ** $b) ** $c;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_BitwiseNot(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n        comments: array(\n            0: // unary ops\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_UnaryPlus(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_UnaryMinus(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_BinaryOp_BitwiseAnd(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n        comments: array(\n            0: // binary ops\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_BinaryOp_BitwiseOr(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_BinaryOp_BitwiseXor(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_BinaryOp_Concat(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_BinaryOp_Div(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_BinaryOp_Minus(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_BinaryOp_Mod(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_BinaryOp_Mul(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    11: Stmt_Expression(\n        expr: Expr_BinaryOp_Plus(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    12: Stmt_Expression(\n        expr: Expr_BinaryOp_ShiftLeft(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    13: Stmt_Expression(\n        expr: Expr_BinaryOp_ShiftRight(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    14: Stmt_Expression(\n        expr: Expr_BinaryOp_Pow(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    15: Stmt_Expression(\n        expr: Expr_BinaryOp_Mul(\n            left: Expr_BinaryOp_Mul(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n            right: Expr_Variable(\n                name: c\n            )\n        )\n        comments: array(\n            0: // associativity\n        )\n    )\n    16: Stmt_Expression(\n        expr: Expr_BinaryOp_Mul(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_BinaryOp_Mul(\n                left: Expr_Variable(\n                    name: b\n                )\n                right: Expr_Variable(\n                    name: c\n                )\n            )\n        )\n    )\n    17: Stmt_Expression(\n        expr: Expr_BinaryOp_Plus(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_BinaryOp_Mul(\n                left: Expr_Variable(\n                    name: b\n                )\n                right: Expr_Variable(\n                    name: c\n                )\n            )\n        )\n        comments: array(\n            0: // precedence\n        )\n    )\n    18: Stmt_Expression(\n        expr: Expr_BinaryOp_Mul(\n            left: Expr_BinaryOp_Plus(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n            right: Expr_Variable(\n                name: c\n            )\n        )\n    )\n    19: Stmt_Expression(\n        expr: Expr_BinaryOp_Pow(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_BinaryOp_Pow(\n                left: Expr_Variable(\n                    name: b\n                )\n                right: Expr_Variable(\n                    name: c\n                )\n            )\n        )\n        comments: array(\n            0: // pow is special\n        )\n    )\n    20: Stmt_Expression(\n        expr: Expr_BinaryOp_Pow(\n            left: Expr_BinaryOp_Pow(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n            right: Expr_Variable(\n                name: c\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/new.test",
    "content": "New\n-----\n<?php\n\nnew A;\nnew A($b);\n\n// class name variations\nnew $a();\nnew $a['b']();\nnew A::$b();\n// DNCR object access\nnew $a->b();\nnew $a->b->c();\nnew $a->b['c']();\n\n// test regression introduces by new dereferencing syntax\n(new A);\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_New(\n            class: Name(\n                name: A\n            )\n            args: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_New(\n            class: Name(\n                name: A\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_Variable(\n                name: a\n            )\n            args: array(\n            )\n        )\n        comments: array(\n            0: // class name variations\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_ArrayDimFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                dim: Scalar_String(\n                    value: b\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_StaticPropertyFetch(\n                class: Name(\n                    name: A\n                )\n                name: VarLikeIdentifier(\n                    name: b\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_PropertyFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                name: Identifier(\n                    name: b\n                )\n            )\n            args: array(\n            )\n        )\n        comments: array(\n            0: // DNCR object access\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_PropertyFetch(\n                var: Expr_PropertyFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    name: Identifier(\n                        name: b\n                    )\n                )\n                name: Identifier(\n                    name: c\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_ArrayDimFetch(\n                var: Expr_PropertyFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    name: Identifier(\n                        name: b\n                    )\n                )\n                dim: Scalar_String(\n                    value: c\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_New(\n            class: Name(\n                name: A\n            )\n            args: array(\n            )\n        )\n        comments: array(\n            0: // test regression introduces by new dereferencing syntax\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/newDeref.test",
    "content": "New dereference without parentheses\n-----\n<?php\n\nnew A()->foo;\nnew A()->foo();\nnew A()::FOO;\nnew A()::foo();\nnew A()::$foo;\nnew A()[0];\nnew A()();\n\nnew class {}->foo;\nnew class {}->foo();\nnew class {}::FOO;\nnew class {}::foo();\nnew class {}::$foo;\nnew class {}[0];\nnew class {}();\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_PropertyFetch(\n            var: Expr_New(\n                class: Name(\n                    name: A\n                )\n                args: array(\n                )\n            )\n            name: Identifier(\n                name: foo\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_New(\n                class: Name(\n                    name: A\n                )\n                args: array(\n                )\n            )\n            name: Identifier(\n                name: foo\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Expr_New(\n                class: Name(\n                    name: A\n                )\n                args: array(\n                )\n            )\n            name: Identifier(\n                name: FOO\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Expr_New(\n                class: Name(\n                    name: A\n                )\n                args: array(\n                )\n            )\n            name: Identifier(\n                name: foo\n            )\n            args: array(\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Expr_New(\n                class: Name(\n                    name: A\n                )\n                args: array(\n                )\n            )\n            name: VarLikeIdentifier(\n                name: foo\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_New(\n                class: Name(\n                    name: A\n                )\n                args: array(\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_New(\n                class: Name(\n                    name: A\n                )\n                args: array(\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_PropertyFetch(\n            var: Expr_New(\n                class: Stmt_Class(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    name: null\n                    extends: null\n                    implements: array(\n                    )\n                    stmts: array(\n                    )\n                )\n                args: array(\n                )\n            )\n            name: Identifier(\n                name: foo\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_New(\n                class: Stmt_Class(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    name: null\n                    extends: null\n                    implements: array(\n                    )\n                    stmts: array(\n                    )\n                )\n                args: array(\n                )\n            )\n            name: Identifier(\n                name: foo\n            )\n            args: array(\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Expr_New(\n                class: Stmt_Class(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    name: null\n                    extends: null\n                    implements: array(\n                    )\n                    stmts: array(\n                    )\n                )\n                args: array(\n                )\n            )\n            name: Identifier(\n                name: FOO\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Expr_New(\n                class: Stmt_Class(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    name: null\n                    extends: null\n                    implements: array(\n                    )\n                    stmts: array(\n                    )\n                )\n                args: array(\n                )\n            )\n            name: Identifier(\n                name: foo\n            )\n            args: array(\n            )\n        )\n    )\n    11: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Expr_New(\n                class: Stmt_Class(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    name: null\n                    extends: null\n                    implements: array(\n                    )\n                    stmts: array(\n                    )\n                )\n                args: array(\n                )\n            )\n            name: VarLikeIdentifier(\n                name: foo\n            )\n        )\n    )\n    12: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_New(\n                class: Stmt_Class(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    name: null\n                    extends: null\n                    implements: array(\n                    )\n                    stmts: array(\n                    )\n                )\n                args: array(\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    13: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_New(\n                class: Stmt_Class(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    name: null\n                    extends: null\n                    implements: array(\n                    )\n                    stmts: array(\n                    )\n                )\n                args: array(\n                )\n            )\n            args: array(\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/newWithoutClass.test",
    "content": "New without a class\n-----\n<?php\nnew;\n-----\nSyntax error, unexpected ';' from 2:4 to 2:4\narray(\n    0: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_Error(\n            )\n            args: array(\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/nullsafe.test",
    "content": "Nullsafe operator\n-----\n<?php\n\n$a?->b;\n$a?->b($c);\nnew $a?->b;\n\"{$a?->b}\";\n\"$a?->b\";\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_NullsafePropertyFetch(\n            var: Expr_Variable(\n                name: a\n            )\n            name: Identifier(\n                name: b\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_NullsafeMethodCall(\n            var: Expr_Variable(\n                name: a\n            )\n            name: Identifier(\n                name: b\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: c\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_NullsafePropertyFetch(\n                var: Expr_Variable(\n                    name: a\n                )\n                name: Identifier(\n                    name: b\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_NullsafePropertyFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    name: Identifier(\n                        name: b\n                    )\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_NullsafePropertyFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    name: Identifier(\n                        name: b\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/pipe.test",
    "content": "Pipe operator\n-----\n<?php\n$a |> $b |> $c;\n$a . $b |> $c . $d;\n$a |> $b == $c;\n$c == $a |> $b;\n$a |> (fn($x) => $x) |> (fn($y) => $y);\n$a |> fn($x) => $x |> fn($y) => $y;\n-----\nArrow functions on the right hand side of |> must be parenthesized from 7:23 to 7:34\nArrow functions on the right hand side of |> must be parenthesized from 7:7 to 7:34\narray(\n    0: Stmt_Expression(\n        expr: Expr_BinaryOp_Pipe(\n            left: Expr_BinaryOp_Pipe(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n            right: Expr_Variable(\n                name: c\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_BinaryOp_Pipe(\n            left: Expr_BinaryOp_Concat(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n            right: Expr_BinaryOp_Concat(\n                left: Expr_Variable(\n                    name: c\n                )\n                right: Expr_Variable(\n                    name: d\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_BinaryOp_Equal(\n            left: Expr_BinaryOp_Pipe(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n            right: Expr_Variable(\n                name: c\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_BinaryOp_Equal(\n            left: Expr_Variable(\n                name: c\n            )\n            right: Expr_BinaryOp_Pipe(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_BinaryOp_Pipe(\n            left: Expr_BinaryOp_Pipe(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_ArrowFunction(\n                    attrGroups: array(\n                    )\n                    static: false\n                    byRef: false\n                    params: array(\n                        0: Param(\n                            attrGroups: array(\n                            )\n                            flags: 0\n                            type: null\n                            byRef: false\n                            variadic: false\n                            var: Expr_Variable(\n                                name: x\n                            )\n                            default: null\n                            hooks: array(\n                            )\n                        )\n                    )\n                    returnType: null\n                    expr: Expr_Variable(\n                        name: x\n                    )\n                )\n            )\n            right: Expr_ArrowFunction(\n                attrGroups: array(\n                )\n                static: false\n                byRef: false\n                params: array(\n                    0: Param(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: y\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                )\n                returnType: null\n                expr: Expr_Variable(\n                    name: y\n                )\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_BinaryOp_Pipe(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_ArrowFunction(\n                attrGroups: array(\n                )\n                static: false\n                byRef: false\n                params: array(\n                    0: Param(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: x\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                )\n                returnType: null\n                expr: Expr_BinaryOp_Pipe(\n                    left: Expr_Variable(\n                        name: x\n                    )\n                    right: Expr_ArrowFunction(\n                        attrGroups: array(\n                        )\n                        static: false\n                        byRef: false\n                        params: array(\n                            0: Param(\n                                attrGroups: array(\n                                )\n                                flags: 0\n                                type: null\n                                byRef: false\n                                variadic: false\n                                var: Expr_Variable(\n                                    name: y\n                                )\n                                default: null\n                                hooks: array(\n                                )\n                            )\n                        )\n                        returnType: null\n                        expr: Expr_Variable(\n                            name: y\n                        )\n                    )\n                )\n            )\n        )\n    )\n)"
  },
  {
    "path": "test/code/parser/expr/print.test",
    "content": "Print\n-----\n<?php\nprint $a;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Print(\n            expr: Expr_Variable(\n                name: a\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/shellExec.test",
    "content": "Shell execution\n-----\n<?php\n``;\n`test`;\n`test $A`;\n`test \\``;\n`test \\\"`;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_ShellExec(\n            parts: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_ShellExec(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: test\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ShellExec(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: test\n                )\n                1: Expr_Variable(\n                    name: A\n                )\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_ShellExec(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: test `\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_ShellExec(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: test \\\"\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/ternaryAndCoalesce.test",
    "content": "Ternary operator\n-----\n<?php\n\n// ternary\n$a ? $b : $c;\n$a ?: $c;\n\n// precedence\n$a ? $b : $c ? $d : $e;\n$a ? $b : ($c ? $d : $e);\n\n// null coalesce\n$a ?? $b;\n$a ?? $b ?? $c;\n$a ?? $b ? $c : $d;\n$a && $b ?? $c;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Ternary(\n            cond: Expr_Variable(\n                name: a\n            )\n            if: Expr_Variable(\n                name: b\n            )\n            else: Expr_Variable(\n                name: c\n            )\n        )\n        comments: array(\n            0: // ternary\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Ternary(\n            cond: Expr_Variable(\n                name: a\n            )\n            if: null\n            else: Expr_Variable(\n                name: c\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Ternary(\n            cond: Expr_Ternary(\n                cond: Expr_Variable(\n                    name: a\n                )\n                if: Expr_Variable(\n                    name: b\n                )\n                else: Expr_Variable(\n                    name: c\n                )\n            )\n            if: Expr_Variable(\n                name: d\n            )\n            else: Expr_Variable(\n                name: e\n            )\n        )\n        comments: array(\n            0: // precedence\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Ternary(\n            cond: Expr_Variable(\n                name: a\n            )\n            if: Expr_Variable(\n                name: b\n            )\n            else: Expr_Ternary(\n                cond: Expr_Variable(\n                    name: c\n                )\n                if: Expr_Variable(\n                    name: d\n                )\n                else: Expr_Variable(\n                    name: e\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_BinaryOp_Coalesce(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Variable(\n                name: b\n            )\n        )\n        comments: array(\n            0: // null coalesce\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_BinaryOp_Coalesce(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_BinaryOp_Coalesce(\n                left: Expr_Variable(\n                    name: b\n                )\n                right: Expr_Variable(\n                    name: c\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_Ternary(\n            cond: Expr_BinaryOp_Coalesce(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n            if: Expr_Variable(\n                name: c\n            )\n            else: Expr_Variable(\n                name: d\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_BinaryOp_Coalesce(\n            left: Expr_BinaryOp_BooleanAnd(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n            right: Expr_Variable(\n                name: c\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/throw.test",
    "content": "Throw expression\n-----\n<?php\ntest(throw $x);\n$a ?? throw new Exception;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: test\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Throw(\n                        expr: Expr_Variable(\n                            name: x\n                        )\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_BinaryOp_Coalesce(\n            left: Expr_Variable(\n                name: a\n            )\n            right: Expr_Throw(\n                expr: Expr_New(\n                    class: Name(\n                        name: Exception\n                    )\n                    args: array(\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/trailingCommas.test",
    "content": "PHP 7.3 trailing comma additions\n-----\n<?php\n\nfoo($a, $b, );\n$foo->bar($a, $b, );\nFoo::bar($a, $b, );\nnew Foo($a, $b, );\nunset($a, $b, );\nisset($a, $b, );\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: foo\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_Variable(\n                name: foo\n            )\n            name: Identifier(\n                name: bar\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Name(\n                name: Foo\n            )\n            name: Identifier(\n                name: bar\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_New(\n            class: Name(\n                name: Foo\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    4: Stmt_Unset(\n        vars: array(\n            0: Expr_Variable(\n                name: a\n            )\n            1: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_Isset(\n            vars: array(\n                0: Expr_Variable(\n                    name: a\n                )\n                1: Expr_Variable(\n                    name: b\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/uvs/constDeref.test",
    "content": "Dereferencing of constants\n-----\n<?php\n\nA->length;\nA->length();\nA[0];\nA[0][1][2];\n\nA::B[0];\nA::B[0][1][2];\nA::B->length;\nA::B->length();\nA::B::C;\nA::B::$c;\nA::B::c();\n\n__FUNCTION__[0];\n__FUNCTION__->length;\n__FUNCIONT__->length();\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_PropertyFetch(\n            var: Expr_ConstFetch(\n                name: Name(\n                    name: A\n                )\n            )\n            name: Identifier(\n                name: length\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_ConstFetch(\n                name: Name(\n                    name: A\n                )\n            )\n            name: Identifier(\n                name: length\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ConstFetch(\n                name: Name(\n                    name: A\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ArrayDimFetch(\n                var: Expr_ArrayDimFetch(\n                    var: Expr_ConstFetch(\n                        name: Name(\n                            name: A\n                        )\n                    )\n                    dim: Scalar_Int(\n                        value: 0\n                    )\n                )\n                dim: Scalar_Int(\n                    value: 1\n                )\n            )\n            dim: Scalar_Int(\n                value: 2\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ClassConstFetch(\n                class: Name(\n                    name: A\n                )\n                name: Identifier(\n                    name: B\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_ArrayDimFetch(\n                var: Expr_ArrayDimFetch(\n                    var: Expr_ClassConstFetch(\n                        class: Name(\n                            name: A\n                        )\n                        name: Identifier(\n                            name: B\n                        )\n                    )\n                    dim: Scalar_Int(\n                        value: 0\n                    )\n                )\n                dim: Scalar_Int(\n                    value: 1\n                )\n            )\n            dim: Scalar_Int(\n                value: 2\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_PropertyFetch(\n            var: Expr_ClassConstFetch(\n                class: Name(\n                    name: A\n                )\n                name: Identifier(\n                    name: B\n                )\n            )\n            name: Identifier(\n                name: length\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_ClassConstFetch(\n                class: Name(\n                    name: A\n                )\n                name: Identifier(\n                    name: B\n                )\n            )\n            name: Identifier(\n                name: length\n            )\n            args: array(\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Expr_ClassConstFetch(\n                class: Name(\n                    name: A\n                )\n                name: Identifier(\n                    name: B\n                )\n            )\n            name: Identifier(\n                name: C\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Expr_ClassConstFetch(\n                class: Name(\n                    name: A\n                )\n                name: Identifier(\n                    name: B\n                )\n            )\n            name: VarLikeIdentifier(\n                name: c\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Expr_ClassConstFetch(\n                class: Name(\n                    name: A\n                )\n                name: Identifier(\n                    name: B\n                )\n            )\n            name: Identifier(\n                name: c\n            )\n            args: array(\n            )\n        )\n    )\n    11: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Scalar_MagicConst_Function(\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    12: Stmt_Expression(\n        expr: Expr_PropertyFetch(\n            var: Scalar_MagicConst_Function(\n            )\n            name: Identifier(\n                name: length\n            )\n        )\n    )\n    13: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_ConstFetch(\n                name: Name(\n                    name: __FUNCIONT__\n                )\n            )\n            name: Identifier(\n                name: length\n            )\n            args: array(\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/uvs/globalNonSimpleVarError.test",
    "content": "Non-simple variables are forbidden in PHP 7\n-----\n<?php\nglobal $$foo->bar;\n-----\nSyntax error, unexpected T_OBJECT_OPERATOR, expecting ';' from 2:13 to 2:14\narray(\n    0: Stmt_Global(\n        vars: array(\n            0: Expr_Variable(\n                name: Expr_Variable(\n                    name: foo\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: bar\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/uvs/indirectCall.test",
    "content": "UVS indirect calls\n-----\n<?php\n\nid('var_dump')(1);\nid('id')('var_dump')(2);\nid()()('var_dump')(4);\nid(['udef', 'id'])[1]()('var_dump')(5);\n(function($x) { return $x; })('id')('var_dump')(8);\n($f = function($x = null) use (&$f) {\n    return $x ?: $f;\n})()()()('var_dump')(9);\n[$obj, 'id']()('id')($id)('var_dump')(10);\n'id'()('id')('var_dump')(12);\n('i' . 'd')()('var_dump')(13);\n'\\id'('var_dump')(14);\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_FuncCall(\n                name: Name(\n                    name: id\n                )\n                args: array(\n                    0: Arg(\n                        name: null\n                        value: Scalar_String(\n                            value: var_dump\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 1\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_FuncCall(\n                name: Expr_FuncCall(\n                    name: Name(\n                        name: id\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Scalar_String(\n                                value: id\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n                args: array(\n                    0: Arg(\n                        name: null\n                        value: Scalar_String(\n                            value: var_dump\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 2\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_FuncCall(\n                name: Expr_FuncCall(\n                    name: Expr_FuncCall(\n                        name: Name(\n                            name: id\n                        )\n                        args: array(\n                        )\n                    )\n                    args: array(\n                    )\n                )\n                args: array(\n                    0: Arg(\n                        name: null\n                        value: Scalar_String(\n                            value: var_dump\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 4\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_FuncCall(\n                name: Expr_FuncCall(\n                    name: Expr_ArrayDimFetch(\n                        var: Expr_FuncCall(\n                            name: Name(\n                                name: id\n                            )\n                            args: array(\n                                0: Arg(\n                                    name: null\n                                    value: Expr_Array(\n                                        items: array(\n                                            0: ArrayItem(\n                                                key: null\n                                                value: Scalar_String(\n                                                    value: udef\n                                                )\n                                                byRef: false\n                                                unpack: false\n                                            )\n                                            1: ArrayItem(\n                                                key: null\n                                                value: Scalar_String(\n                                                    value: id\n                                                )\n                                                byRef: false\n                                                unpack: false\n                                            )\n                                        )\n                                    )\n                                    byRef: false\n                                    unpack: false\n                                )\n                            )\n                        )\n                        dim: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                    args: array(\n                    )\n                )\n                args: array(\n                    0: Arg(\n                        name: null\n                        value: Scalar_String(\n                            value: var_dump\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 5\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_FuncCall(\n                name: Expr_FuncCall(\n                    name: Expr_Closure(\n                        attrGroups: array(\n                        )\n                        static: false\n                        byRef: false\n                        params: array(\n                            0: Param(\n                                attrGroups: array(\n                                )\n                                flags: 0\n                                type: null\n                                byRef: false\n                                variadic: false\n                                var: Expr_Variable(\n                                    name: x\n                                )\n                                default: null\n                                hooks: array(\n                                )\n                            )\n                        )\n                        uses: array(\n                        )\n                        returnType: null\n                        stmts: array(\n                            0: Stmt_Return(\n                                expr: Expr_Variable(\n                                    name: x\n                                )\n                            )\n                        )\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Scalar_String(\n                                value: id\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n                args: array(\n                    0: Arg(\n                        name: null\n                        value: Scalar_String(\n                            value: var_dump\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 8\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_FuncCall(\n                name: Expr_FuncCall(\n                    name: Expr_FuncCall(\n                        name: Expr_FuncCall(\n                            name: Expr_Assign(\n                                var: Expr_Variable(\n                                    name: f\n                                )\n                                expr: Expr_Closure(\n                                    attrGroups: array(\n                                    )\n                                    static: false\n                                    byRef: false\n                                    params: array(\n                                        0: Param(\n                                            attrGroups: array(\n                                            )\n                                            flags: 0\n                                            type: null\n                                            byRef: false\n                                            variadic: false\n                                            var: Expr_Variable(\n                                                name: x\n                                            )\n                                            default: Expr_ConstFetch(\n                                                name: Name(\n                                                    name: null\n                                                )\n                                            )\n                                            hooks: array(\n                                            )\n                                        )\n                                    )\n                                    uses: array(\n                                        0: ClosureUse(\n                                            var: Expr_Variable(\n                                                name: f\n                                            )\n                                            byRef: true\n                                        )\n                                    )\n                                    returnType: null\n                                    stmts: array(\n                                        0: Stmt_Return(\n                                            expr: Expr_Ternary(\n                                                cond: Expr_Variable(\n                                                    name: x\n                                                )\n                                                if: null\n                                                else: Expr_Variable(\n                                                    name: f\n                                                )\n                                            )\n                                        )\n                                    )\n                                )\n                            )\n                            args: array(\n                            )\n                        )\n                        args: array(\n                        )\n                    )\n                    args: array(\n                    )\n                )\n                args: array(\n                    0: Arg(\n                        name: null\n                        value: Scalar_String(\n                            value: var_dump\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 9\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_FuncCall(\n                name: Expr_FuncCall(\n                    name: Expr_FuncCall(\n                        name: Expr_FuncCall(\n                            name: Expr_Array(\n                                items: array(\n                                    0: ArrayItem(\n                                        key: null\n                                        value: Expr_Variable(\n                                            name: obj\n                                        )\n                                        byRef: false\n                                        unpack: false\n                                    )\n                                    1: ArrayItem(\n                                        key: null\n                                        value: Scalar_String(\n                                            value: id\n                                        )\n                                        byRef: false\n                                        unpack: false\n                                    )\n                                )\n                            )\n                            args: array(\n                            )\n                        )\n                        args: array(\n                            0: Arg(\n                                name: null\n                                value: Scalar_String(\n                                    value: id\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Expr_Variable(\n                                name: id\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n                args: array(\n                    0: Arg(\n                        name: null\n                        value: Scalar_String(\n                            value: var_dump\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 10\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_FuncCall(\n                name: Expr_FuncCall(\n                    name: Expr_FuncCall(\n                        name: Scalar_String(\n                            value: id\n                        )\n                        args: array(\n                        )\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Scalar_String(\n                                value: id\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n                args: array(\n                    0: Arg(\n                        name: null\n                        value: Scalar_String(\n                            value: var_dump\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 12\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_FuncCall(\n                name: Expr_FuncCall(\n                    name: Expr_BinaryOp_Concat(\n                        left: Scalar_String(\n                            value: i\n                        )\n                        right: Scalar_String(\n                            value: d\n                        )\n                    )\n                    args: array(\n                    )\n                )\n                args: array(\n                    0: Arg(\n                        name: null\n                        value: Scalar_String(\n                            value: var_dump\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 13\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_FuncCall(\n                name: Scalar_String(\n                    value: \\id\n                )\n                args: array(\n                    0: Arg(\n                        name: null\n                        value: Scalar_String(\n                            value: var_dump\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 14\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/uvs/isset.test",
    "content": "UVS isset() on temporaries\n-----\n<?php\n\nisset(([0, 1] + [])[0]);\nisset(['a' => 'b']->a);\nisset(\"str\"->a);\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Isset(\n            vars: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_BinaryOp_Plus(\n                        left: Expr_Array(\n                            items: array(\n                                0: ArrayItem(\n                                    key: null\n                                    value: Scalar_Int(\n                                        value: 0\n                                    )\n                                    byRef: false\n                                    unpack: false\n                                )\n                                1: ArrayItem(\n                                    key: null\n                                    value: Scalar_Int(\n                                        value: 1\n                                    )\n                                    byRef: false\n                                    unpack: false\n                                )\n                            )\n                        )\n                        right: Expr_Array(\n                            items: array(\n                            )\n                        )\n                    )\n                    dim: Scalar_Int(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Isset(\n            vars: array(\n                0: Expr_PropertyFetch(\n                    var: Expr_Array(\n                        items: array(\n                            0: ArrayItem(\n                                key: Scalar_String(\n                                    value: a\n                                )\n                                value: Scalar_String(\n                                    value: b\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    name: Identifier(\n                        name: a\n                    )\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Isset(\n            vars: array(\n                0: Expr_PropertyFetch(\n                    var: Scalar_String(\n                        value: str\n                    )\n                    name: Identifier(\n                        name: a\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/uvs/misc.test",
    "content": "Uniform variable syntax in PHP 7 (misc)\n-----\n<?php\n\n\"string\"->length();\n\"foo$bar\"[0];\n\"foo$bar\"->length();\n(clone $obj)->b[0](1);\n[0, 1][0] = 1;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Scalar_String(\n                value: string\n            )\n            name: Identifier(\n                name: length\n            )\n            args: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Scalar_InterpolatedString(\n                parts: array(\n                    0: InterpolatedStringPart(\n                        value: foo\n                    )\n                    1: Expr_Variable(\n                        name: bar\n                    )\n                )\n            )\n            dim: Scalar_Int(\n                value: 0\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Scalar_InterpolatedString(\n                parts: array(\n                    0: InterpolatedStringPart(\n                        value: foo\n                    )\n                    1: Expr_Variable(\n                        name: bar\n                    )\n                )\n            )\n            name: Identifier(\n                name: length\n            )\n            args: array(\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Expr_ArrayDimFetch(\n                var: Expr_PropertyFetch(\n                    var: Expr_Clone(\n                        expr: Expr_Variable(\n                            name: obj\n                        )\n                    )\n                    name: Identifier(\n                        name: b\n                    )\n                )\n                dim: Scalar_Int(\n                    value: 0\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Scalar_Int(\n                        value: 1\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_ArrayDimFetch(\n                var: Expr_Array(\n                    items: array(\n                        0: ArrayItem(\n                            key: null\n                            value: Scalar_Int(\n                                value: 0\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                        1: ArrayItem(\n                            key: null\n                            value: Scalar_Int(\n                                value: 1\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n                dim: Scalar_Int(\n                    value: 0\n                )\n            )\n            expr: Scalar_Int(\n                value: 1\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/uvs/new.test",
    "content": "UVS new expressions\n-----\n<?php\nnew $className;\nnew $array['className'];\nnew $obj->className;\nnew Test::$className;\nnew $test::$className;\nnew $weird[0]->foo::$className;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_Variable(\n                name: className\n            )\n            args: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_ArrayDimFetch(\n                var: Expr_Variable(\n                    name: array\n                )\n                dim: Scalar_String(\n                    value: className\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_PropertyFetch(\n                var: Expr_Variable(\n                    name: obj\n                )\n                name: Identifier(\n                    name: className\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_StaticPropertyFetch(\n                class: Name(\n                    name: Test\n                )\n                name: VarLikeIdentifier(\n                    name: className\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_StaticPropertyFetch(\n                class: Expr_Variable(\n                    name: test\n                )\n                name: VarLikeIdentifier(\n                    name: className\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_StaticPropertyFetch(\n                class: Expr_PropertyFetch(\n                    var: Expr_ArrayDimFetch(\n                        var: Expr_Variable(\n                            name: weird\n                        )\n                        dim: Scalar_Int(\n                            value: 0\n                        )\n                    )\n                    name: Identifier(\n                        name: foo\n                    )\n                )\n                name: VarLikeIdentifier(\n                    name: className\n                )\n            )\n            args: array(\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/uvs/newInstanceofExpr.test",
    "content": "Arbitrary expressions in new and instanceof\n-----\n<?php\n\nnew ('Foo' . $bar);\nnew ('Foo' . $bar)($arg);\n$obj instanceof ('Foo' . $bar);\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_BinaryOp_Concat(\n                left: Scalar_String(\n                    value: Foo\n                )\n                right: Expr_Variable(\n                    name: bar\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_New(\n            class: Expr_BinaryOp_Concat(\n                left: Scalar_String(\n                    value: Foo\n                )\n                right: Expr_Variable(\n                    name: bar\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: arg\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Instanceof(\n            expr: Expr_Variable(\n                name: obj\n            )\n            class: Expr_BinaryOp_Concat(\n                left: Scalar_String(\n                    value: Foo\n                )\n                right: Expr_Variable(\n                    name: bar\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/uvs/staticProperty.test",
    "content": "UVS static access\n-----\n<?php\nA::$b;\n$A::$b;\n'A'::$b;\n('A' . '')::$b;\n'A'[0]::$b;\nA::$$b;\nA::$$c[1];\nA::$A::$b;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Name(\n                name: A\n            )\n            name: VarLikeIdentifier(\n                name: b\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Expr_Variable(\n                name: A\n            )\n            name: VarLikeIdentifier(\n                name: b\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Scalar_String(\n                value: A\n            )\n            name: VarLikeIdentifier(\n                name: b\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Expr_BinaryOp_Concat(\n                left: Scalar_String(\n                    value: A\n                )\n                right: Scalar_String(\n                    value:\n                )\n            )\n            name: VarLikeIdentifier(\n                name: b\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Expr_ArrayDimFetch(\n                var: Scalar_String(\n                    value: A\n                )\n                dim: Scalar_Int(\n                    value: 0\n                )\n            )\n            name: VarLikeIdentifier(\n                name: b\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Name(\n                name: A\n            )\n            name: Expr_Variable(\n                name: b\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_StaticPropertyFetch(\n                class: Name(\n                    name: A\n                )\n                name: Expr_Variable(\n                    name: c\n                )\n            )\n            dim: Scalar_Int(\n                value: 1\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_StaticPropertyFetch(\n            class: Expr_StaticPropertyFetch(\n                class: Name(\n                    name: A\n                )\n                name: VarLikeIdentifier(\n                    name: A\n                )\n            )\n            name: VarLikeIdentifier(\n                name: b\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/varVarPos.test",
    "content": "Variable variable positions\n-----\n<?php\n$$$x;\n-----\n!!positions\narray(\n    0: Stmt_Expression[2:1 - 2:5](\n        expr: Expr_Variable[2:1 - 2:4](\n            name: Expr_Variable[2:2 - 2:4](\n                name: Expr_Variable[2:3 - 2:4](\n                    name: x\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/expr/variable.test",
    "content": "Variable syntaxes\n-----\n<?php\n\n$a;\n${'a'};\n${foo()};\n$$a;\n$$$a;\n$$a['b'];\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Variable(\n            name: a\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Variable(\n            name: Scalar_String(\n                value: a\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Variable(\n            name: Expr_FuncCall(\n                name: Name(\n                    name: foo\n                )\n                args: array(\n                )\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Variable(\n            name: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Variable(\n            name: Expr_Variable(\n                name: Expr_Variable(\n                    name: a\n                )\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_ArrayDimFetch(\n            var: Expr_Variable(\n                name: Expr_Variable(\n                    name: a\n                )\n            )\n            dim: Scalar_String(\n                value: b\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/formattingAttributes.test",
    "content": "Test formatting attributes\n-----\n<?php\n\n0b1100;\n0o14;\n12;\n0xc;\n1_2_3_4_5_6;\n3.141_592_653;\n\n'foo';\n\"bar\";\n\"foo\nbar\";\n\"foo\\nbar\";\n\"foo\\nbar{$x}\";\n`foo\\nbar`;\n`foo\\nbar{$x}`;\n\n<<<'ABC'\nABC;\n<<<'ABC'\nfoo bar\nABC;\n<<<'ABC'\n    foo bar\n    ABC;\n<<<ABC\nfoo\\nbar\nABC;\n<<<ABC\n    foo\\nbar\n    ABC;\n<<<ABC\nfoo\\nbar{$x}baz\nABC;\n<<<ABC\n    foo\\nbar{$x}baz\n    ABC;\n\narray();\n[];\nlist($x) = $y;\n[$x] = $y;\n(int) $int;\n(integer) $integer;\n(bool) $bool;\n(boolean) $boolean;\n(string) $string;\n(binary) $binary;\n-----\n!!attributes\narray(\n    0: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 12\n            rawValue: 0b1100\n            kind: KIND_BIN (2)\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 12\n            rawValue: 0o14\n            kind: KIND_OCT (8)\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 12\n            rawValue: 12\n            kind: KIND_DEC (10)\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 12\n            rawValue: 0xc\n            kind: KIND_HEX (16)\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 123456\n            rawValue: 1_2_3_4_5_6\n            kind: KIND_DEC (10)\n        )\n    )\n    5: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 3.141592653\n            rawValue: 3.141_592_653\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_String(\n            value: foo\n            kind: KIND_SINGLE_QUOTED (1)\n            rawValue: 'foo'\n        )\n    )\n    7: Stmt_Expression(\n        expr: Scalar_String(\n            value: bar\n            kind: KIND_DOUBLE_QUOTED (2)\n            rawValue: \"bar\"\n        )\n    )\n    8: Stmt_Expression(\n        expr: Scalar_String(\n            value: foo\n            bar\n            kind: KIND_DOUBLE_QUOTED (2)\n            rawValue: \"foo\n            bar\"\n        )\n    )\n    9: Stmt_Expression(\n        expr: Scalar_String(\n            value: foo\n            bar\n            kind: KIND_DOUBLE_QUOTED (2)\n            rawValue: \"foo\\nbar\"\n        )\n    )\n    10: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: foo\n                    bar\n                    rawValue: foo\\nbar\n                )\n                1: Expr_Variable(\n                    name: x\n                )\n            )\n            kind: KIND_DOUBLE_QUOTED (2)\n        )\n    )\n    11: Stmt_Expression(\n        expr: Expr_ShellExec(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: foo\n                    bar\n                    rawValue: foo\\nbar\n                )\n            )\n        )\n    )\n    12: Stmt_Expression(\n        expr: Expr_ShellExec(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: foo\n                    bar\n                    rawValue: foo\\nbar\n                )\n                1: Expr_Variable(\n                    name: x\n                )\n            )\n        )\n    )\n    13: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n            kind: KIND_NOWDOC (4)\n            docLabel: ABC\n            docIndentation:\n            rawValue:\n        )\n    )\n    14: Stmt_Expression(\n        expr: Scalar_String(\n            value: foo bar\n            kind: KIND_NOWDOC (4)\n            docLabel: ABC\n            docIndentation:\n            rawValue: foo bar\n        )\n    )\n    15: Stmt_Expression(\n        expr: Scalar_String(\n            value: foo bar\n            kind: KIND_NOWDOC (4)\n            docLabel: ABC\n            docIndentation:\n            rawValue: foo bar\n        )\n    )\n    16: Stmt_Expression(\n        expr: Scalar_String(\n            value: foo\n            bar\n            kind: KIND_HEREDOC (3)\n            docLabel: ABC\n            docIndentation:\n            rawValue: foo\\nbar\n        )\n    )\n    17: Stmt_Expression(\n        expr: Scalar_String(\n            value: foo\n            bar\n            kind: KIND_HEREDOC (3)\n            docLabel: ABC\n            docIndentation:\n            rawValue: foo\\nbar\n        )\n    )\n    18: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: foo\n                    bar\n                    rawValue: foo\\nbar\n                )\n                1: Expr_Variable(\n                    name: x\n                )\n                2: InterpolatedStringPart(\n                    value: baz\n                    rawValue: baz\n                )\n            )\n            kind: KIND_HEREDOC (3)\n            docLabel: ABC\n            docIndentation:\n        )\n    )\n    19: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: foo\n                    bar\n                    rawValue: foo\\nbar\n                )\n                1: Expr_Variable(\n                    name: x\n                )\n                2: InterpolatedStringPart(\n                    value: baz\n                    rawValue: baz\n                )\n            )\n            kind: KIND_HEREDOC (3)\n            docLabel: ABC\n            docIndentation:\n        )\n    )\n    20: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n            )\n            kind: KIND_LONG (1)\n        )\n    )\n    21: Stmt_Expression(\n        expr: Expr_Array(\n            items: array(\n            )\n            kind: KIND_SHORT (2)\n        )\n    )\n    22: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: x\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n                kind: KIND_LIST (1)\n            )\n            expr: Expr_Variable(\n                name: y\n            )\n        )\n    )\n    23: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_List(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Expr_Variable(\n                            name: x\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n                kind: KIND_ARRAY (2)\n            )\n            expr: Expr_Variable(\n                name: y\n            )\n        )\n    )\n    24: Stmt_Expression(\n        expr: Expr_Cast_Int(\n            expr: Expr_Variable(\n                name: int\n            )\n            kind: 1\n        )\n    )\n    25: Stmt_Expression(\n        expr: Expr_Cast_Int(\n            expr: Expr_Variable(\n                name: integer\n            )\n            kind: 2\n        )\n    )\n    26: Stmt_Expression(\n        expr: Expr_Cast_Bool(\n            expr: Expr_Variable(\n                name: bool\n            )\n            kind: 1\n        )\n    )\n    27: Stmt_Expression(\n        expr: Expr_Cast_Bool(\n            expr: Expr_Variable(\n                name: boolean\n            )\n            kind: 2\n        )\n    )\n    28: Stmt_Expression(\n        expr: Expr_Cast_String(\n            expr: Expr_Variable(\n                name: string\n            )\n            kind: 1\n        )\n    )\n    29: Stmt_Expression(\n        expr: Expr_Cast_String(\n            expr: Expr_Variable(\n                name: binary\n            )\n            kind: 2\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/nopPositions.test",
    "content": "Positions for leading nop statement\n-----\n<?php\n/* Comment */\n-----\n!!positions\narray(\n    0: Stmt_Nop[2:14 - 2:13](\n        comments: array(\n            0: /* Comment */\n        )\n    )\n)\n-----\n<?php\n{\n    /* comment */\n}\n-----\n!!positions\narray(\n    0: Stmt_Block[2:1 - 4:1](\n        stmts: array(\n            0: Stmt_Nop[3:0 - 3:17](\n                comments: array(\n                    0: /* comment */\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/constantString.test",
    "content": "Constant string syntaxes\n-----\n<?php\n\n'';\n\"\";\nb'';\nb\"\";\n'Hi';\nb'Hi';\nB'Hi';\n\"Hi\";\nb\"Hi\";\nB\"Hi\";\n'!\\'!\\\\!\\a!';\n\"!\\\"!\\\\!\\$!\\n!\\r!\\t!\\f!\\v!\\e!\\a\";\n\"!\\xFF!\\377!\\400!\\0!\";\n-----\narray(\n    0: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_String(\n            value: Hi\n        )\n    )\n    5: Stmt_Expression(\n        expr: Scalar_String(\n            value: Hi\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_String(\n            value: Hi\n        )\n    )\n    7: Stmt_Expression(\n        expr: Scalar_String(\n            value: Hi\n        )\n    )\n    8: Stmt_Expression(\n        expr: Scalar_String(\n            value: Hi\n        )\n    )\n    9: Stmt_Expression(\n        expr: Scalar_String(\n            value: Hi\n        )\n    )\n    10: Stmt_Expression(\n        expr: Scalar_String(\n            value: !'!\\!\\a!\n        )\n    )\n    11: Stmt_Expression(\n        expr: Scalar_String(\n            value: !\"!\\!$!\n            !@@{ \"\\r\" }@@!@@{ \"\\t\" }@@!@@{ \"\\f\" }@@!@@{ \"\\v\" }@@!@@{ chr(27) /* \"\\e\" */ }@@!\\a\n        )\n    )\n    12: Stmt_Expression(\n        expr: Scalar_String(\n            value: !@@{ chr(255) }@@!@@{ chr(255) }@@!@@{ chr(0) }@@!@@{ chr(0) }@@!\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/docString.test",
    "content": "Nowdoc and heredoc strings\n-----\n<?php\n\n// empty strings\n<<<'EOS'\nEOS;\n<<<EOS\nEOS;\n\n// constant encapsed strings\n<<<'EOS'\nTest '\" $a \\n\nEOS;\n<<<EOS\nTest '\" \\$a \\n\nEOS;\n\n// encapsed strings\n<<<EOS\nTest $a\nEOS;\n<<<EOS\nTest $a and $b->c test\nEOS;\n\nb<<<EOS\nBinary\nEOS;\n\n<<<EOS\n$x\\r\nEOS;\n\n-----\narray(\n    0: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n        comments: array(\n            0: // empty strings\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_String(\n            value: Test '\" $a \\n\n        )\n        comments: array(\n            0: // constant encapsed strings\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_String(\n            value: Test '\" $a\n\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: Test\n                )\n                1: Expr_Variable(\n                    name: a\n                )\n            )\n        )\n        comments: array(\n            0: // encapsed strings\n        )\n    )\n    5: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: Test\n                )\n                1: Expr_Variable(\n                    name: a\n                )\n                2: InterpolatedStringPart(\n                    value:  and\n                )\n                3: Expr_PropertyFetch(\n                    var: Expr_Variable(\n                        name: b\n                    )\n                    name: Identifier(\n                        name: c\n                    )\n                )\n                4: InterpolatedStringPart(\n                    value:  test\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_String(\n            value: Binary\n        )\n    )\n    7: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: x\n                )\n                1: InterpolatedStringPart(\n                    value:\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/docStringNewlines.test",
    "content": "Trailing newlines in doc strings\n-----\n<?php\n\n<<<'EOF'@@{ \"\\n\\n\" }@@EOF;\n<<<'EOF'@@{ \"\\n\\n\\n\" }@@EOF;\n<<<'EOF'@@{ \"\\nFoo\\n\\n\" }@@EOF;\n<<<EOF@@{ \"\\n\\$var\\n\\n\" }@@EOF;\n\n<<<'EOF'@@{ \"\\r\\n\\r\\n\" }@@EOF;\n<<<'EOF'@@{ \"\\r\\n\\r\\n\\r\\n\" }@@EOF;\n<<<'EOF'@@{ \"\\r\\nFoo\\r\\n\\r\\n\" }@@EOF;\n<<<EOF@@{ \"\\r\\n\\$var\\r\\n\\r\\n\" }@@EOF;\n\n-----\narray(\n    0: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_String(\n            value: Foo\n\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: var\n                )\n                1: InterpolatedStringPart(\n                    value:\n\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    5: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_String(\n            value: Foo\n\n        )\n    )\n    7: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: var\n                )\n                1: InterpolatedStringPart(\n                    value:\n\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/encapsedNegVarOffset.test",
    "content": "Encapsed string negative var offsets\n-----\n<?php\n\"$a[-0]\";\n\"$a[-1]\";\n\"$a[-0x0]\";\n\"$a[-00]\";\n\"$a[@@{ -PHP_INT_MAX - 1 }@@]\";\n-----\narray(\n    0: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    dim: Scalar_String(\n                        value: -0\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    dim: Scalar_Int(\n                        value: -1\n                    )\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    dim: Scalar_String(\n                        value: -0x0\n                    )\n                )\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    dim: Scalar_String(\n                        value: -00\n                    )\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: a\n                    )\n                    dim: Scalar_Int(\n                        value: @@{ -PHP_INT_MAX - 1 }@@\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/encapsedString.test",
    "content": "Encapsed strings\n-----\n<?php\n\n\"$A\";\n\"$A->B\";\n\"$A[B]\";\n\"$A[0]\";\n\"$A[1234]\";\n\"$A[9223372036854775808]\";\n\"$A[000]\";\n\"$A[0x0]\";\n\"$A[0b0]\";\n\"$A[$B]\";\n\"{$A}\";\n\"{$A['B']}\";\n\"${A}\";\n\"${A['B']}\";\n\"${$A}\";\n\"\\{$A}\";\n\"\\{ $A }\";\n\"\\\\{$A}\";\n\"\\\\{ $A }\";\n\"{$$A}[B]\";\n\"$$A[B]\";\n\"A $B C\";\nb\"$A\";\nB\"$A\";\n-----\narray(\n    0: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: A\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_PropertyFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    name: Identifier(\n                        name: B\n                    )\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Scalar_String(\n                        value: B\n                    )\n                )\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Scalar_Int(\n                        value: 0\n                    )\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Scalar_Int(\n                        value: 1234\n                    )\n                )\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Scalar_String(\n                        value: 9223372036854775808\n                    )\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Scalar_String(\n                        value: 000\n                    )\n                )\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Scalar_String(\n                        value: 0x0\n                    )\n                )\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Scalar_String(\n                        value: 0b0\n                    )\n                )\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Expr_Variable(\n                        name: B\n                    )\n                )\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: A\n                )\n            )\n        )\n    )\n    11: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Scalar_String(\n                        value: B\n                    )\n                )\n            )\n        )\n    )\n    12: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: A\n                )\n            )\n        )\n    )\n    13: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Scalar_String(\n                        value: B\n                    )\n                )\n            )\n        )\n    )\n    14: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: Expr_Variable(\n                        name: A\n                    )\n                )\n            )\n        )\n    )\n    15: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: \\{\n                )\n                1: Expr_Variable(\n                    name: A\n                )\n                2: InterpolatedStringPart(\n                    value: }\n                )\n            )\n        )\n    )\n    16: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: \\{\n                )\n                1: Expr_Variable(\n                    name: A\n                )\n                2: InterpolatedStringPart(\n                    value:  }\n                )\n            )\n        )\n    )\n    17: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: \\\n                )\n                1: Expr_Variable(\n                    name: A\n                )\n            )\n        )\n    )\n    18: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: \\{\n                )\n                1: Expr_Variable(\n                    name: A\n                )\n                2: InterpolatedStringPart(\n                    value:  }\n                )\n            )\n        )\n    )\n    19: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: Expr_Variable(\n                        name: A\n                    )\n                )\n                1: InterpolatedStringPart(\n                    value: [B]\n                )\n            )\n        )\n    )\n    20: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: $\n                )\n                1: Expr_ArrayDimFetch(\n                    var: Expr_Variable(\n                        name: A\n                    )\n                    dim: Scalar_String(\n                        value: B\n                    )\n                )\n            )\n        )\n    )\n    21: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: A\n                )\n                1: Expr_Variable(\n                    name: B\n                )\n                2: InterpolatedStringPart(\n                    value:  C\n                )\n            )\n        )\n    )\n    22: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: A\n                )\n            )\n        )\n    )\n    23: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: A\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/explicitOctal.test",
    "content": "Explicit octal syntax\n-----\n<?php\n0o123;\n0O123;\n0o1_2_3;\n0o1000000000000000000000;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 83\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 83\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 83\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 9.2233720368548E+18\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/flexibleDocString.test",
    "content": "Flexible heredoc/nowdoc (PHP 7.3)\n-----\n<?php\n\n$ary = [\n    <<<FOO\nTest\nFOO,\n    <<<'BAR'\n    Test\n    BAR,\n];\n\n<<<'END'\n END;\n\n<<<END\n\n  END;\n\n<<<END\n@@{ \" \" }@@\n  END;\n\n<<<'END'\n     a\n    b\n\n   c\n\n  d\n e\n END;\n\n<<<END\n\t    a\n\t   b\n\t  $test\n\t d\n\te\n\tEND;\n\n<<<'END'\n\n    a\n\n   b\n\n  c\n\n d\n\ne\n\nEND;\n\n<<<END\n\ta\\r\\n\n\\ta\\n\n   b\\r\\n\n  $test\\n\n d\\r\\n\ne\\n\nEND;\n\n<<<BAR\n $one-\n BAR;\n\n<<<BAR\n $two -\n BAR;\n\n<<<BAR\n $three\t-\n BAR;\n\n<<<BAR\n $four-$four\n BAR;\n\n<<<BAR\n $five-$five-\n BAR;\n\n<<<BAR\n $six-$six-$six\n BAR;\n\n<<<BAR\n $seven\n -\n BAR;\n\n<<<BAR\n $eight\n  -\n BAR;\n\n<<<BAR\n$nine\nBAR;\n\n<<<BAR\n -\n BAR;\n\n<<<BAR\n  -\n BAR;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: ary\n            )\n            expr: Expr_Array(\n                items: array(\n                    0: ArrayItem(\n                        key: null\n                        value: Scalar_String(\n                            value: Test\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                    1: ArrayItem(\n                        key: null\n                        value: Scalar_String(\n                            value: Test\n                        )\n                        byRef: false\n                        unpack: false\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_String(\n            value:     a\n               b\n\n              c\n\n             d\n            e\n        )\n    )\n    5: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value:     a\n                       b\n\n                )\n                1: Expr_Variable(\n                    name: test\n                )\n                2: InterpolatedStringPart(\n                    value:\n                     d\n                    e\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n                a\n\n               b\n\n              c\n\n             d\n\n            e\n\n        )\n    )\n    7: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: \ta\n\n                    @@{ \"\\t\" }@@a\n\n                       b\n\n\n                )\n                1: Expr_Variable(\n                    name: test\n                )\n                2: InterpolatedStringPart(\n                    value:\n\n                     d\n\n                    e\n\n                )\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: one\n                )\n                1: InterpolatedStringPart(\n                    value: -\n                )\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: two\n                )\n                1: InterpolatedStringPart(\n                    value:  -\n                )\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: three\n                )\n                1: InterpolatedStringPart(\n                    value: \t-\n                )\n            )\n        )\n    )\n    11: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: four\n                )\n                1: InterpolatedStringPart(\n                    value: -\n                )\n                2: Expr_Variable(\n                    name: four\n                )\n            )\n        )\n    )\n    12: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: five\n                )\n                1: InterpolatedStringPart(\n                    value: -\n                )\n                2: Expr_Variable(\n                    name: five\n                )\n                3: InterpolatedStringPart(\n                    value: -\n                )\n            )\n        )\n    )\n    13: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: six\n                )\n                1: InterpolatedStringPart(\n                    value: -\n                )\n                2: Expr_Variable(\n                    name: six\n                )\n                3: InterpolatedStringPart(\n                    value: -\n                )\n                4: Expr_Variable(\n                    name: six\n                )\n            )\n        )\n    )\n    14: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: seven\n                )\n                1: InterpolatedStringPart(\n                    value:\n                    -\n                )\n            )\n        )\n    )\n    15: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: eight\n                )\n                1: InterpolatedStringPart(\n                    value:\n                     -\n                )\n            )\n        )\n    )\n    16: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: nine\n                )\n            )\n        )\n    )\n    17: Stmt_Expression(\n        expr: Scalar_String(\n            value: -\n        )\n    )\n    18: Stmt_Expression(\n        expr: Scalar_String(\n            value:  -\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/flexibleDocStringErrors.test",
    "content": "Error conditions for flexible doc strings\n-----\n<?php\n\n<<<A\n @@{ \"\\t\" }@@A;\n\n<<<A\n    FooBar\n @@{ \"\\t\" }@@A;\n\necho <<<END\n@@{ \"\\t\" }@@   X\n@@{ \"\\t\\t\" }@@END;\n\necho <<<END\n      a\n     b\n    c\n     END;\n\n<<<END\n\\ta\n@@{ \"\\t\" }@@END;\n\n<<<TEST\n  Foo\n$var\n  TEST;\n\n<<<TEST\n$var\n TEST;\n\necho <<<END\n a\n$a\n END;\n-----\nInvalid indentation - tabs and spaces cannot be mixed from 4:1 to 4:3\nInvalid indentation - tabs and spaces cannot be mixed from 8:1 to 8:3\nInvalid indentation - tabs and spaces cannot be mixed from 10:6 to 12:5\nInvalid body indentation level (expecting an indentation level of at least 5) from 14:6 to 18:8\nInvalid body indentation level (expecting an indentation level of at least 1) from 20:1 to 22:4\nInvalid body indentation level (expecting an indentation level of at least 2) from 25:1 to 26:0\nInvalid body indentation level (expecting an indentation level of at least 1) from 30:1 to 30:4\nInvalid body indentation level (expecting an indentation level of at least 1) from 34:1 to 35:0\narray(\n    0: Stmt_Expression(\n        expr: Scalar_String(\n            value:\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_String(\n            value:     FooBar\n        )\n    )\n    2: Stmt_Echo(\n        exprs: array(\n            0: Scalar_String(\n                value:   X\n            )\n        )\n    )\n    3: Stmt_Echo(\n        exprs: array(\n            0: Scalar_String(\n                value:  a\n                b\n                c\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_String(\n            value: \ta\n        )\n    )\n    5: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: Foo\n\n                )\n                1: Expr_Variable(\n                    name: var\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: Expr_Variable(\n                    name: var\n                )\n            )\n        )\n    )\n    7: Stmt_Echo(\n        exprs: array(\n            0: Scalar_InterpolatedString(\n                parts: array(\n                    0: InterpolatedStringPart(\n                        value: a\n\n                    )\n                    1: Expr_Variable(\n                        name: a\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/float.test",
    "content": "Different float syntaxes\n-----\n<?php\n\n0.0;\n0.;\n.0;\n0e0;\n0E0;\n0e+0;\n0e-0;\n30.20e10;\n300.200e100;\n1e10000;\n\n// various integer -> float overflows\n// (all are actually the same number, just in different representations)\n18446744073709551615;\n0xFFFFFFFFFFFFFFFF;\n0xEEEEEEEEEEEEEEEE;\n01777777777777777777777;\n0177777777777777777777787;\n0b1111111111111111111111111111111111111111111111111111111111111111;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 0\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 0\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 0\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 0\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 0\n        )\n    )\n    5: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 0\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 0\n        )\n    )\n    7: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 302000000000\n        )\n    )\n    8: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 3.002E+102\n        )\n    )\n    9: Stmt_Expression(\n        expr: Scalar_Float(\n            value: INF\n        )\n    )\n    10: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 1.844674407371E+19\n        )\n        comments: array(\n            0: // various integer -> float overflows\n            1: // (all are actually the same number, just in different representations)\n        )\n    )\n    11: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 1.844674407371E+19\n        )\n    )\n    12: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 1.7216961135462E+19\n        )\n    )\n    13: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 1.844674407371E+19\n        )\n    )\n    14: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 1.844674407371E+19\n        )\n    )\n    15: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 1.844674407371E+19\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/int.test",
    "content": "Different integer syntaxes\n-----\n<?php\n\n0;\n1;\n@@{ PHP_INT_MAX     }@@;\n@@{ PHP_INT_MAX + 1 }@@;\n0xFFF;\n0xfff;\n0XfFf;\n0777;\n0b111000111000;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 0\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 1\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_Int(\n            value: @@{ PHP_INT_MAX }@@\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_Float(\n            value: @@{ PHP_INT_MAX + 1 }@@\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 4095\n        )\n    )\n    5: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 4095\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 4095\n        )\n    )\n    7: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 511\n        )\n    )\n    8: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 3640\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/invalidOctal.test",
    "content": "Invalid octal literals\n-----\n<?php\n0787;\n-----\n!!version=7.0\nInvalid numeric literal from 2:1 to 2:4\narray(\n    0: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 0\n        )\n    )\n)\n-----\n<?php\n0787;\n-----\n!!version=5.6\narray(\n    0: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 7\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/magicConst.test",
    "content": "Magic constants\n-----\n<?php\n\n__CLASS__;\n__DIR__;\n__FILE__;\n__FUNCTION__;\n__LINE__;\n__METHOD__;\n__NAMESPACE__;\n__TRAIT__;\n__PROPERTY__;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Scalar_MagicConst_Class(\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_MagicConst_Dir(\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_MagicConst_File(\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_MagicConst_Function(\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_MagicConst_Line(\n        )\n    )\n    5: Stmt_Expression(\n        expr: Scalar_MagicConst_Method(\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_MagicConst_Namespace(\n        )\n    )\n    7: Stmt_Expression(\n        expr: Scalar_MagicConst_Trait(\n        )\n    )\n    8: Stmt_Expression(\n        expr: Scalar_MagicConst_Property(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/numberSeparators.test",
    "content": "Different integer syntaxes\n-----\n<?php\n\n6.674_083e-11;\n299_792_458;\n0x7AFE_F00D;\n0b0101_1111;\n0137_041;\n\n// already a valid constant name\n_100;\n\n// syntax errors\n100_;\n1__1;\n1_.0;\n1._0;\n0x_123;\n0b_101;\n1_e2;\n1e_2;\n-----\nSyntax error, unexpected T_STRING from 13:4 to 13:4\nSyntax error, unexpected T_STRING from 14:2 to 14:4\nSyntax error, unexpected T_STRING from 15:2 to 15:2\nSyntax error, unexpected T_STRING from 16:3 to 16:4\nSyntax error, unexpected T_STRING from 17:2 to 17:6\nSyntax error, unexpected T_STRING from 18:2 to 18:6\nSyntax error, unexpected T_STRING from 19:2 to 19:4\nSyntax error, unexpected T_STRING from 20:2 to 20:4\narray(\n    0: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 6.674083E-11\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 299792458\n        )\n    )\n    2: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 2063527949\n        )\n    )\n    3: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 95\n        )\n    )\n    4: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 48673\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: _100\n            )\n        )\n        comments: array(\n            0: // already a valid constant name\n        )\n    )\n    6: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 100\n        )\n        comments: array(\n            0: // syntax errors\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: _\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 1\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: __1\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 1\n        )\n    )\n    11: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: _\n            )\n        )\n    )\n    12: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 0\n        )\n    )\n    13: Stmt_Expression(\n        expr: Scalar_Float(\n            value: 1\n        )\n    )\n    14: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: _0\n            )\n        )\n    )\n    15: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 0\n        )\n    )\n    16: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: x_123\n            )\n        )\n    )\n    17: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 0\n        )\n    )\n    18: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: b_101\n            )\n        )\n    )\n    19: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 1\n        )\n    )\n    20: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: _e2\n            )\n        )\n    )\n    21: Stmt_Expression(\n        expr: Scalar_Int(\n            value: 1\n        )\n    )\n    22: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: e_2\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/scalar/unicodeEscape.test",
    "content": "Unicode escape sequence\n-----\n<?php\n\n\"\\u{0}\";\n\"\\u{114}$foo\";\n`\\u{1F602}$bar`;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Scalar_String(\n            value: @@{\"\\0\"}@@\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: Ĕ\n                )\n                1: Expr_Variable(\n                    name: foo\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ShellExec(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: @@{\"\\xF0\\x9F\\x98\\x82\"}@@\n                )\n                1: Expr_Variable(\n                    name: bar\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\n\"\\u{0}\";\n\"\\u{114}$foo\";\n`\\u{1F602}$bar`;\n-----\n!!version=5.6\narray(\n    0: Stmt_Expression(\n        expr: Scalar_String(\n            value: \\u{0}\n        )\n    )\n    1: Stmt_Expression(\n        expr: Scalar_InterpolatedString(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: \\u{114}\n                )\n                1: Expr_Variable(\n                    name: foo\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ShellExec(\n            parts: array(\n                0: InterpolatedStringPart(\n                    value: \\u{1F602}\n                )\n                1: Expr_Variable(\n                    name: bar\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n\"\\u{FFFFFFFFFFFFFFFF}\";\n-----\nInvalid UTF-8 codepoint escape sequence: Codepoint too large on line 2\n"
  },
  {
    "path": "test/code/parser/semiReserved.test",
    "content": "Valid usages of reserved keywords as identifiers\n-----\n<?php\n\nclass Test {\n    function array() {}\n    function public() {}\n\n    static function list() {}\n    static function protected() {}\n\n    public $class;\n    public $private;\n\n    const TRAIT = 3, FINAL = 4;\n\n    const __CLASS__ = 1, __TRAIT__ = 2, __FUNCTION__ = 3, __METHOD__ = 4, __LINE__ = 5,\n          __FILE__ = 6, __DIR__ = 7, __NAMESPACE__ = 8;\n    // __halt_compiler does not work\n}\n\n$t = new Test;\n$t->array();\n$t->public();\n\nTest::list();\nTest::protected();\n\n$t->class;\n$t->private;\n\nTest::TRAIT;\nTest::FINAL;\n\nclass Foo {\n    use TraitA, TraitB {\n        TraitA::catch insteadof namespace\\TraitB;\n        TraitA::list as foreach;\n        TraitB::throw as protected public;\n        TraitB::self as protected;\n        exit as die;\n        \\TraitC::exit as bye;\n        namespace\\TraitC::exit as byebye;\n        TraitA::\n            //\n            /** doc comment */\n            #\n        catch /* comment */\n            // comment\n            # comment\n        insteadof TraitB;\n    }\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: 0\n                byRef: false\n                name: Identifier(\n                    name: array\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            1: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: 0\n                byRef: false\n                name: Identifier(\n                    name: public\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            2: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                byRef: false\n                name: Identifier(\n                    name: list\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            3: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                byRef: false\n                name: Identifier(\n                    name: protected\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            4: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: class\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            5: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: private\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            6: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: TRAIT\n                        )\n                        value: Scalar_Int(\n                            value: 3\n                        )\n                    )\n                    1: Const(\n                        name: Identifier(\n                            name: FINAL\n                        )\n                        value: Scalar_Int(\n                            value: 4\n                        )\n                    )\n                )\n            )\n            7: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: __CLASS__\n                        )\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                    1: Const(\n                        name: Identifier(\n                            name: __TRAIT__\n                        )\n                        value: Scalar_Int(\n                            value: 2\n                        )\n                    )\n                    2: Const(\n                        name: Identifier(\n                            name: __FUNCTION__\n                        )\n                        value: Scalar_Int(\n                            value: 3\n                        )\n                    )\n                    3: Const(\n                        name: Identifier(\n                            name: __METHOD__\n                        )\n                        value: Scalar_Int(\n                            value: 4\n                        )\n                    )\n                    4: Const(\n                        name: Identifier(\n                            name: __LINE__\n                        )\n                        value: Scalar_Int(\n                            value: 5\n                        )\n                    )\n                    5: Const(\n                        name: Identifier(\n                            name: __FILE__\n                        )\n                        value: Scalar_Int(\n                            value: 6\n                        )\n                    )\n                    6: Const(\n                        name: Identifier(\n                            name: __DIR__\n                        )\n                        value: Scalar_Int(\n                            value: 7\n                        )\n                    )\n                    7: Const(\n                        name: Identifier(\n                            name: __NAMESPACE__\n                        )\n                        value: Scalar_Int(\n                            value: 8\n                        )\n                    )\n                )\n            )\n            8: Stmt_Nop(\n                comments: array(\n                    0: // __halt_compiler does not work\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: t\n            )\n            expr: Expr_New(\n                class: Name(\n                    name: Test\n                )\n                args: array(\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_Variable(\n                name: t\n            )\n            name: Identifier(\n                name: array\n            )\n            args: array(\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_MethodCall(\n            var: Expr_Variable(\n                name: t\n            )\n            name: Identifier(\n                name: public\n            )\n            args: array(\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Name(\n                name: Test\n            )\n            name: Identifier(\n                name: list\n            )\n            args: array(\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_StaticCall(\n            class: Name(\n                name: Test\n            )\n            name: Identifier(\n                name: protected\n            )\n            args: array(\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_PropertyFetch(\n            var: Expr_Variable(\n                name: t\n            )\n            name: Identifier(\n                name: class\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_PropertyFetch(\n            var: Expr_Variable(\n                name: t\n            )\n            name: Identifier(\n                name: private\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Name(\n                name: Test\n            )\n            name: Identifier(\n                name: TRAIT\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_ClassConstFetch(\n            class: Name(\n                name: Test\n            )\n            name: Identifier(\n                name: FINAL\n            )\n        )\n    )\n    10: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Foo\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_TraitUse(\n                traits: array(\n                    0: Name(\n                        name: TraitA\n                    )\n                    1: Name(\n                        name: TraitB\n                    )\n                )\n                adaptations: array(\n                    0: Stmt_TraitUseAdaptation_Precedence(\n                        trait: Name(\n                            name: TraitA\n                        )\n                        method: Identifier(\n                            name: catch\n                        )\n                        insteadof: array(\n                            0: Name_Relative(\n                                name: TraitB\n                            )\n                        )\n                    )\n                    1: Stmt_TraitUseAdaptation_Alias(\n                        trait: Name(\n                            name: TraitA\n                        )\n                        method: Identifier(\n                            name: list\n                        )\n                        newModifier: null\n                        newName: Identifier(\n                            name: foreach\n                        )\n                    )\n                    2: Stmt_TraitUseAdaptation_Alias(\n                        trait: Name(\n                            name: TraitB\n                        )\n                        method: Identifier(\n                            name: throw\n                        )\n                        newModifier: PROTECTED (2)\n                        newName: Identifier(\n                            name: public\n                        )\n                    )\n                    3: Stmt_TraitUseAdaptation_Alias(\n                        trait: Name(\n                            name: TraitB\n                        )\n                        method: Identifier(\n                            name: self\n                        )\n                        newModifier: PROTECTED (2)\n                        newName: null\n                    )\n                    4: Stmt_TraitUseAdaptation_Alias(\n                        trait: null\n                        method: Identifier(\n                            name: exit\n                        )\n                        newModifier: null\n                        newName: Identifier(\n                            name: die\n                        )\n                    )\n                    5: Stmt_TraitUseAdaptation_Alias(\n                        trait: Name_FullyQualified(\n                            name: TraitC\n                        )\n                        method: Identifier(\n                            name: exit\n                        )\n                        newModifier: null\n                        newName: Identifier(\n                            name: bye\n                        )\n                    )\n                    6: Stmt_TraitUseAdaptation_Alias(\n                        trait: Name_Relative(\n                            name: TraitC\n                        )\n                        method: Identifier(\n                            name: exit\n                        )\n                        newModifier: null\n                        newName: Identifier(\n                            name: byebye\n                        )\n                    )\n                    7: Stmt_TraitUseAdaptation_Precedence(\n                        trait: Name(\n                            name: TraitA\n                        )\n                        method: Identifier(\n                            name: catch\n                            comments: array(\n                                0: //\n                                1: /** doc comment */\n                                2: #\n                            )\n                        )\n                        insteadof: array(\n                            0: Name(\n                                name: TraitB\n                            )\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/attributes.test",
    "content": "Attributes\n-----\n<?php\n\n#[\n    A1,\n    A2(),\n    A3(0),\n    A4(x: 1),\n]\nfunction a() {\n}\n\n#[A5]\nclass C {\n    #[A6]\n    public function m(\n        #[A7] $param,\n    ) {}\n    #[A14]\n    public $prop;\n}\n\n#[A8]\ninterface I {}\n#[A9]\ntrait T {}\n\n$x = #[A10] function() {};\n$y = #[A11] fn() => 0;\n$a = #[A12] static function() {};\n$b = #[A13] static fn() => 0;\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n            0: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: A1\n                        )\n                        args: array(\n                        )\n                    )\n                    1: Attribute(\n                        name: Name(\n                            name: A2\n                        )\n                        args: array(\n                        )\n                    )\n                    2: Attribute(\n                        name: Name(\n                            name: A3\n                        )\n                        args: array(\n                            0: Arg(\n                                name: null\n                                value: Scalar_Int(\n                                    value: 0\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    3: Attribute(\n                        name: Name(\n                            name: A4\n                        )\n                        args: array(\n                            0: Arg(\n                                name: Identifier(\n                                    name: x\n                                )\n                                value: Scalar_Int(\n                                    value: 1\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                )\n            )\n        )\n        byRef: false\n        name: Identifier(\n            name: a\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n    1: Stmt_Class(\n        attrGroups: array(\n            0: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: A5\n                        )\n                        args: array(\n                        )\n                    )\n                )\n            )\n        )\n        flags: 0\n        name: Identifier(\n            name: C\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                    0: AttributeGroup(\n                        attrs: array(\n                            0: Attribute(\n                                name: Name(\n                                    name: A6\n                                )\n                                args: array(\n                                )\n                            )\n                        )\n                    )\n                )\n                flags: PUBLIC (1)\n                byRef: false\n                name: Identifier(\n                    name: m\n                )\n                params: array(\n                    0: Param(\n                        attrGroups: array(\n                            0: AttributeGroup(\n                                attrs: array(\n                                    0: Attribute(\n                                        name: Name(\n                                            name: A7\n                                        )\n                                        args: array(\n                                        )\n                                    )\n                                )\n                            )\n                        )\n                        flags: 0\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: param\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                    0: AttributeGroup(\n                        attrs: array(\n                            0: Attribute(\n                                name: Name(\n                                    name: A14\n                                )\n                                args: array(\n                                )\n                            )\n                        )\n                    )\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n    2: Stmt_Interface(\n        attrGroups: array(\n            0: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: A8\n                        )\n                        args: array(\n                        )\n                    )\n                )\n            )\n        )\n        name: Identifier(\n            name: I\n        )\n        extends: array(\n        )\n        stmts: array(\n        )\n    )\n    3: Stmt_Trait(\n        attrGroups: array(\n            0: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: A9\n                        )\n                        args: array(\n                        )\n                    )\n                )\n            )\n        )\n        name: Identifier(\n            name: T\n        )\n        stmts: array(\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: x\n            )\n            expr: Expr_Closure(\n                attrGroups: array(\n                    0: AttributeGroup(\n                        attrs: array(\n                            0: Attribute(\n                                name: Name(\n                                    name: A10\n                                )\n                                args: array(\n                                )\n                            )\n                        )\n                    )\n                )\n                static: false\n                byRef: false\n                params: array(\n                )\n                uses: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: y\n            )\n            expr: Expr_ArrowFunction(\n                attrGroups: array(\n                    0: AttributeGroup(\n                        attrs: array(\n                            0: Attribute(\n                                name: Name(\n                                    name: A11\n                                )\n                                args: array(\n                                )\n                            )\n                        )\n                    )\n                )\n                static: false\n                byRef: false\n                params: array(\n                )\n                returnType: null\n                expr: Scalar_Int(\n                    value: 0\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: a\n            )\n            expr: Expr_Closure(\n                attrGroups: array(\n                    0: AttributeGroup(\n                        attrs: array(\n                            0: Attribute(\n                                name: Name(\n                                    name: A12\n                                )\n                                args: array(\n                                )\n                            )\n                        )\n                    )\n                )\n                static: true\n                byRef: false\n                params: array(\n                )\n                uses: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: b\n            )\n            expr: Expr_ArrowFunction(\n                attrGroups: array(\n                    0: AttributeGroup(\n                        attrs: array(\n                            0: Attribute(\n                                name: Name(\n                                    name: A13\n                                )\n                                args: array(\n                                )\n                            )\n                        )\n                    )\n                )\n                static: true\n                byRef: false\n                params: array(\n                )\n                returnType: null\n                expr: Scalar_Int(\n                    value: 0\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/blocklessStatement.test",
    "content": "Blockless statements for if/for/etc\n-----\n<?php\n\nif ($a) $A;\nelseif ($b) $B;\nelse $C;\n\nfor (;;) $foo;\n\nforeach ($a as $b) $AB;\n\nwhile ($a) $A;\n\ndo $A; while ($a);\n\ndeclare (a='b') $C;\n-----\narray(\n    0: Stmt_If(\n        cond: Expr_Variable(\n            name: a\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: A\n                )\n            )\n        )\n        elseifs: array(\n            0: Stmt_ElseIf(\n                cond: Expr_Variable(\n                    name: b\n                )\n                stmts: array(\n                    0: Stmt_Expression(\n                        expr: Expr_Variable(\n                            name: B\n                        )\n                    )\n                )\n            )\n        )\n        else: Stmt_Else(\n            stmts: array(\n                0: Stmt_Expression(\n                    expr: Expr_Variable(\n                        name: C\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_For(\n        init: array(\n        )\n        cond: array(\n        )\n        loop: array(\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: foo\n                )\n            )\n        )\n    )\n    2: Stmt_Foreach(\n        expr: Expr_Variable(\n            name: a\n        )\n        keyVar: null\n        byRef: false\n        valueVar: Expr_Variable(\n            name: b\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: AB\n                )\n            )\n        )\n    )\n    3: Stmt_While(\n        cond: Expr_Variable(\n            name: a\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: A\n                )\n            )\n        )\n    )\n    4: Stmt_Do(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: A\n                )\n            )\n        )\n        cond: Expr_Variable(\n            name: a\n        )\n    )\n    5: Stmt_Declare(\n        declares: array(\n            0: DeclareItem(\n                key: Identifier(\n                    name: a\n                )\n                value: Scalar_String(\n                    value: b\n                )\n            )\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: C\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/abstract.test",
    "content": "Abstract class\n-----\n<?php\n\nabstract class A {\n    public function a() {}\n    abstract public function b();\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: ABSTRACT (16)\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                byRef: false\n                name: Identifier(\n                    name: a\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            1: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC | ABSTRACT (17)\n                byRef: false\n                name: Identifier(\n                    name: b\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: null\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/anonymous.test",
    "content": "Anonymous classes\n-----\n<?php\n\nnew class {\n    public function test() {}\n};\nnew class extends A implements B, C {};\nnew class() {\n    public $foo;\n};\nnew class($a, $b) extends A {\n    use T;\n};\n\nclass A {\n    public function test() {\n        return new class($this) extends A {\n            const A = 'B';\n        };\n    }\n}\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_New(\n            class: Stmt_Class(\n                attrGroups: array(\n                )\n                flags: 0\n                name: null\n                extends: null\n                implements: array(\n                )\n                stmts: array(\n                    0: Stmt_ClassMethod(\n                        attrGroups: array(\n                        )\n                        flags: PUBLIC (1)\n                        byRef: false\n                        name: Identifier(\n                            name: test\n                        )\n                        params: array(\n                        )\n                        returnType: null\n                        stmts: array(\n                        )\n                    )\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_New(\n            class: Stmt_Class(\n                attrGroups: array(\n                )\n                flags: 0\n                name: null\n                extends: Name(\n                    name: A\n                )\n                implements: array(\n                    0: Name(\n                        name: B\n                    )\n                    1: Name(\n                        name: C\n                    )\n                )\n                stmts: array(\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_New(\n            class: Stmt_Class(\n                attrGroups: array(\n                )\n                flags: 0\n                name: null\n                extends: null\n                implements: array(\n                )\n                stmts: array(\n                    0: Stmt_Property(\n                        attrGroups: array(\n                        )\n                        flags: PUBLIC (1)\n                        type: null\n                        props: array(\n                            0: PropertyItem(\n                                name: VarLikeIdentifier(\n                                    name: foo\n                                )\n                                default: null\n                            )\n                        )\n                        hooks: array(\n                        )\n                    )\n                )\n            )\n            args: array(\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_New(\n            class: Stmt_Class(\n                attrGroups: array(\n                )\n                flags: 0\n                name: null\n                extends: Name(\n                    name: A\n                )\n                implements: array(\n                )\n                stmts: array(\n                    0: Stmt_TraitUse(\n                        traits: array(\n                            0: Name(\n                                name: T\n                            )\n                        )\n                        adaptations: array(\n                        )\n                    )\n                )\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    4: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                byRef: false\n                name: Identifier(\n                    name: test\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                    0: Stmt_Return(\n                        expr: Expr_New(\n                            class: Stmt_Class(\n                                attrGroups: array(\n                                )\n                                flags: 0\n                                name: null\n                                extends: Name(\n                                    name: A\n                                )\n                                implements: array(\n                                )\n                                stmts: array(\n                                    0: Stmt_ClassConst(\n                                        attrGroups: array(\n                                        )\n                                        flags: 0\n                                        type: null\n                                        consts: array(\n                                            0: Const(\n                                                name: Identifier(\n                                                    name: A\n                                                )\n                                                value: Scalar_String(\n                                                    value: B\n                                                )\n                                            )\n                                        )\n                                    )\n                                )\n                            )\n                            args: array(\n                                0: Arg(\n                                    name: null\n                                    value: Expr_Variable(\n                                        name: this\n                                    )\n                                    byRef: false\n                                    unpack: false\n                                )\n                            )\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/asymmetric_visibility.test",
    "content": "Asymmetric visibility modifiers\n-----\n<?php\n\nclass Test {\n    protected private(set) $a;\n    private public(set) $b;\n    protected(set) $c;\n\n    public function __construct(\n        protected private(set) $d,\n        private public(set) $e,\n        protected(set) $f,\n    ) {}\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PROTECTED | PRIVATE_SET (514)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: a\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PRIVATE | PUBLIC_SET (132)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: b\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            2: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PROTECTED_SET (256)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: c\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            3: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                byRef: false\n                name: Identifier(\n                    name: __construct\n                )\n                params: array(\n                    0: Param(\n                        attrGroups: array(\n                        )\n                        flags: PROTECTED | PRIVATE_SET (514)\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: d\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                    1: Param(\n                        attrGroups: array(\n                        )\n                        flags: PRIVATE | PUBLIC_SET (132)\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: e\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                    2: Param(\n                        attrGroups: array(\n                        )\n                        flags: PROTECTED_SET (256)\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: f\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nclass Test {\n    private(set) private(set) $x;\n    private(set) public(set) $x;\n}\n-----\nMultiple access type modifiers are not allowed from 3:18 to 3:29\nMultiple access type modifiers are not allowed from 4:18 to 4:28\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PRIVATE_SET (512)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: x\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC_SET | PRIVATE_SET (640)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: x\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/class_position.test",
    "content": "Class position\n-----\n<?php\n\nif (1);\n\nclass C {}\n-----\n!!positions\narray(\n    0: Stmt_If[3:1 - 3:7](\n        cond: Scalar_Int[3:5 - 3:5](\n            value: 1\n        )\n        stmts: array(\n        )\n        elseifs: array(\n        )\n        else: null\n    )\n    1: Stmt_Class[5:1 - 5:10](\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier[5:7 - 5:7](\n            name: C\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php\n\nif (1);\n\ntrait X {}\n-----\n!!positions\narray(\n    0: Stmt_If[3:1 - 3:7](\n        cond: Scalar_Int[3:5 - 3:5](\n            value: 1\n        )\n        stmts: array(\n        )\n        elseifs: array(\n        )\n        else: null\n    )\n    1: Stmt_Trait[5:1 - 5:10](\n        attrGroups: array(\n        )\n        name: Identifier[5:7 - 5:7](\n            name: X\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php\n\nif (1);\n\ninterface X {}\n-----\n!!positions\narray(\n    0: Stmt_If[3:1 - 3:7](\n        cond: Scalar_Int[3:5 - 3:5](\n            value: 1\n        )\n        stmts: array(\n        )\n        elseifs: array(\n        )\n        else: null\n    )\n    1: Stmt_Interface[5:1 - 5:14](\n        attrGroups: array(\n        )\n        name: Identifier[5:11 - 5:11](\n            name: X\n        )\n        extends: array(\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/conditional.test",
    "content": "Conditional class definition\n-----\n<?php\n\nif (true) {\n    class A {}\n}\n-----\narray(\n    0: Stmt_If(\n        cond: Expr_ConstFetch(\n            name: Name(\n                name: true\n            )\n        )\n        stmts: array(\n            0: Stmt_Class(\n                attrGroups: array(\n                )\n                flags: 0\n                name: Identifier(\n                    name: A\n                )\n                extends: null\n                implements: array(\n                )\n                stmts: array(\n                )\n            )\n        )\n        elseifs: array(\n        )\n        else: null\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/constModifierErrors.test",
    "content": "Invalid class constant modifiers\n-----\n<?php\nclass A {\n    static const X = 1;\n}\n-----\nCannot use 'static' as constant modifier from 3:5 to 3:10\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: X\n                        )\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nclass A {\n    abstract const X = 1;\n}\n-----\nCannot use 'abstract' as constant modifier from 3:5 to 3:12\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: ABSTRACT (16)\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: X\n                        )\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nclass A {\n    readonly const X = 1;\n}\n-----\nCannot use 'readonly' as constant modifier from 3:5 to 3:12\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: READONLY (64)\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: X\n                        )\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nclass A {\n    public public const X = 1;\n}\n-----\nMultiple access type modifiers are not allowed from 3:12 to 3:17\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: X\n                        )\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/constModifiers.test",
    "content": "Class constant modifiers\n-----\n<?php\n\nclass Foo {\n    const A = 1;\n    public const B = 2;\n    protected const C = 3;\n    private const D = 4;\n    final const E = 5;\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Foo\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: A\n                        )\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n            1: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: B\n                        )\n                        value: Scalar_Int(\n                            value: 2\n                        )\n                    )\n                )\n            )\n            2: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: PROTECTED (2)\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: C\n                        )\n                        value: Scalar_Int(\n                            value: 3\n                        )\n                    )\n                )\n            )\n            3: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: PRIVATE (4)\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: D\n                        )\n                        value: Scalar_Int(\n                            value: 4\n                        )\n                    )\n                )\n            )\n            4: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: FINAL (32)\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: E\n                        )\n                        value: Scalar_Int(\n                            value: 5\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/enum.test",
    "content": "Enum\n-----\n<?php\n\nenum A {\n    case class;\n}\nenum B implements Bar, Baz {\n}\nenum C: int implements Bar {\n    case Foo = 1;\n}\n-----\narray(\n    0: Stmt_Enum(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: A\n        )\n        scalarType: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_EnumCase(\n                attrGroups: array(\n                )\n                name: Identifier(\n                    name: class\n                )\n                expr: null\n            )\n        )\n    )\n    1: Stmt_Enum(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: B\n        )\n        scalarType: null\n        implements: array(\n            0: Name(\n                name: Bar\n            )\n            1: Name(\n                name: Baz\n            )\n        )\n        stmts: array(\n        )\n    )\n    2: Stmt_Enum(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: C\n        )\n        scalarType: Identifier(\n            name: int\n        )\n        implements: array(\n            0: Name(\n                name: Bar\n            )\n        )\n        stmts: array(\n            0: Stmt_EnumCase(\n                attrGroups: array(\n                )\n                name: Identifier(\n                    name: Foo\n                )\n                expr: Scalar_Int(\n                    value: 1\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/enum_with_string.test",
    "content": "Enum\n-----\n<?php\n\nenum Suit: string\n{\n    case Hearts = 'H';\n    case Diamonds;\n    case Clubs = 'C';\n    case Spades = 'S';\n}\n-----\narray(\n    0: Stmt_Enum(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: Suit\n        )\n        scalarType: Identifier(\n            name: string\n        )\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_EnumCase(\n                attrGroups: array(\n                )\n                name: Identifier(\n                    name: Hearts\n                )\n                expr: Scalar_String(\n                    value: H\n                )\n            )\n            1: Stmt_EnumCase(\n                attrGroups: array(\n                )\n                name: Identifier(\n                    name: Diamonds\n                )\n                expr: null\n            )\n            2: Stmt_EnumCase(\n                attrGroups: array(\n                )\n                name: Identifier(\n                    name: Clubs\n                )\n                expr: Scalar_String(\n                    value: C\n                )\n            )\n            3: Stmt_EnumCase(\n                attrGroups: array(\n                )\n                name: Identifier(\n                    name: Spades\n                )\n                expr: Scalar_String(\n                    value: S\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/final.test",
    "content": "Final class\n-----\n<?php\n\nfinal class A {}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: FINAL (32)\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/implicitPublic.test",
    "content": "Implicitly public properties and methods\n-----\n<?php\n\nabstract class A {\n    var $a;\n    static $b;\n    abstract function c();\n    final function d() {}\n    static function e() {}\n    final static function f() {}\n    function g() {}\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: ABSTRACT (16)\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: a\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: b\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            2: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: ABSTRACT (16)\n                byRef: false\n                name: Identifier(\n                    name: c\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: null\n            )\n            3: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: FINAL (32)\n                byRef: false\n                name: Identifier(\n                    name: d\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            4: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                byRef: false\n                name: Identifier(\n                    name: e\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            5: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: STATIC | FINAL (40)\n                byRef: false\n                name: Identifier(\n                    name: f\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            6: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: 0\n                byRef: false\n                name: Identifier(\n                    name: g\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/interface.test",
    "content": "Interface\n-----\n<?php\n\ninterface A extends C, D {\n    public function a();\n}\n-----\narray(\n    0: Stmt_Interface(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: A\n        )\n        extends: array(\n            0: Name(\n                name: C\n            )\n            1: Name(\n                name: D\n            )\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                byRef: false\n                name: Identifier(\n                    name: a\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: null\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/modifier_error.test",
    "content": "Invalid modifier combination\n-----\n<?php class A { public public $a; }\n-----\nMultiple access type modifiers are not allowed from 1:24 to 1:29\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: a\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php class A { public protected $a; }\n-----\nMultiple access type modifiers are not allowed from 1:24 to 1:32\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC | PROTECTED (3)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: a\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php class C { readonly readonly $a; }\n-----\nMultiple readonly modifiers are not allowed from 1:26 to 1:33\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: C\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: READONLY (64)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: a\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php class A { abstract abstract function a(); }\n-----\nMultiple abstract modifiers are not allowed from 1:26 to 1:33\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: ABSTRACT (16)\n                byRef: false\n                name: Identifier(\n                    name: a\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: null\n            )\n        )\n    )\n)\n-----\n<?php class A { static static $a; }\n-----\nMultiple static modifiers are not allowed from 1:24 to 1:29\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: a\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php class A { final final function a() {} }\n-----\nMultiple final modifiers are not allowed from 1:23 to 1:27\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: FINAL (32)\n                byRef: false\n                name: Identifier(\n                    name: a\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php class A { abstract final function a(); }\n-----\nCannot use the final modifier on an abstract class member from 1:26 to 1:30\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: ABSTRACT | FINAL (48)\n                byRef: false\n                name: Identifier(\n                    name: a\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: null\n            )\n        )\n    )\n)\n-----\n<?php abstract final class A { }\n-----\nCannot use the final modifier on an abstract class from 1:16 to 1:20\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: ABSTRACT | FINAL (48)\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/name.test",
    "content": "Invalid class name\n-----\n<?php class self {}\n-----\nCannot use 'self' as class name as it is reserved from 1:13 to 1:16\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: self\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php class PARENT {}\n-----\nCannot use 'PARENT' as class name as it is reserved from 1:13 to 1:18\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: PARENT\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php class static {}\n-----\nSyntax error, unexpected T_STATIC, expecting T_STRING from 1:13 to 1:18\narray(\n    0: Stmt_Block(\n        stmts: array(\n        )\n    )\n)\n-----\n<?php class A extends self {}\n-----\nCannot use 'self' as class name as it is reserved from 1:23 to 1:26\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: Name(\n            name: self\n        )\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php class A extends PARENT {}\n-----\nCannot use 'PARENT' as class name as it is reserved from 1:23 to 1:28\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: Name(\n            name: PARENT\n        )\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php class A extends static {}\n-----\nCannot use 'static' as class name as it is reserved from 1:23 to 1:28\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: Name(\n            name: static\n        )\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php class A implements self {}\n-----\nCannot use 'self' as interface name as it is reserved from 1:26 to 1:29\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n            0: Name(\n                name: self\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php class A implements PARENT {}\n-----\nCannot use 'PARENT' as interface name as it is reserved from 1:26 to 1:31\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n            0: Name(\n                name: PARENT\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php class A implements static {}\n-----\nCannot use 'static' as interface name as it is reserved from 1:26 to 1:31\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n            0: Name(\n                name: static\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php interface self {}\n-----\nCannot use 'self' as class name as it is reserved from 1:17 to 1:20\narray(\n    0: Stmt_Interface(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: self\n        )\n        extends: array(\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php interface PARENT {}\n-----\nCannot use 'PARENT' as class name as it is reserved from 1:17 to 1:22\narray(\n    0: Stmt_Interface(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: PARENT\n        )\n        extends: array(\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php interface static {}\n-----\nSyntax error, unexpected T_STATIC, expecting T_STRING from 1:17 to 1:22\narray(\n    0: Stmt_Block(\n        stmts: array(\n        )\n    )\n)\n-----\n<?php interface A extends self {}\n-----\nCannot use 'self' as interface name as it is reserved from 1:27 to 1:30\narray(\n    0: Stmt_Interface(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: A\n        )\n        extends: array(\n            0: Name(\n                name: self\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php interface A extends PARENT {}\n-----\nCannot use 'PARENT' as interface name as it is reserved from 1:27 to 1:32\narray(\n    0: Stmt_Interface(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: A\n        )\n        extends: array(\n            0: Name(\n                name: PARENT\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php interface A extends static {}\n-----\nCannot use 'static' as interface name as it is reserved from 1:27 to 1:32\narray(\n    0: Stmt_Interface(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: A\n        )\n        extends: array(\n            0: Name(\n                name: static\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/php4Style.test",
    "content": "PHP 4 style declarations\n-----\n<?php\n\nclass A {\n    var $foo;\n    function bar() {}\n    static abstract function baz() {}\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: foo\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: 0\n                byRef: false\n                name: Identifier(\n                    name: bar\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            2: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: ABSTRACT | STATIC (24)\n                byRef: false\n                name: Identifier(\n                    name: baz\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/propertyTypes.test",
    "content": "Class declaration\n-----\n<?php\n\nclass A {\n    public string $a;\n    protected static D $b;\n    private ?float $c;\n    readonly static public ?int $d;\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: Identifier(\n                    name: string\n                )\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: a\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PROTECTED | STATIC (10)\n                type: Name(\n                    name: D\n                )\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: b\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            2: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PRIVATE (4)\n                type: NullableType(\n                    type: Identifier(\n                        name: float\n                    )\n                )\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: c\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            3: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC | STATIC | READONLY (73)\n                type: NullableType(\n                    type: Identifier(\n                        name: int\n                    )\n                )\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: d\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/property_hooks.test",
    "content": "Property hooks\n-----\n<?php\nclass Test {\n    public $prop {\n        get { return 42; }\n        set { echo $value; }\n    }\n    private $prop2 {\n        get => 42;\n        set => $value;\n    }\n    abstract $prop3 {\n        &get;\n        set;\n    }\n    public $prop4 {\n        final get { return 42; }\n        set(string $value) { }\n    }\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                    0: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        byRef: false\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: array(\n                            0: Stmt_Return(\n                                expr: Scalar_Int(\n                                    value: 42\n                                )\n                            )\n                        )\n                    )\n                    1: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        byRef: false\n                        name: Identifier(\n                            name: set\n                        )\n                        params: array(\n                        )\n                        body: array(\n                            0: Stmt_Echo(\n                                exprs: array(\n                                    0: Expr_Variable(\n                                        name: value\n                                    )\n                                )\n                            )\n                        )\n                    )\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PRIVATE (4)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop2\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                    0: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        byRef: false\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: Scalar_Int(\n                            value: 42\n                        )\n                    )\n                    1: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        byRef: false\n                        name: Identifier(\n                            name: set\n                        )\n                        params: array(\n                        )\n                        body: Expr_Variable(\n                            name: value\n                        )\n                    )\n                )\n            )\n            2: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: ABSTRACT (16)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop3\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                    0: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        byRef: true\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: null\n                    )\n                    1: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        byRef: false\n                        name: Identifier(\n                            name: set\n                        )\n                        params: array(\n                        )\n                        body: null\n                    )\n                )\n            )\n            3: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop4\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                    0: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: FINAL (32)\n                        byRef: false\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: array(\n                            0: Stmt_Return(\n                                expr: Scalar_Int(\n                                    value: 42\n                                )\n                            )\n                        )\n                    )\n                    1: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        byRef: false\n                        name: Identifier(\n                            name: set\n                        )\n                        params: array(\n                            0: Param(\n                                attrGroups: array(\n                                )\n                                flags: 0\n                                type: Identifier(\n                                    name: string\n                                )\n                                byRef: false\n                                variadic: false\n                                var: Expr_Variable(\n                                    name: value\n                                )\n                                default: null\n                                hooks: array(\n                                )\n                            )\n                        )\n                        body: array(\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nclass Test {\n    public $prop {}\n    public function __construct(public $prop2 {}) {}\n}\n-----\nProperty hook list cannot be empty from 3:18 to 3:18\nProperty hook list cannot be empty from 4:47 to 4:47\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                byRef: false\n                name: Identifier(\n                    name: __construct\n                )\n                params: array(\n                    0: Param(\n                        attrGroups: array(\n                        )\n                        flags: PUBLIC (1)\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: prop2\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nclass Test {\n    public $prop {\n        get() => 42;\n    }\n}\n-----\nget hook must not have a parameter list from 4:12 to 4:12\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                    0: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        byRef: false\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: Scalar_Int(\n                            value: 42\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nclass Test {\n    public $prop { FOO => bar; }\n}\n-----\nUnknown hook \"FOO\", expected \"get\" or \"set\" from 3:20 to 3:22\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                    0: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        byRef: false\n                        name: Identifier(\n                            name: FOO\n                        )\n                        params: array(\n                        )\n                        body: Expr_ConstFetch(\n                            name: Name(\n                                name: bar\n                            )\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nclass Test {\n    public $prop {\n        public public get;\n        protected get;\n        private get;\n        abstract static get;\n        readonly get;\n    }\n}\n-----\nCannot use the public modifier on a property hook from 4:9 to 4:14\nMultiple access type modifiers are not allowed from 4:16 to 4:21\nCannot use the public modifier on a property hook from 4:16 to 4:21\nCannot use the protected modifier on a property hook from 5:9 to 5:17\nCannot use the private modifier on a property hook from 6:9 to 6:15\nCannot use the abstract modifier on a property hook from 7:9 to 7:16\nCannot use the static modifier on a property hook from 7:18 to 7:23\nCannot use the readonly modifier on a property hook from 8:9 to 8:16\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                    0: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: PUBLIC (1)\n                        byRef: false\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: null\n                    )\n                    1: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: PROTECTED (2)\n                        byRef: false\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: null\n                    )\n                    2: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: PRIVATE (4)\n                        byRef: false\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: null\n                    )\n                    3: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: ABSTRACT | STATIC (24)\n                        byRef: false\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: null\n                    )\n                    4: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: READONLY (64)\n                        byRef: false\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: null\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nclass Test\n{\n\n    public $foo, $bar { get { return 42; } }\n\n}\n-----\nCannot use hooks when declaring multiple properties from 5:23 to 5:23\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: foo\n                        )\n                        default: null\n                    )\n                    1: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: bar\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                    0: PropertyHook(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        byRef: false\n                        name: Identifier(\n                            name: get\n                        )\n                        params: array(\n                        )\n                        body: array(\n                            0: Stmt_Return(\n                                expr: Scalar_Int(\n                                    value: 42\n                                )\n                            )\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nclass Test\n{\n\n    public $foo, $bar { }\n\n}\n-----\nCannot use hooks when declaring multiple properties from 5:23 to 5:23\nProperty hook list cannot be empty from 5:23 to 5:23\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: foo\n                        )\n                        default: null\n                    )\n                    1: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: bar\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n)"
  },
  {
    "path": "test/code/parser/stmt/class/property_modifiers.test",
    "content": "Property modifiers\n-----\n<?php\nclass Test {\n    final public $prop;\n    abstract protected $prop;\n    readonly $prop;\n    private static $prop;\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC | FINAL (33)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PROTECTED | ABSTRACT (18)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            2: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: READONLY (64)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            3: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PRIVATE | STATIC (12)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/property_promotion.test",
    "content": "Property promotion\n-----\n<?php\n\nclass Point {\n    public function __construct(\n        public float $x = 0.0,\n        protected array $y = [],\n        private string $z = 'hello',\n        public readonly int $a = 0,\n        public $h { set => $value; },\n        public $g = 1 { get => 2; },\n        final $i,\n    ) {}\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Point\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                byRef: false\n                name: Identifier(\n                    name: __construct\n                )\n                params: array(\n                    0: Param(\n                        attrGroups: array(\n                        )\n                        flags: PUBLIC (1)\n                        type: Identifier(\n                            name: float\n                        )\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: x\n                        )\n                        default: Scalar_Float(\n                            value: 0\n                        )\n                        hooks: array(\n                        )\n                    )\n                    1: Param(\n                        attrGroups: array(\n                        )\n                        flags: PROTECTED (2)\n                        type: Identifier(\n                            name: array\n                        )\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: y\n                        )\n                        default: Expr_Array(\n                            items: array(\n                            )\n                        )\n                        hooks: array(\n                        )\n                    )\n                    2: Param(\n                        attrGroups: array(\n                        )\n                        flags: PRIVATE (4)\n                        type: Identifier(\n                            name: string\n                        )\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: z\n                        )\n                        default: Scalar_String(\n                            value: hello\n                        )\n                        hooks: array(\n                        )\n                    )\n                    3: Param(\n                        attrGroups: array(\n                        )\n                        flags: PUBLIC | READONLY (65)\n                        type: Identifier(\n                            name: int\n                        )\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: a\n                        )\n                        default: Scalar_Int(\n                            value: 0\n                        )\n                        hooks: array(\n                        )\n                    )\n                    4: Param(\n                        attrGroups: array(\n                        )\n                        flags: PUBLIC (1)\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: h\n                        )\n                        default: null\n                        hooks: array(\n                            0: PropertyHook(\n                                attrGroups: array(\n                                )\n                                flags: 0\n                                byRef: false\n                                name: Identifier(\n                                    name: set\n                                )\n                                params: array(\n                                )\n                                body: Expr_Variable(\n                                    name: value\n                                )\n                            )\n                        )\n                    )\n                    5: Param(\n                        attrGroups: array(\n                        )\n                        flags: PUBLIC (1)\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: g\n                        )\n                        default: Scalar_Int(\n                            value: 1\n                        )\n                        hooks: array(\n                            0: PropertyHook(\n                                attrGroups: array(\n                                )\n                                flags: 0\n                                byRef: false\n                                name: Identifier(\n                                    name: get\n                                )\n                                params: array(\n                                )\n                                body: Scalar_Int(\n                                    value: 2\n                                )\n                            )\n                        )\n                    )\n                    6: Param(\n                        attrGroups: array(\n                        )\n                        flags: FINAL (32)\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: i\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/readonly.test",
    "content": "Readonly class\n-----\n<?php\n\nreadonly class A {\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: READONLY (64)\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php\n\nfinal readonly class A {\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: FINAL | READONLY (96)\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/readonlyAnonyous.test",
    "content": "Readonly anonymous class\n-----\n<?php\n\nnew readonly class {};\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_New(\n            class: Stmt_Class(\n                attrGroups: array(\n                )\n                flags: READONLY (64)\n                name: null\n                extends: null\n                implements: array(\n                )\n                stmts: array(\n                )\n            )\n            args: array(\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/readonlyAsClassName.test",
    "content": "Readonly as class name\n-----\n<?php\nclass ReadOnly {}\n-----\nSyntax error, unexpected T_READONLY, expecting T_STRING from 2:7 to 2:14\narray(\n    0: Stmt_Block(\n        stmts: array(\n        )\n    )\n)\n-----\n<?php\nclass ReadOnly {}\n-----\n!!version=7.4\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: ReadOnly\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/readonlyMethod.test",
    "content": "Methods cannot be readonly\n-----\n<?php class A { readonly function foo() {} }\n-----\nMethod foo() cannot be readonly from 1:17 to 1:24\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: READONLY (64)\n                byRef: false\n                name: Identifier(\n                    name: foo\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/shortEchoAsIdentifier.test",
    "content": "Short echo syntax cannot be used as an identifier\n-----\n<?php\nclass C {\n    use T {\n        x as y?><?= as my_echo;\n    }\n}\n-----\nCannot use \"<?=\" as an identifier from 4:17 to 4:19\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: C\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_TraitUse(\n                traits: array(\n                    0: Name(\n                        name: T\n                    )\n                )\n                adaptations: array(\n                    0: Stmt_TraitUseAdaptation_Alias(\n                        trait: null\n                        method: Identifier(\n                            name: x\n                        )\n                        newModifier: null\n                        newName: Identifier(\n                            name: y\n                        )\n                    )\n                    1: Stmt_TraitUseAdaptation_Alias(\n                        trait: null\n                        method: Identifier(\n                            name: <?=\n                        )\n                        newModifier: null\n                        newName: Identifier(\n                            name: my_echo\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/simple.test",
    "content": "Class declaration\n-----\n<?php\n\nclass A extends B implements C, D {\n    const A = 'B', C = 'D';\n\n    public $a = 'b', $c = 'd';\n    protected $e;\n    private $f;\n\n    public function a() {}\n    public static function b($a) {}\n    final public function c() : B {}\n    protected function d() {}\n    private function e() {}\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: Name(\n            name: B\n        )\n        implements: array(\n            0: Name(\n                name: C\n            )\n            1: Name(\n                name: D\n            )\n        )\n        stmts: array(\n            0: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: A\n                        )\n                        value: Scalar_String(\n                            value: B\n                        )\n                    )\n                    1: Const(\n                        name: Identifier(\n                            name: C\n                        )\n                        value: Scalar_String(\n                            value: D\n                        )\n                    )\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: a\n                        )\n                        default: Scalar_String(\n                            value: b\n                        )\n                    )\n                    1: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: c\n                        )\n                        default: Scalar_String(\n                            value: d\n                        )\n                    )\n                )\n                hooks: array(\n                )\n            )\n            2: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PROTECTED (2)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: e\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            3: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PRIVATE (4)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: f\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            4: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                byRef: false\n                name: Identifier(\n                    name: a\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            5: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC | STATIC (9)\n                byRef: false\n                name: Identifier(\n                    name: b\n                )\n                params: array(\n                    0: Param(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: a\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            6: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC | FINAL (33)\n                byRef: false\n                name: Identifier(\n                    name: c\n                )\n                params: array(\n                )\n                returnType: Name(\n                    name: B\n                )\n                stmts: array(\n                )\n            )\n            7: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PROTECTED (2)\n                byRef: false\n                name: Identifier(\n                    name: d\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n            8: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PRIVATE (4)\n                byRef: false\n                name: Identifier(\n                    name: e\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/staticMethod.test",
    "content": "Some special methods cannot be static\n-----\n<?php class A { static function __construct() {} }\n-----\nConstructor __construct() cannot be static from 1:17 to 1:22\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                byRef: false\n                name: Identifier(\n                    name: __construct\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php class A { static function __destruct() {} }\n-----\nDestructor __destruct() cannot be static from 1:17 to 1:22\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                byRef: false\n                name: Identifier(\n                    name: __destruct\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php class A { static function __clone() {} }\n-----\nClone method __clone() cannot be static from 1:17 to 1:22\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                byRef: false\n                name: Identifier(\n                    name: __clone\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php class A { static function __CONSTRUCT() {} }\n-----\nConstructor __CONSTRUCT() cannot be static from 1:17 to 1:22\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                byRef: false\n                name: Identifier(\n                    name: __CONSTRUCT\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php class A { static function __Destruct() {} }\n-----\nDestructor __Destruct() cannot be static from 1:17 to 1:22\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                byRef: false\n                name: Identifier(\n                    name: __Destruct\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php class A { static function __cLoNe() {} }\n-----\nClone method __cLoNe() cannot be static from 1:17 to 1:22\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: A\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: STATIC (8)\n                byRef: false\n                name: Identifier(\n                    name: __cLoNe\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/staticType.test",
    "content": "Static return type\n-----\n<?php\nclass Test {\n    public static function create(): static {}\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC | STATIC (9)\n                byRef: false\n                name: Identifier(\n                    name: create\n                )\n                params: array(\n                )\n                returnType: Name(\n                    name: static\n                )\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/trait.test",
    "content": "Traits\n-----\n<?php\n\ntrait A {\n    public function a() {}\n}\n\nclass B {\n    use C;\n    use D {\n        a as protected b;\n        c as d;\n        e as private;\n    }\n    use E, F, G {\n        E::a insteadof F, G;\n        E::b as protected c;\n        E::d as e;\n        E::f as private;\n    }\n}\n-----\narray(\n    0: Stmt_Trait(\n        attrGroups: array(\n        )\n        name: Identifier(\n            name: A\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                byRef: false\n                name: Identifier(\n                    name: a\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n    1: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: B\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_TraitUse(\n                traits: array(\n                    0: Name(\n                        name: C\n                    )\n                )\n                adaptations: array(\n                )\n            )\n            1: Stmt_TraitUse(\n                traits: array(\n                    0: Name(\n                        name: D\n                    )\n                )\n                adaptations: array(\n                    0: Stmt_TraitUseAdaptation_Alias(\n                        trait: null\n                        method: Identifier(\n                            name: a\n                        )\n                        newModifier: PROTECTED (2)\n                        newName: Identifier(\n                            name: b\n                        )\n                    )\n                    1: Stmt_TraitUseAdaptation_Alias(\n                        trait: null\n                        method: Identifier(\n                            name: c\n                        )\n                        newModifier: null\n                        newName: Identifier(\n                            name: d\n                        )\n                    )\n                    2: Stmt_TraitUseAdaptation_Alias(\n                        trait: null\n                        method: Identifier(\n                            name: e\n                        )\n                        newModifier: PRIVATE (4)\n                        newName: null\n                    )\n                )\n            )\n            2: Stmt_TraitUse(\n                traits: array(\n                    0: Name(\n                        name: E\n                    )\n                    1: Name(\n                        name: F\n                    )\n                    2: Name(\n                        name: G\n                    )\n                )\n                adaptations: array(\n                    0: Stmt_TraitUseAdaptation_Precedence(\n                        trait: Name(\n                            name: E\n                        )\n                        method: Identifier(\n                            name: a\n                        )\n                        insteadof: array(\n                            0: Name(\n                                name: F\n                            )\n                            1: Name(\n                                name: G\n                            )\n                        )\n                    )\n                    1: Stmt_TraitUseAdaptation_Alias(\n                        trait: Name(\n                            name: E\n                        )\n                        method: Identifier(\n                            name: b\n                        )\n                        newModifier: PROTECTED (2)\n                        newName: Identifier(\n                            name: c\n                        )\n                    )\n                    2: Stmt_TraitUseAdaptation_Alias(\n                        trait: Name(\n                            name: E\n                        )\n                        method: Identifier(\n                            name: d\n                        )\n                        newModifier: null\n                        newName: Identifier(\n                            name: e\n                        )\n                    )\n                    3: Stmt_TraitUseAdaptation_Alias(\n                        trait: Name(\n                            name: E\n                        )\n                        method: Identifier(\n                            name: f\n                        )\n                        newModifier: PRIVATE (4)\n                        newName: null\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/class/typedConstants.test",
    "content": "Typed constants\n-----\n<?php\nclass Test {\n    const int X = 1;\n    private const string Y = \"a\", Z = \"b\";\n    const array ARRAY = [];\n    const Foo|Bar|null FOO = null;\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: int\n                )\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: X\n                        )\n                        value: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n            1: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: PRIVATE (4)\n                type: Identifier(\n                    name: string\n                )\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: Y\n                        )\n                        value: Scalar_String(\n                            value: a\n                        )\n                    )\n                    1: Const(\n                        name: Identifier(\n                            name: Z\n                        )\n                        value: Scalar_String(\n                            value: b\n                        )\n                    )\n                )\n            )\n            2: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: array\n                )\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: ARRAY\n                        )\n                        value: Expr_Array(\n                            items: array(\n                            )\n                        )\n                    )\n                )\n            )\n            3: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: 0\n                type: UnionType(\n                    types: array(\n                        0: Name(\n                            name: Foo\n                        )\n                        1: Name(\n                            name: Bar\n                        )\n                        2: Identifier(\n                            name: null\n                        )\n                    )\n                )\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: FOO\n                        )\n                        value: Expr_ConstFetch(\n                            name: Name(\n                                name: null\n                            )\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/const.test",
    "content": "Global constants\n-----\n<?php\n\nconst A = 0, B = 1.0, C = 'A', D = E;\n\n#[Example]\nconst WithOneAttribute = 1;\n\n#[First]\n#[Second]\nconst WithUngroupedAttriutes = 2;\n\n#[First, Second]\nconst WithGroupAttributes = 3;\n\n#[Example]\nconst ThisIsInvalid = 4,\n    AttributesOnMultipleConstants = 5;\n-----\nCannot use attributes on multiple constants at once from 15:1 to 17:38\narray(\n    0: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: A\n                )\n                value: Scalar_Int(\n                    value: 0\n                )\n            )\n            1: Const(\n                name: Identifier(\n                    name: B\n                )\n                value: Scalar_Float(\n                    value: 1\n                )\n            )\n            2: Const(\n                name: Identifier(\n                    name: C\n                )\n                value: Scalar_String(\n                    value: A\n                )\n            )\n            3: Const(\n                name: Identifier(\n                    name: D\n                )\n                value: Expr_ConstFetch(\n                    name: Name(\n                        name: E\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Const(\n        attrGroups: array(\n            0: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: Example\n                        )\n                        args: array(\n                        )\n                    )\n                )\n            )\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: WithOneAttribute\n                )\n                value: Scalar_Int(\n                    value: 1\n                )\n            )\n        )\n    )\n    2: Stmt_Const(\n        attrGroups: array(\n            0: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: First\n                        )\n                        args: array(\n                        )\n                    )\n                )\n            )\n            1: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: Second\n                        )\n                        args: array(\n                        )\n                    )\n                )\n            )\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: WithUngroupedAttriutes\n                )\n                value: Scalar_Int(\n                    value: 2\n                )\n            )\n        )\n    )\n    3: Stmt_Const(\n        attrGroups: array(\n            0: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: First\n                        )\n                        args: array(\n                        )\n                    )\n                    1: Attribute(\n                        name: Name(\n                            name: Second\n                        )\n                        args: array(\n                        )\n                    )\n                )\n            )\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: WithGroupAttributes\n                )\n                value: Scalar_Int(\n                    value: 3\n                )\n            )\n        )\n    )\n    4: Stmt_Const(\n        attrGroups: array(\n            0: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: Example\n                        )\n                        args: array(\n                        )\n                    )\n                )\n            )\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: ThisIsInvalid\n                )\n                value: Scalar_Int(\n                    value: 4\n                )\n            )\n            1: Const(\n                name: Identifier(\n                    name: AttributesOnMultipleConstants\n                )\n                value: Scalar_Int(\n                    value: 5\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/controlFlow.test",
    "content": "Control flow statements\n-----\n<?php\n\nbreak;\nbreak 2;\n\ncontinue;\ncontinue 2;\n\nreturn;\nreturn $a;\n\nthrow $e;\n\nlabel:\ngoto label;\n-----\narray(\n    0: Stmt_Break(\n        num: null\n    )\n    1: Stmt_Break(\n        num: Scalar_Int(\n            value: 2\n        )\n    )\n    2: Stmt_Continue(\n        num: null\n    )\n    3: Stmt_Continue(\n        num: Scalar_Int(\n            value: 2\n        )\n    )\n    4: Stmt_Return(\n        expr: null\n    )\n    5: Stmt_Return(\n        expr: Expr_Variable(\n            name: a\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_Throw(\n            expr: Expr_Variable(\n                name: e\n            )\n        )\n    )\n    7: Stmt_Label(\n        name: Identifier(\n            name: label\n        )\n    )\n    8: Stmt_Goto(\n        name: Identifier(\n            name: label\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/declare.test",
    "content": "Declare\n-----\n<?php\n\ndeclare (X='Y');\n\ndeclare (A='B', C='D') {\n    echo \"foo\";\n}\n\ndeclare (A='B', C='D'):\nenddeclare;\n-----\narray(\n    0: Stmt_Declare(\n        declares: array(\n            0: DeclareItem(\n                key: Identifier(\n                    name: X\n                )\n                value: Scalar_String(\n                    value: Y\n                )\n            )\n        )\n        stmts: null\n    )\n    1: Stmt_Declare(\n        declares: array(\n            0: DeclareItem(\n                key: Identifier(\n                    name: A\n                )\n                value: Scalar_String(\n                    value: B\n                )\n            )\n            1: DeclareItem(\n                key: Identifier(\n                    name: C\n                )\n                value: Scalar_String(\n                    value: D\n                )\n            )\n        )\n        stmts: array(\n            0: Stmt_Echo(\n                exprs: array(\n                    0: Scalar_String(\n                        value: foo\n                    )\n                )\n            )\n        )\n    )\n    2: Stmt_Declare(\n        declares: array(\n            0: DeclareItem(\n                key: Identifier(\n                    name: A\n                )\n                value: Scalar_String(\n                    value: B\n                )\n            )\n            1: DeclareItem(\n                key: Identifier(\n                    name: C\n                )\n                value: Scalar_String(\n                    value: D\n                )\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/echo.test",
    "content": "Echo\n-----\n<?php\n\necho 'Hallo World!';\necho 'Hallo', ' ', 'World', '!';\n-----\narray(\n    0: Stmt_Echo(\n        exprs: array(\n            0: Scalar_String(\n                value: Hallo World!\n            )\n        )\n    )\n    1: Stmt_Echo(\n        exprs: array(\n            0: Scalar_String(\n                value: Hallo\n            )\n            1: Scalar_String(\n                value:\n            )\n            2: Scalar_String(\n                value: World\n            )\n            3: Scalar_String(\n                value: !\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/builtinTypeDeclarations.test",
    "content": "Scalar type declarations\n-----\n<?php\nfunction test(bool $a, Int $b, FLOAT $c, StRiNg $d, iterable $e, object $f, mixed $g) : void {}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: bool\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: int\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: b\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            2: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: float\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: c\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            3: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: string\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: d\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            4: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: iterable\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: e\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            5: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: object\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: f\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            6: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: mixed\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: g\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: Identifier(\n            name: void\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/byRef.test",
    "content": "Return and pass by ref\n-----\n<?php\n\nfunction a(&$b) {}\nfunction &a($b) {}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: a\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: true\n                variadic: false\n                var: Expr_Variable(\n                    name: b\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: true\n        name: Identifier(\n            name: a\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: b\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/clone_function.test",
    "content": "Declaring clone function stub\n-----\n<?php\n\nfunction clone(object $object, array $withProperties = []): object {}\nclone $x;\nclone($x);\nclone($x, );\nclone($x, [ \"foo\" => $foo, \"bar\" => $bar ]);\nclone($x, $array);\nclone($x, $array, $extraParameter, $trailingComma, );\nclone(object: $x, withProperties: [ \"foo\" => $foo, \"bar\" => $bar ]);\nclone($x, withProperties: [ \"foo\" => $foo, \"bar\" => $bar ]);\nclone(object: $x);\nclone(object: $x, [ \"foo\" => $foo, \"bar\" => $bar ]);\nclone(...[\"object\" => $x, \"withProperties\" => [ \"foo\" => $foo, \"bar\" => $bar ]]);\nclone(...);\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: clone\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: object\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: object\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: array\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: withProperties\n                )\n                default: Expr_Array(\n                    items: array(\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n        returnType: Identifier(\n            name: object\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Clone(\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Clone(\n            expr: Expr_Variable(\n                name: x\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: clone\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: x\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: clone\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: x\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Array(\n                        items: array(\n                            0: ArrayItem(\n                                key: Scalar_String(\n                                    value: foo\n                                )\n                                value: Expr_Variable(\n                                    name: foo\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            1: ArrayItem(\n                                key: Scalar_String(\n                                    value: bar\n                                )\n                                value: Expr_Variable(\n                                    name: bar\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    5: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: clone\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: x\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: array\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    6: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: clone\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: x\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: array\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                2: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: extraParameter\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                3: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: trailingComma\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    7: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: clone\n            )\n            args: array(\n                0: Arg(\n                    name: Identifier(\n                        name: object\n                    )\n                    value: Expr_Variable(\n                        name: x\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: Identifier(\n                        name: withProperties\n                    )\n                    value: Expr_Array(\n                        items: array(\n                            0: ArrayItem(\n                                key: Scalar_String(\n                                    value: foo\n                                )\n                                value: Expr_Variable(\n                                    name: foo\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            1: ArrayItem(\n                                key: Scalar_String(\n                                    value: bar\n                                )\n                                value: Expr_Variable(\n                                    name: bar\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    8: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: clone\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Variable(\n                        name: x\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: Identifier(\n                        name: withProperties\n                    )\n                    value: Expr_Array(\n                        items: array(\n                            0: ArrayItem(\n                                key: Scalar_String(\n                                    value: foo\n                                )\n                                value: Expr_Variable(\n                                    name: foo\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            1: ArrayItem(\n                                key: Scalar_String(\n                                    value: bar\n                                )\n                                value: Expr_Variable(\n                                    name: bar\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    9: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: clone\n            )\n            args: array(\n                0: Arg(\n                    name: Identifier(\n                        name: object\n                    )\n                    value: Expr_Variable(\n                        name: x\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    10: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: clone\n            )\n            args: array(\n                0: Arg(\n                    name: Identifier(\n                        name: object\n                    )\n                    value: Expr_Variable(\n                        name: x\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: Arg(\n                    name: null\n                    value: Expr_Array(\n                        items: array(\n                            0: ArrayItem(\n                                key: Scalar_String(\n                                    value: foo\n                                )\n                                value: Expr_Variable(\n                                    name: foo\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            1: ArrayItem(\n                                key: Scalar_String(\n                                    value: bar\n                                )\n                                value: Expr_Variable(\n                                    name: bar\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    11: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: clone\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_Array(\n                        items: array(\n                            0: ArrayItem(\n                                key: Scalar_String(\n                                    value: object\n                                )\n                                value: Expr_Variable(\n                                    name: x\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                            1: ArrayItem(\n                                key: Scalar_String(\n                                    value: withProperties\n                                )\n                                value: Expr_Array(\n                                    items: array(\n                                        0: ArrayItem(\n                                            key: Scalar_String(\n                                                value: foo\n                                            )\n                                            value: Expr_Variable(\n                                                name: foo\n                                            )\n                                            byRef: false\n                                            unpack: false\n                                        )\n                                        1: ArrayItem(\n                                            key: Scalar_String(\n                                                value: bar\n                                            )\n                                            value: Expr_Variable(\n                                                name: bar\n                                            )\n                                            byRef: false\n                                            unpack: false\n                                        )\n                                    )\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                    byRef: false\n                    unpack: true\n                )\n            )\n        )\n    )\n    12: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: clone\n            )\n            args: array(\n                0: VariadicPlaceholder(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/conditional.test",
    "content": "Conditional function definition\n-----\n<?php\n\nif (true) {\n    function A() {}\n}\n-----\narray(\n    0: Stmt_If(\n        cond: Expr_ConstFetch(\n            name: Name(\n                name: true\n            )\n        )\n        stmts: array(\n            0: Stmt_Function(\n                attrGroups: array(\n                )\n                byRef: false\n                name: Identifier(\n                    name: A\n                )\n                params: array(\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n        elseifs: array(\n        )\n        else: null\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/defaultValues.test",
    "content": "Default values (static scalar tests)\n-----\n<?php\n\nfunction a(\n    $b = null,\n    $c = 'foo',\n    $d = A::B,\n    $f = +1,\n    $g = -1.0,\n    $h = array(),\n    $i = [],\n    $j = ['foo'],\n    $k = ['foo', 'bar' => 'baz']\n) {}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: a\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: b\n                )\n                default: Expr_ConstFetch(\n                    name: Name(\n                        name: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: c\n                )\n                default: Scalar_String(\n                    value: foo\n                )\n                hooks: array(\n                )\n            )\n            2: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: d\n                )\n                default: Expr_ClassConstFetch(\n                    class: Name(\n                        name: A\n                    )\n                    name: Identifier(\n                        name: B\n                    )\n                )\n                hooks: array(\n                )\n            )\n            3: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: f\n                )\n                default: Expr_UnaryPlus(\n                    expr: Scalar_Int(\n                        value: 1\n                    )\n                )\n                hooks: array(\n                )\n            )\n            4: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: g\n                )\n                default: Expr_UnaryMinus(\n                    expr: Scalar_Float(\n                        value: 1\n                    )\n                )\n                hooks: array(\n                )\n            )\n            5: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: h\n                )\n                default: Expr_Array(\n                    items: array(\n                    )\n                )\n                hooks: array(\n                )\n            )\n            6: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: i\n                )\n                default: Expr_Array(\n                    items: array(\n                    )\n                )\n                hooks: array(\n                )\n            )\n            7: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: j\n                )\n                default: Expr_Array(\n                    items: array(\n                        0: ArrayItem(\n                            key: null\n                            value: Scalar_String(\n                                value: foo\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n                hooks: array(\n                )\n            )\n            8: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: k\n                )\n                default: Expr_Array(\n                    items: array(\n                        0: ArrayItem(\n                            key: null\n                            value: Scalar_String(\n                                value: foo\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                        1: ArrayItem(\n                            key: Scalar_String(\n                                value: bar\n                            )\n                            value: Scalar_String(\n                                value: baz\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/disjointNormalFormTypes.test",
    "content": "DNF types\n-----\n<?php\n\nclass Test {\n    public (A&B)|(X&Y) $prop;\n    public readonly (A&B)|C $prop2;\n}\n\nfunction test((A&B)|(X&Y) $a): (A&B)|(X&Y) {}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: UnionType(\n                    types: array(\n                        0: IntersectionType(\n                            types: array(\n                                0: Name(\n                                    name: A\n                                )\n                                1: Name(\n                                    name: B\n                                )\n                            )\n                        )\n                        1: IntersectionType(\n                            types: array(\n                                0: Name(\n                                    name: X\n                                )\n                                1: Name(\n                                    name: Y\n                                )\n                            )\n                        )\n                    )\n                )\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC | READONLY (65)\n                type: UnionType(\n                    types: array(\n                        0: IntersectionType(\n                            types: array(\n                                0: Name(\n                                    name: A\n                                )\n                                1: Name(\n                                    name: B\n                                )\n                            )\n                        )\n                        1: Name(\n                            name: C\n                        )\n                    )\n                )\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop2\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: UnionType(\n                    types: array(\n                        0: IntersectionType(\n                            types: array(\n                                0: Name(\n                                    name: A\n                                )\n                                1: Name(\n                                    name: B\n                                )\n                            )\n                        )\n                        1: IntersectionType(\n                            types: array(\n                                0: Name(\n                                    name: X\n                                )\n                                1: Name(\n                                    name: Y\n                                )\n                            )\n                        )\n                    )\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: UnionType(\n            types: array(\n                0: IntersectionType(\n                    types: array(\n                        0: Name(\n                            name: A\n                        )\n                        1: Name(\n                            name: B\n                        )\n                    )\n                )\n                1: IntersectionType(\n                    types: array(\n                        0: Name(\n                            name: X\n                        )\n                        1: Name(\n                            name: Y\n                        )\n                    )\n                )\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/exit_die_function.test",
    "content": "Declaring exit and die function stubs\n-----\n<?php\n\nfunction exit(string|int $status = 0): never {}\n\nfunction die(string|int $status = 0): never {}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: exit\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: UnionType(\n                    types: array(\n                        0: Identifier(\n                            name: string\n                        )\n                        1: Identifier(\n                            name: int\n                        )\n                    )\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: status\n                )\n                default: Scalar_Int(\n                    value: 0\n                )\n                hooks: array(\n                )\n            )\n        )\n        returnType: Identifier(\n            name: never\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: die\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: UnionType(\n                    types: array(\n                        0: Identifier(\n                            name: string\n                        )\n                        1: Identifier(\n                            name: int\n                        )\n                    )\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: status\n                )\n                default: Scalar_Int(\n                    value: 0\n                )\n                hooks: array(\n                )\n            )\n        )\n        returnType: Identifier(\n            name: never\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/fn.test",
    "content": "Function with the name fn\n-----\n<?php\nfunction fn() {}\n-----\n!!version=7.3\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: fn\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/intersectionTypes.test",
    "content": "Union types\n-----\n<?php\n\nclass Test {\n    public A&B $prop;\n}\n\nfunction test(A&B $a): A&B {}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: IntersectionType(\n                    types: array(\n                        0: Name(\n                            name: A\n                        )\n                        1: Name(\n                            name: B\n                        )\n                    )\n                )\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: IntersectionType(\n                    types: array(\n                        0: Name(\n                            name: A\n                        )\n                        1: Name(\n                            name: B\n                        )\n                    )\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: IntersectionType(\n            types: array(\n                0: Name(\n                    name: A\n                )\n                1: Name(\n                    name: B\n                )\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/invalidVoidParam.test",
    "content": "Invalid parameter with type void\n-----\n<?php\nfunction foo(void $foo) {}\n-----\nvoid cannot be used as a parameter type from 2:14 to 2:17\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: void\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: foo\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/neverType.test",
    "content": "Never type\n-----\n<?php\nfunction test(): never {}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n        )\n        returnType: Identifier(\n            name: never\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/nullFalseTrueTypes.test",
    "content": "standalone null, false and true types\n-----\n<?php\n\nfunction test(): null {}\nfunction test(): false {}\nfunction test(): true {}\n-----\n!!version=8.1\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n        )\n        returnType: Identifier(\n            name: null\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n        )\n        returnType: Identifier(\n            name: false\n        )\n        stmts: array(\n        )\n    )\n    2: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n        )\n        returnType: Name(\n            name: true\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php\n\nfunction test(): null {}\nfunction test(): false {}\nfunction test(): true {}\n-----\n!!version=8.2\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n        )\n        returnType: Identifier(\n            name: null\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n        )\n        returnType: Identifier(\n            name: false\n        )\n        stmts: array(\n        )\n    )\n    2: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n        )\n        returnType: Identifier(\n            name: true\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/nullableTypes.test",
    "content": "Nullable types\n-----\n<?php\n\nfunction test(?Foo $bar, ?string $foo) : ?Baz {\n}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: NullableType(\n                    type: Name(\n                        name: Foo\n                    )\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: bar\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: NullableType(\n                    type: Identifier(\n                        name: string\n                    )\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: foo\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: NullableType(\n            type: Name(\n                name: Baz\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/parameters_trailing_comma.test",
    "content": "Trailing comma in parameter list\n-----\n<?php\n\nfunction foo($bar, ) {\n}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: bar\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n-----\n<?php\n\nclass Foo\n{\n    function __construct($name, $value, )\n    {\n    }\n}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Foo\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassMethod(\n                attrGroups: array(\n                )\n                flags: 0\n                byRef: false\n                name: Identifier(\n                    name: __construct\n                )\n                params: array(\n                    0: Param(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: name\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                    1: Param(\n                        attrGroups: array(\n                        )\n                        flags: 0\n                        type: null\n                        byRef: false\n                        variadic: false\n                        var: Expr_Variable(\n                            name: value\n                        )\n                        default: null\n                        hooks: array(\n                        )\n                    )\n                )\n                returnType: null\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n-----\n<?php\nfn($foo, ) => $bar;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_ArrowFunction(\n            attrGroups: array(\n            )\n            static: false\n            byRef: false\n            params: array(\n                0: Param(\n                    attrGroups: array(\n                    )\n                    flags: 0\n                    type: null\n                    byRef: false\n                    variadic: false\n                    var: Expr_Variable(\n                        name: foo\n                    )\n                    default: null\n                    hooks: array(\n                    )\n                )\n            )\n            returnType: null\n            expr: Expr_Variable(\n                name: bar\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/readonlyFunction.test",
    "content": "readonly function\n-----\n<?php\nfunction readonly() {}\nreadonly();\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: readonly\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: readonly\n            )\n            args: array(\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/returnTypes.test",
    "content": "Return type declarations\n-----\n<?php\n\nfunction test1() {}\nfunction test2() : array {}\nfunction test3() : callable {}\nfunction test4() : Foo\\Bar {}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test1\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test2\n        )\n        params: array(\n        )\n        returnType: Identifier(\n            name: array\n        )\n        stmts: array(\n        )\n    )\n    2: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test3\n        )\n        params: array(\n        )\n        returnType: Identifier(\n            name: callable\n        )\n        stmts: array(\n        )\n    )\n    3: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test4\n        )\n        params: array(\n        )\n        returnType: Name(\n            name: Foo\\Bar\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/specialVars.test",
    "content": "Special function variables\n-----\n<?php\n\nfunction a() {\n    global $a, ${'b'}, $$c;\n    static $c, $d = 'e';\n}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: a\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Global(\n                vars: array(\n                    0: Expr_Variable(\n                        name: a\n                    )\n                    1: Expr_Variable(\n                        name: Scalar_String(\n                            value: b\n                        )\n                    )\n                    2: Expr_Variable(\n                        name: Expr_Variable(\n                            name: c\n                        )\n                    )\n                )\n            )\n            1: Stmt_Static(\n                vars: array(\n                    0: StaticVar(\n                        var: Expr_Variable(\n                            name: c\n                        )\n                        default: null\n                    )\n                    1: StaticVar(\n                        var: Expr_Variable(\n                            name: d\n                        )\n                        default: Scalar_String(\n                            value: e\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/typeDeclarations.test",
    "content": "Type hints\n-----\n<?php\n\nfunction a($b, array $c, callable $d, E $f) {}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: a\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: b\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: array\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: c\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            2: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: callable\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: d\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            3: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: E\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: f\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/typeVersions.test",
    "content": "Types by version\n-----\n<?php\nfunction test(\n    bool $a1, int $a2, float $a3, string $a4, // PHP 7.0\n    iterable $a5, // PHP 7.1\n    object $a6, // PHP 7.2\n    mixed $a7, // PHP 8.0\n    null $a8, // PHP 8.0\n    false $a9, // PHP 8.0\n): void {} // PHP 7.1\nfunction test2(): never {} // PHP 8.1\n-----\n!!version=5.6\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: bool\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a1\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: int\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a2\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            2: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: float\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a3\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            3: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: string\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a4\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            4: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: iterable\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a5\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.0\n                )\n            )\n            5: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: object\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a6\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.1\n                )\n            )\n            6: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: mixed\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a7\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.2\n                )\n            )\n            7: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: null\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a8\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n            8: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: false\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a9\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n        )\n        returnType: Name(\n            name: void\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test2\n        )\n        params: array(\n        )\n        returnType: Name(\n            name: never\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // PHP 7.1\n        )\n    )\n    2: Stmt_Nop(\n        comments: array(\n            0: // PHP 8.1\n        )\n    )\n)\n-----\n<?php\nfunction test(\n    bool $a1, int $a2, float $a3, string $a4, // PHP 7.0\n    iterable $a5, // PHP 7.1\n    object $a6, // PHP 7.2\n    mixed $a7, // PHP 8.0\n    null $a8, // PHP 8.0\n    false $a9, // PHP 8.0\n): void {} // PHP 7.1\nfunction test2(): never {} // PHP 8.1\n-----\n!!version=7.0\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: bool\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a1\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: int\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a2\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            2: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: float\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a3\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            3: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: string\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a4\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            4: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: iterable\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a5\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.0\n                )\n            )\n            5: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: object\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a6\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.1\n                )\n            )\n            6: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: mixed\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a7\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.2\n                )\n            )\n            7: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: null\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a8\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n            8: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: false\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a9\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n        )\n        returnType: Name(\n            name: void\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test2\n        )\n        params: array(\n        )\n        returnType: Name(\n            name: never\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // PHP 7.1\n        )\n    )\n    2: Stmt_Nop(\n        comments: array(\n            0: // PHP 8.1\n        )\n    )\n)\n-----\n<?php\nfunction test(\n    bool $a1, int $a2, float $a3, string $a4, // PHP 7.0\n    iterable $a5, // PHP 7.1\n    object $a6, // PHP 7.2\n    mixed $a7, // PHP 8.0\n    null $a8, // PHP 8.0\n    false $a9, // PHP 8.0\n): void {} // PHP 7.1\nfunction test2(): never {} // PHP 8.1\n-----\n!!version=7.1\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: bool\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a1\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: int\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a2\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            2: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: float\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a3\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            3: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: string\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a4\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            4: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: iterable\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a5\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.0\n                )\n            )\n            5: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: object\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a6\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.1\n                )\n            )\n            6: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: mixed\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a7\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.2\n                )\n            )\n            7: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: null\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a8\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n            8: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: false\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a9\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n        )\n        returnType: Identifier(\n            name: void\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test2\n        )\n        params: array(\n        )\n        returnType: Name(\n            name: never\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // PHP 7.1\n        )\n    )\n    2: Stmt_Nop(\n        comments: array(\n            0: // PHP 8.1\n        )\n    )\n)\n-----\n<?php\nfunction test(\n    bool $a1, int $a2, float $a3, string $a4, // PHP 7.0\n    iterable $a5, // PHP 7.1\n    object $a6, // PHP 7.2\n    mixed $a7, // PHP 8.0\n    null $a8, // PHP 8.0\n    false $a9, // PHP 8.0\n): void {} // PHP 7.1\nfunction test2(): never {} // PHP 8.1\n-----\n!!version=7.2\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: bool\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a1\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: int\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a2\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            2: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: float\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a3\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            3: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: string\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a4\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            4: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: iterable\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a5\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.0\n                )\n            )\n            5: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: object\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a6\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.1\n                )\n            )\n            6: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: mixed\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a7\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.2\n                )\n            )\n            7: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: null\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a8\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n            8: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: false\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a9\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n        )\n        returnType: Identifier(\n            name: void\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test2\n        )\n        params: array(\n        )\n        returnType: Name(\n            name: never\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // PHP 7.1\n        )\n    )\n    2: Stmt_Nop(\n        comments: array(\n            0: // PHP 8.1\n        )\n    )\n)\n-----\n<?php\nfunction test(\n    bool $a1, int $a2, float $a3, string $a4, // PHP 7.0\n    iterable $a5, // PHP 7.1\n    object $a6, // PHP 7.2\n    mixed $a7, // PHP 8.0\n    null $a8, // PHP 8.0\n    false $a9, // PHP 8.0\n): void {} // PHP 7.1\nfunction test2(): never {} // PHP 8.1\n-----\n!!version=8.0\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: bool\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a1\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: int\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a2\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            2: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: float\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a3\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            3: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: string\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a4\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            4: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: iterable\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a5\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.0\n                )\n            )\n            5: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: object\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a6\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.1\n                )\n            )\n            6: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: mixed\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a7\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.2\n                )\n            )\n            7: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: null\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a8\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n            8: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: false\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a9\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n        )\n        returnType: Identifier(\n            name: void\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test2\n        )\n        params: array(\n        )\n        returnType: Name(\n            name: never\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // PHP 7.1\n        )\n    )\n    2: Stmt_Nop(\n        comments: array(\n            0: // PHP 8.1\n        )\n    )\n)\n-----\n<?php\nfunction test(\n    bool $a1, int $a2, float $a3, string $a4, // PHP 7.0\n    iterable $a5, // PHP 7.1\n    object $a6, // PHP 7.2\n    mixed $a7, // PHP 8.0\n    null $a8, // PHP 8.0\n    false $a9, // PHP 8.0\n): void {} // PHP 7.1\nfunction test2(): never {} // PHP 8.1\n-----\n!!version=8.1\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: bool\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a1\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: int\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a2\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            2: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: float\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a3\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            3: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: string\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a4\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            4: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: iterable\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a5\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.0\n                )\n            )\n            5: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: object\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a6\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.1\n                )\n            )\n            6: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: mixed\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a7\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 7.2\n                )\n            )\n            7: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: null\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a8\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n            8: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Identifier(\n                    name: false\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a9\n                )\n                default: null\n                hooks: array(\n                )\n                comments: array(\n                    0: // PHP 8.0\n                )\n            )\n        )\n        returnType: Identifier(\n            name: void\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test2\n        )\n        params: array(\n        )\n        returnType: Identifier(\n            name: never\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // PHP 7.1\n        )\n    )\n    2: Stmt_Nop(\n        comments: array(\n            0: // PHP 8.1\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/unionTypes.test",
    "content": "Union types\n-----\n<?php\n\nclass Test {\n    public A|iterable|null $prop;\n}\n\nfunction test(A|B $a): int|false {}\n-----\narray(\n    0: Stmt_Class(\n        attrGroups: array(\n        )\n        flags: 0\n        name: Identifier(\n            name: Test\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: UnionType(\n                    types: array(\n                        0: Name(\n                            name: A\n                        )\n                        1: Identifier(\n                            name: iterable\n                        )\n                        2: Identifier(\n                            name: null\n                        )\n                    )\n                )\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: null\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: UnionType(\n                    types: array(\n                        0: Name(\n                            name: A\n                        )\n                        1: Name(\n                            name: B\n                        )\n                    )\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: UnionType(\n            types: array(\n                0: Identifier(\n                    name: int\n                )\n                1: Identifier(\n                    name: false\n                )\n            )\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/validVoidParam.test",
    "content": "Valid parameter with type void\n-----\n<?php\nfunction foo(void $foo) {}\n-----\n!!version=7.0\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: void\n                )\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: foo\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/variadic.test",
    "content": "Variadic functions\n-----\n<?php\nfunction test($a, ... $b) {}\nfunction test($a, &... $b) {}\nfunction test($a, Type ... $b) {}\nfunction test($a, Type &... $b) {}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: true\n                var: Expr_Variable(\n                    name: b\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: true\n                variadic: true\n                var: Expr_Variable(\n                    name: b\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n    2: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: Type\n                )\n                byRef: false\n                variadic: true\n                var: Expr_Variable(\n                    name: b\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n    3: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: test\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: a\n                )\n                default: null\n                hooks: array(\n                )\n            )\n            1: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: Name(\n                    name: Type\n                )\n                byRef: true\n                variadic: true\n                var: Expr_Variable(\n                    name: b\n                )\n                default: null\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/function/variadicDefaultValue.test",
    "content": "Invalid variadic function\n-----\n<?php\nfunction foo(...$foo = []) {}\n-----\nVariadic parameter cannot have a default value from 2:24 to 2:25\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: foo\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: true\n                var: Expr_Variable(\n                    name: foo\n                )\n                default: Expr_Array(\n                    items: array(\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/generator/basic.test",
    "content": "Generators (yield expression)\n-----\n<?php\n\nfunction gen() {\n    // statements\n    yield;\n    yield $value;\n    yield $key => $value;\n\n    // expressions\n    $data = yield;\n    $data = (yield $value);\n    $data = (yield $key => $value);\n\n    // yield in language constructs with their own parentheses\n    if (yield $foo); elseif (yield $foo);\n    if (yield $foo): elseif (yield $foo): endif;\n    while (yield $foo);\n    do {} while (yield $foo);\n    switch (yield $foo) {}\n    die(yield $foo);\n\n    // yield in function calls\n    func(yield $foo);\n    $foo->func(yield $foo);\n    new Foo(yield $foo);\n\n    yield from $foo;\n    yield from $foo and yield from $bar;\n    yield from $foo + $bar;\n}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: gen\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Yield(\n                    key: null\n                    value: null\n                )\n                comments: array(\n                    0: // statements\n                )\n            )\n            1: Stmt_Expression(\n                expr: Expr_Yield(\n                    key: null\n                    value: Expr_Variable(\n                        name: value\n                    )\n                )\n            )\n            2: Stmt_Expression(\n                expr: Expr_Yield(\n                    key: Expr_Variable(\n                        name: key\n                    )\n                    value: Expr_Variable(\n                        name: value\n                    )\n                )\n            )\n            3: Stmt_Expression(\n                expr: Expr_Assign(\n                    var: Expr_Variable(\n                        name: data\n                    )\n                    expr: Expr_Yield(\n                        key: null\n                        value: null\n                    )\n                )\n                comments: array(\n                    0: // expressions\n                )\n            )\n            4: Stmt_Expression(\n                expr: Expr_Assign(\n                    var: Expr_Variable(\n                        name: data\n                    )\n                    expr: Expr_Yield(\n                        key: null\n                        value: Expr_Variable(\n                            name: value\n                        )\n                    )\n                )\n            )\n            5: Stmt_Expression(\n                expr: Expr_Assign(\n                    var: Expr_Variable(\n                        name: data\n                    )\n                    expr: Expr_Yield(\n                        key: Expr_Variable(\n                            name: key\n                        )\n                        value: Expr_Variable(\n                            name: value\n                        )\n                    )\n                )\n            )\n            6: Stmt_If(\n                cond: Expr_Yield(\n                    key: null\n                    value: Expr_Variable(\n                        name: foo\n                    )\n                )\n                stmts: array(\n                )\n                elseifs: array(\n                    0: Stmt_ElseIf(\n                        cond: Expr_Yield(\n                            key: null\n                            value: Expr_Variable(\n                                name: foo\n                            )\n                        )\n                        stmts: array(\n                        )\n                    )\n                )\n                else: null\n                comments: array(\n                    0: // yield in language constructs with their own parentheses\n                )\n            )\n            7: Stmt_If(\n                cond: Expr_Yield(\n                    key: null\n                    value: Expr_Variable(\n                        name: foo\n                    )\n                )\n                stmts: array(\n                )\n                elseifs: array(\n                    0: Stmt_ElseIf(\n                        cond: Expr_Yield(\n                            key: null\n                            value: Expr_Variable(\n                                name: foo\n                            )\n                        )\n                        stmts: array(\n                        )\n                    )\n                )\n                else: null\n            )\n            8: Stmt_While(\n                cond: Expr_Yield(\n                    key: null\n                    value: Expr_Variable(\n                        name: foo\n                    )\n                )\n                stmts: array(\n                )\n            )\n            9: Stmt_Do(\n                stmts: array(\n                )\n                cond: Expr_Yield(\n                    key: null\n                    value: Expr_Variable(\n                        name: foo\n                    )\n                )\n            )\n            10: Stmt_Switch(\n                cond: Expr_Yield(\n                    key: null\n                    value: Expr_Variable(\n                        name: foo\n                    )\n                )\n                cases: array(\n                )\n            )\n            11: Stmt_Expression(\n                expr: Expr_Exit(\n                    expr: Expr_Yield(\n                        key: null\n                        value: Expr_Variable(\n                            name: foo\n                        )\n                    )\n                )\n            )\n            12: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name(\n                        name: func\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Expr_Yield(\n                                key: null\n                                value: Expr_Variable(\n                                    name: foo\n                                )\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n                comments: array(\n                    0: // yield in function calls\n                )\n            )\n            13: Stmt_Expression(\n                expr: Expr_MethodCall(\n                    var: Expr_Variable(\n                        name: foo\n                    )\n                    name: Identifier(\n                        name: func\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Expr_Yield(\n                                key: null\n                                value: Expr_Variable(\n                                    name: foo\n                                )\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n            )\n            14: Stmt_Expression(\n                expr: Expr_New(\n                    class: Name(\n                        name: Foo\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Expr_Yield(\n                                key: null\n                                value: Expr_Variable(\n                                    name: foo\n                                )\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n            )\n            15: Stmt_Expression(\n                expr: Expr_YieldFrom(\n                    expr: Expr_Variable(\n                        name: foo\n                    )\n                )\n            )\n            16: Stmt_Expression(\n                expr: Expr_BinaryOp_LogicalAnd(\n                    left: Expr_YieldFrom(\n                        expr: Expr_Variable(\n                            name: foo\n                        )\n                    )\n                    right: Expr_YieldFrom(\n                        expr: Expr_Variable(\n                            name: bar\n                        )\n                    )\n                )\n            )\n            17: Stmt_Expression(\n                expr: Expr_YieldFrom(\n                    expr: Expr_BinaryOp_Plus(\n                        left: Expr_Variable(\n                            name: foo\n                        )\n                        right: Expr_Variable(\n                            name: bar\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/generator/yieldPrecedence.test",
    "content": "Yield operator precedence\n-----\n<?php\n\nfunction gen() {\n    yield \"a\" . \"b\";\n    yield \"a\" or die;\n    yield \"k\" => \"a\" . \"b\";\n    yield \"k\" => \"a\" or die;\n    var_dump([yield \"k\" => \"a\" . \"b\"]);\n    yield yield \"k1\" => yield \"k2\" => \"a\" . \"b\";\n    yield yield \"k1\" => (yield \"k2\") => \"a\" . \"b\";\n    var_dump([yield \"k1\" => yield \"k2\" => \"a\" . \"b\"]);\n    var_dump([yield \"k1\" => (yield \"k2\") => \"a\" . \"b\"]);\n}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: gen\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Yield(\n                    key: null\n                    value: Expr_BinaryOp_Concat(\n                        left: Scalar_String(\n                            value: a\n                        )\n                        right: Scalar_String(\n                            value: b\n                        )\n                    )\n                )\n            )\n            1: Stmt_Expression(\n                expr: Expr_BinaryOp_LogicalOr(\n                    left: Expr_Yield(\n                        key: null\n                        value: Scalar_String(\n                            value: a\n                        )\n                    )\n                    right: Expr_Exit(\n                        expr: null\n                    )\n                )\n            )\n            2: Stmt_Expression(\n                expr: Expr_Yield(\n                    key: Scalar_String(\n                        value: k\n                    )\n                    value: Expr_BinaryOp_Concat(\n                        left: Scalar_String(\n                            value: a\n                        )\n                        right: Scalar_String(\n                            value: b\n                        )\n                    )\n                )\n            )\n            3: Stmt_Expression(\n                expr: Expr_BinaryOp_LogicalOr(\n                    left: Expr_Yield(\n                        key: Scalar_String(\n                            value: k\n                        )\n                        value: Scalar_String(\n                            value: a\n                        )\n                    )\n                    right: Expr_Exit(\n                        expr: null\n                    )\n                )\n            )\n            4: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name(\n                        name: var_dump\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Expr_Array(\n                                items: array(\n                                    0: ArrayItem(\n                                        key: null\n                                        value: Expr_Yield(\n                                            key: Scalar_String(\n                                                value: k\n                                            )\n                                            value: Expr_BinaryOp_Concat(\n                                                left: Scalar_String(\n                                                    value: a\n                                                )\n                                                right: Scalar_String(\n                                                    value: b\n                                                )\n                                            )\n                                        )\n                                        byRef: false\n                                        unpack: false\n                                    )\n                                )\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n            )\n            5: Stmt_Expression(\n                expr: Expr_Yield(\n                    key: null\n                    value: Expr_Yield(\n                        key: Scalar_String(\n                            value: k1\n                        )\n                        value: Expr_Yield(\n                            key: Scalar_String(\n                                value: k2\n                            )\n                            value: Expr_BinaryOp_Concat(\n                                left: Scalar_String(\n                                    value: a\n                                )\n                                right: Scalar_String(\n                                    value: b\n                                )\n                            )\n                        )\n                    )\n                )\n            )\n            6: Stmt_Expression(\n                expr: Expr_Yield(\n                    key: Expr_Yield(\n                        key: Scalar_String(\n                            value: k1\n                        )\n                        value: Expr_Yield(\n                            key: null\n                            value: Scalar_String(\n                                value: k2\n                            )\n                        )\n                    )\n                    value: Expr_BinaryOp_Concat(\n                        left: Scalar_String(\n                            value: a\n                        )\n                        right: Scalar_String(\n                            value: b\n                        )\n                    )\n                )\n            )\n            7: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name(\n                        name: var_dump\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Expr_Array(\n                                items: array(\n                                    0: ArrayItem(\n                                        key: null\n                                        value: Expr_Yield(\n                                            key: Scalar_String(\n                                                value: k1\n                                            )\n                                            value: Expr_Yield(\n                                                key: Scalar_String(\n                                                    value: k2\n                                                )\n                                                value: Expr_BinaryOp_Concat(\n                                                    left: Scalar_String(\n                                                        value: a\n                                                    )\n                                                    right: Scalar_String(\n                                                        value: b\n                                                    )\n                                                )\n                                            )\n                                        )\n                                        byRef: false\n                                        unpack: false\n                                    )\n                                )\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n            )\n            8: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name(\n                        name: var_dump\n                    )\n                    args: array(\n                        0: Arg(\n                            name: null\n                            value: Expr_Array(\n                                items: array(\n                                    0: ArrayItem(\n                                        key: Expr_Yield(\n                                            key: Scalar_String(\n                                                value: k1\n                                            )\n                                            value: Expr_Yield(\n                                                key: null\n                                                value: Scalar_String(\n                                                    value: k2\n                                                )\n                                            )\n                                        )\n                                        value: Expr_BinaryOp_Concat(\n                                            left: Scalar_String(\n                                                value: a\n                                            )\n                                            right: Scalar_String(\n                                                value: b\n                                            )\n                                        )\n                                        byRef: false\n                                        unpack: false\n                                    )\n                                )\n                            )\n                            byRef: false\n                            unpack: false\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/generator/yieldUnaryPrecedence.test",
    "content": "Yield with unary operator argument\n-----\n<?php\n\nfunction gen() {\n    yield +1;\n    yield -1;\n    yield * -1;\n}\n-----\narray(\n    0: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: gen\n        )\n        params: array(\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Yield(\n                    key: null\n                    value: Expr_UnaryPlus(\n                        expr: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n            1: Stmt_Expression(\n                expr: Expr_Yield(\n                    key: null\n                    value: Expr_UnaryMinus(\n                        expr: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n            2: Stmt_Expression(\n                expr: Expr_BinaryOp_Mul(\n                    left: Expr_Yield(\n                        key: null\n                        value: null\n                    )\n                    right: Expr_UnaryMinus(\n                        expr: Scalar_Int(\n                            value: 1\n                        )\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/haltCompiler.test",
    "content": "__halt_compiler\n-----\n<?php\n\n$a;\n__halt_compiler()\n?>\nHallo World!\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Variable(\n            name: a\n        )\n    )\n    1: Stmt_HaltCompiler(\n        remaining: Hallo World!\n    )\n)\n-----\n<?php\n\n$a;\n__halt_compiler();Hallo World!\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Variable(\n            name: a\n        )\n    )\n    1: Stmt_HaltCompiler(\n        remaining: Hallo World!\n    )\n)\n-----\n<?php\n\nnamespace A;\n$a;\n__halt_compiler();\n-----\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: A\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: a\n                )\n            )\n        )\n    )\n    1: Stmt_HaltCompiler(\n        remaining:\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/haltCompilerInvalidSyntax.test",
    "content": "Invalid __halt_compiler() syntax\n-----\n<?php\n__halt_compiler()\n-----\nSyntax error, unexpected EOF, expecting ';' from 2:18 to 2:18\narray(\n)\n"
  },
  {
    "path": "test/code/parser/stmt/haltCompilerOffset.test",
    "content": "Use of __HALT_COMPILER_OFFSET__ constant\n-----\n<?php\n\nvar_dump(__HALT_COMPILER_OFFSET__);\n__halt_compiler();\nFoo\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: var_dump\n            )\n            args: array(\n                0: Arg(\n                    name: null\n                    value: Expr_ConstFetch(\n                        name: Name(\n                            name: __HALT_COMPILER_OFFSET__\n                        )\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n    )\n    1: Stmt_HaltCompiler(\n        remaining:\n        Foo\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/haltCompilerOutermostScope.test",
    "content": "__halt_compiler can only be used from outermost scope\n-----\n<?php\nif (true) {\n    __halt_compiler();\n}\n-----\n__HALT_COMPILER() can only be used from the outermost scope from 3:5 to 3:19\n"
  },
  {
    "path": "test/code/parser/stmt/hashbang.test",
    "content": "Hashbang line\n-----\n#!/usr/bin/env php\n<?php\n\necho \"foobar\";\n\n?>\n#!/usr/bin/env php\n-----\narray(\n    0: Stmt_InlineHTML(\n        value: #!/usr/bin/env php\n\n    )\n    1: Stmt_Echo(\n        exprs: array(\n            0: Scalar_String(\n                value: foobar\n            )\n        )\n    )\n    2: Stmt_InlineHTML(\n        value: #!/usr/bin/env php\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/if.test",
    "content": "If/Elseif/Else\n-----\n<?php\n\nif      ($a) {}\nelseif  ($b) {}\nelseif  ($c) {}\nelse         {}\n\nif ($a) {} // without else\n\nif      ($a):\nelseif  ($b):\nelseif  ($c):\nelse        :\nendif;\n\nif ($a): endif; // without else\n-----\narray(\n    0: Stmt_If(\n        cond: Expr_Variable(\n            name: a\n        )\n        stmts: array(\n        )\n        elseifs: array(\n            0: Stmt_ElseIf(\n                cond: Expr_Variable(\n                    name: b\n                )\n                stmts: array(\n                )\n            )\n            1: Stmt_ElseIf(\n                cond: Expr_Variable(\n                    name: c\n                )\n                stmts: array(\n                )\n            )\n        )\n        else: Stmt_Else(\n            stmts: array(\n            )\n        )\n    )\n    1: Stmt_If(\n        cond: Expr_Variable(\n            name: a\n        )\n        stmts: array(\n        )\n        elseifs: array(\n        )\n        else: null\n    )\n    2: Stmt_If(\n        cond: Expr_Variable(\n            name: a\n        )\n        stmts: array(\n        )\n        elseifs: array(\n            0: Stmt_ElseIf(\n                cond: Expr_Variable(\n                    name: b\n                )\n                stmts: array(\n                )\n            )\n            1: Stmt_ElseIf(\n                cond: Expr_Variable(\n                    name: c\n                )\n                stmts: array(\n                )\n            )\n        )\n        else: Stmt_Else(\n            stmts: array(\n            )\n        )\n        comments: array(\n            0: // without else\n        )\n    )\n    3: Stmt_If(\n        cond: Expr_Variable(\n            name: a\n        )\n        stmts: array(\n        )\n        elseifs: array(\n        )\n        else: null\n    )\n    4: Stmt_Nop(\n        comments: array(\n            0: // without else\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/inlineHTML.test",
    "content": "Inline HTML\n-----\n<?php\n$a;\n?>\nB\n<?php\n$c;\n?>\n<?php\n$d;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Variable(\n            name: a\n        )\n    )\n    1: Stmt_InlineHTML(\n        value: B\n\n    )\n    2: Stmt_Expression(\n        expr: Expr_Variable(\n            name: c\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_Variable(\n            name: d\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/loop/do.test",
    "content": "Do loop\n-----\n<?php\n\ndo {\n\n} while ($a);\n-----\narray(\n    0: Stmt_Do(\n        stmts: array(\n        )\n        cond: Expr_Variable(\n            name: a\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/loop/for.test",
    "content": "For loop\n-----\n<?php\n\n// \"classical\" loop\nfor ($i = 0; $i < $c; ++$i) {}\n\n// multiple expressions\nfor ($a, $b; $c, $d; $e, $f) {}\n\n// infinite loop\nfor (;;) {}\n\n// alternative syntax\nfor (;;):\nendfor;\n-----\narray(\n    0: Stmt_For(\n        init: array(\n            0: Expr_Assign(\n                var: Expr_Variable(\n                    name: i\n                )\n                expr: Scalar_Int(\n                    value: 0\n                )\n            )\n        )\n        cond: array(\n            0: Expr_BinaryOp_Smaller(\n                left: Expr_Variable(\n                    name: i\n                )\n                right: Expr_Variable(\n                    name: c\n                )\n            )\n        )\n        loop: array(\n            0: Expr_PreInc(\n                var: Expr_Variable(\n                    name: i\n                )\n            )\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // \"classical\" loop\n        )\n    )\n    1: Stmt_For(\n        init: array(\n            0: Expr_Variable(\n                name: a\n            )\n            1: Expr_Variable(\n                name: b\n            )\n        )\n        cond: array(\n            0: Expr_Variable(\n                name: c\n            )\n            1: Expr_Variable(\n                name: d\n            )\n        )\n        loop: array(\n            0: Expr_Variable(\n                name: e\n            )\n            1: Expr_Variable(\n                name: f\n            )\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // multiple expressions\n        )\n    )\n    2: Stmt_For(\n        init: array(\n        )\n        cond: array(\n        )\n        loop: array(\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // infinite loop\n        )\n    )\n    3: Stmt_For(\n        init: array(\n        )\n        cond: array(\n        )\n        loop: array(\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // alternative syntax\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/loop/foreach.test",
    "content": "Foreach loop\n-----\n<?php\n\n// foreach on variable\nforeach ($a as $b)  {}\nforeach ($a as &$b) {}\nforeach ($a as $b => $c) {}\nforeach ($a as $b => &$c) {}\nforeach ($a as list($a, $b)) {}\nforeach ($a as $a => list($b, , $c)) {}\n\n// foreach on expression\nforeach (array() as $b) {}\n\n// alternative syntax\nforeach ($a as $b):\nendforeach;\n-----\narray(\n    0: Stmt_Foreach(\n        expr: Expr_Variable(\n            name: a\n        )\n        keyVar: null\n        byRef: false\n        valueVar: Expr_Variable(\n            name: b\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // foreach on variable\n        )\n    )\n    1: Stmt_Foreach(\n        expr: Expr_Variable(\n            name: a\n        )\n        keyVar: null\n        byRef: true\n        valueVar: Expr_Variable(\n            name: b\n        )\n        stmts: array(\n        )\n    )\n    2: Stmt_Foreach(\n        expr: Expr_Variable(\n            name: a\n        )\n        keyVar: Expr_Variable(\n            name: b\n        )\n        byRef: false\n        valueVar: Expr_Variable(\n            name: c\n        )\n        stmts: array(\n        )\n    )\n    3: Stmt_Foreach(\n        expr: Expr_Variable(\n            name: a\n        )\n        keyVar: Expr_Variable(\n            name: b\n        )\n        byRef: true\n        valueVar: Expr_Variable(\n            name: c\n        )\n        stmts: array(\n        )\n    )\n    4: Stmt_Foreach(\n        expr: Expr_Variable(\n            name: a\n        )\n        keyVar: null\n        byRef: false\n        valueVar: Expr_List(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Expr_Variable(\n                        name: a\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: ArrayItem(\n                    key: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n        stmts: array(\n        )\n    )\n    5: Stmt_Foreach(\n        expr: Expr_Variable(\n            name: a\n        )\n        keyVar: Expr_Variable(\n            name: a\n        )\n        byRef: false\n        valueVar: Expr_List(\n            items: array(\n                0: ArrayItem(\n                    key: null\n                    value: Expr_Variable(\n                        name: b\n                    )\n                    byRef: false\n                    unpack: false\n                )\n                1: null\n                2: ArrayItem(\n                    key: null\n                    value: Expr_Variable(\n                        name: c\n                    )\n                    byRef: false\n                    unpack: false\n                )\n            )\n        )\n        stmts: array(\n        )\n    )\n    6: Stmt_Foreach(\n        expr: Expr_Array(\n            items: array(\n            )\n        )\n        keyVar: null\n        byRef: false\n        valueVar: Expr_Variable(\n            name: b\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // foreach on expression\n        )\n    )\n    7: Stmt_Foreach(\n        expr: Expr_Variable(\n            name: a\n        )\n        keyVar: null\n        byRef: false\n        valueVar: Expr_Variable(\n            name: b\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // alternative syntax\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/loop/while.test",
    "content": "While loop\n-----\n<?php\n\nwhile ($a) {}\n\nwhile ($a):\nendwhile;\n-----\narray(\n    0: Stmt_While(\n        cond: Expr_Variable(\n            name: a\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_While(\n        cond: Expr_Variable(\n            name: a\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/multiCatch.test",
    "content": "Try/catch with multiple classes\n-----\n<?php\ntry {\n    $x;\n} catch (X|Y $e1) {\n    $y;\n} catch (\\A|B\\C $e2) {\n    $z;\n}\n-----\narray(\n    0: Stmt_TryCatch(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_Variable(\n                    name: x\n                )\n            )\n        )\n        catches: array(\n            0: Stmt_Catch(\n                types: array(\n                    0: Name(\n                        name: X\n                    )\n                    1: Name(\n                        name: Y\n                    )\n                )\n                var: Expr_Variable(\n                    name: e1\n                )\n                stmts: array(\n                    0: Stmt_Expression(\n                        expr: Expr_Variable(\n                            name: y\n                        )\n                    )\n                )\n            )\n            1: Stmt_Catch(\n                types: array(\n                    0: Name_FullyQualified(\n                        name: A\n                    )\n                    1: Name(\n                        name: B\\C\n                    )\n                )\n                var: Expr_Variable(\n                    name: e2\n                )\n                stmts: array(\n                    0: Stmt_Expression(\n                        expr: Expr_Variable(\n                            name: z\n                        )\n                    )\n                )\n            )\n        )\n        finally: null\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/alias.test",
    "content": "Aliases (use)\n-----\n<?php\n\nuse A\\B;\nuse C\\D as E;\nuse F\\G as H, J;\n\n// evil alias notation - Do Not Use!\nuse \\A;\nuse \\A as B;\n\n// function and constant aliases\nuse function foo\\bar;\nuse function foo\\bar as baz;\nuse const foo\\BAR;\nuse const foo\\BAR as BAZ;\n-----\narray(\n    0: Stmt_Use(\n        type: TYPE_NORMAL (1)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: A\\B\n                )\n                alias: null\n            )\n        )\n    )\n    1: Stmt_Use(\n        type: TYPE_NORMAL (1)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: C\\D\n                )\n                alias: Identifier(\n                    name: E\n                )\n            )\n        )\n    )\n    2: Stmt_Use(\n        type: TYPE_NORMAL (1)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: F\\G\n                )\n                alias: Identifier(\n                    name: H\n                )\n            )\n            1: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: J\n                )\n                alias: null\n            )\n        )\n    )\n    3: Stmt_Use(\n        type: TYPE_NORMAL (1)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: A\n                )\n                alias: null\n            )\n        )\n        comments: array(\n            0: // evil alias notation - Do Not Use!\n        )\n    )\n    4: Stmt_Use(\n        type: TYPE_NORMAL (1)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: A\n                )\n                alias: Identifier(\n                    name: B\n                )\n            )\n        )\n    )\n    5: Stmt_Use(\n        type: TYPE_FUNCTION (2)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: foo\\bar\n                )\n                alias: null\n            )\n        )\n        comments: array(\n            0: // function and constant aliases\n        )\n    )\n    6: Stmt_Use(\n        type: TYPE_FUNCTION (2)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: foo\\bar\n                )\n                alias: Identifier(\n                    name: baz\n                )\n            )\n        )\n    )\n    7: Stmt_Use(\n        type: TYPE_CONSTANT (3)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: foo\\BAR\n                )\n                alias: null\n            )\n        )\n    )\n    8: Stmt_Use(\n        type: TYPE_CONSTANT (3)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: foo\\BAR\n                )\n                alias: Identifier(\n                    name: BAZ\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/braced.test",
    "content": "Braced namespaces\n-----\n<?php\n\nnamespace Foo\\Bar {\n    foo;\n}\nnamespace {\n    bar;\n}\n-----\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: Foo\\Bar\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_ConstFetch(\n                    name: Name(\n                        name: foo\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Namespace(\n        name: null\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_ConstFetch(\n                    name: Name(\n                        name: bar\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/commentAfterNamespace.test",
    "content": "Trailing comment after braced namespace declaration\n-----\n<?php\nnamespace Foo {}\n// Comment\n-----\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: Foo\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Nop(\n        comments: array(\n            0: // Comment\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/groupUse.test",
    "content": "Group use declarations\n-----\n<?php\nuse A\\{B};\nuse A\\{B\\C, D};\nuse \\A\\B\\{C\\D, E};\nuse function A\\{b\\c, d};\nuse const \\A\\{B\\C, D};\nuse A\\B\\{C\\D, function b\\c, const D};\n-----\narray(\n    0: Stmt_GroupUse(\n        type: TYPE_UNKNOWN (0)\n        prefix: Name(\n            name: A\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_NORMAL (1)\n                name: Name(\n                    name: B\n                )\n                alias: null\n            )\n        )\n    )\n    1: Stmt_GroupUse(\n        type: TYPE_UNKNOWN (0)\n        prefix: Name(\n            name: A\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_NORMAL (1)\n                name: Name(\n                    name: B\\C\n                )\n                alias: null\n            )\n            1: UseItem(\n                type: TYPE_NORMAL (1)\n                name: Name(\n                    name: D\n                )\n                alias: null\n            )\n        )\n    )\n    2: Stmt_GroupUse(\n        type: TYPE_UNKNOWN (0)\n        prefix: Name(\n            name: A\\B\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_NORMAL (1)\n                name: Name(\n                    name: C\\D\n                )\n                alias: null\n            )\n            1: UseItem(\n                type: TYPE_NORMAL (1)\n                name: Name(\n                    name: E\n                )\n                alias: null\n            )\n        )\n    )\n    3: Stmt_GroupUse(\n        type: TYPE_FUNCTION (2)\n        prefix: Name(\n            name: A\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: b\\c\n                )\n                alias: null\n            )\n            1: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: d\n                )\n                alias: null\n            )\n        )\n    )\n    4: Stmt_GroupUse(\n        type: TYPE_CONSTANT (3)\n        prefix: Name(\n            name: A\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: B\\C\n                )\n                alias: null\n            )\n            1: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: D\n                )\n                alias: null\n            )\n        )\n    )\n    5: Stmt_GroupUse(\n        type: TYPE_UNKNOWN (0)\n        prefix: Name(\n            name: A\\B\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_NORMAL (1)\n                name: Name(\n                    name: C\\D\n                )\n                alias: null\n            )\n            1: UseItem(\n                type: TYPE_FUNCTION (2)\n                name: Name(\n                    name: b\\c\n                )\n                alias: null\n            )\n            2: UseItem(\n                type: TYPE_CONSTANT (3)\n                name: Name(\n                    name: D\n                )\n                alias: null\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/groupUseErrors.test",
    "content": "Invalid group use syntax\n-----\n<?php\n// Missing semicolon\nuse Foo\\{Bar}\nuse Bar\\{Foo};\n-----\nSyntax error, unexpected T_USE, expecting ';' from 4:1 to 4:3\narray(\n    0: Stmt_GroupUse(\n        type: TYPE_UNKNOWN (0)\n        prefix: Name(\n            name: Foo\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_NORMAL (1)\n                name: Name(\n                    name: Bar\n                )\n                alias: null\n            )\n        )\n        comments: array(\n            0: // Missing semicolon\n        )\n    )\n    1: Stmt_GroupUse(\n        type: TYPE_UNKNOWN (0)\n        prefix: Name(\n            name: Bar\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_NORMAL (1)\n                name: Name(\n                    name: Foo\n                )\n                alias: null\n            )\n        )\n    )\n)\n-----\n<?php\n// Missing NS separator\nuse Foo {Bar, Baz};\n-----\nSyntax error, unexpected '{', expecting ';' from 3:9 to 3:9\narray(\n    0: Stmt_Use(\n        type: TYPE_NORMAL (1)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: Foo\n                )\n                alias: null\n            )\n        )\n        comments: array(\n            0: // Missing NS separator\n        )\n    )\n    1: Stmt_Block(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_ConstFetch(\n                    name: Name(\n                        name: Bar\n                    )\n                )\n            )\n            1: Stmt_Expression(\n                expr: Expr_ConstFetch(\n                    name: Name(\n                        name: Baz\n                    )\n                )\n            )\n        )\n    )\n)\n-----\n<?php\n// Extra NS separator\nuse Foo\\{\\Bar};\n-----\nSyntax error, unexpected T_NAME_FULLY_QUALIFIED, expecting T_STRING or T_FUNCTION or T_CONST or T_NAME_QUALIFIED from 3:10 to 3:13\narray(\n    0: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name_FullyQualified(\n                name: Bar\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/groupUsePositions.test",
    "content": "Ensure correct file position attributes for group use prefix\n-----\n<?php\nuse Foo\\Bar\\{Baz};\n-----\n!!positions\narray(\n    0: Stmt_GroupUse[2:1 - 2:18](\n        type: TYPE_UNKNOWN (0)\n        prefix: Name[2:5 - 2:11](\n            name: Foo\\Bar\n        )\n        uses: array(\n            0: UseItem[2:14 - 2:16](\n                type: TYPE_NORMAL (1)\n                name: Name[2:14 - 2:16](\n                    name: Baz\n                )\n                alias: null\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/groupUseTrailingComma.test",
    "content": "Group use can have trailing comma\n-----\n<?php\nuse A\\{B,};\nuse function A\\{b,};\n-----\narray(\n    0: Stmt_GroupUse(\n        type: TYPE_UNKNOWN (0)\n        prefix: Name(\n            name: A\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_NORMAL (1)\n                name: Name(\n                    name: B\n                )\n                alias: null\n            )\n        )\n    )\n    1: Stmt_GroupUse(\n        type: TYPE_FUNCTION (2)\n        prefix: Name(\n            name: A\n        )\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: b\n                )\n                alias: null\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/invalidName.test",
    "content": "Invalid namespace names\n-----\n<?php use A as self;\n-----\nCannot use A as self because 'self' is a special class name from 1:16 to 1:19\narray(\n    0: Stmt_Use(\n        type: TYPE_NORMAL (1)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: A\n                )\n                alias: Identifier(\n                    name: self\n                )\n            )\n        )\n    )\n)\n-----\n<?php use B as PARENT;\n-----\nCannot use B as PARENT because 'PARENT' is a special class name from 1:16 to 1:21\narray(\n    0: Stmt_Use(\n        type: TYPE_NORMAL (1)\n        uses: array(\n            0: UseItem(\n                type: TYPE_UNKNOWN (0)\n                name: Name(\n                    name: B\n                )\n                alias: Identifier(\n                    name: PARENT\n                )\n            )\n        )\n    )\n)\n-----\n<?php use C as static;\n-----\nSyntax error, unexpected T_STATIC, expecting T_STRING from 1:16 to 1:21\narray(\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/mix.test",
    "content": "Namespace types cannot be mixed\n-----\n<?php\nnamespace A;\necho 1;\nnamespace B {\n    echo 2;\n}\necho 3;\n-----\nCannot mix bracketed namespace declarations with unbracketed namespace declarations from 4:1 to 4:9\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: A\n        )\n        stmts: array(\n            0: Stmt_Echo(\n                exprs: array(\n                    0: Scalar_Int(\n                        value: 1\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Namespace(\n        name: Name(\n            name: B\n        )\n        stmts: array(\n            0: Stmt_Echo(\n                exprs: array(\n                    0: Scalar_Int(\n                        value: 2\n                    )\n                )\n            )\n        )\n    )\n    2: Stmt_Echo(\n        exprs: array(\n            0: Scalar_Int(\n                value: 3\n            )\n        )\n    )\n)\n-----\n<?php\nnamespace A {\n    echo 1;\n}\necho 2;\nnamespace B;\necho 3;\n-----\nCannot mix bracketed namespace declarations with unbracketed namespace declarations from 6:1 to 6:9\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: A\n        )\n        stmts: array(\n            0: Stmt_Echo(\n                exprs: array(\n                    0: Scalar_Int(\n                        value: 1\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Echo(\n        exprs: array(\n            0: Scalar_Int(\n                value: 2\n            )\n        )\n    )\n    2: Stmt_Namespace(\n        name: Name(\n            name: B\n        )\n        stmts: array(\n            0: Stmt_Echo(\n                exprs: array(\n                    0: Scalar_Int(\n                        value: 3\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/name.test",
    "content": "Different name types\n-----\n<?php\n\nA;\nA\\B;\n\\A\\B;\nnamespace\\A\\B;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: A\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name(\n                name: A\\B\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name_FullyQualified(\n                name: A\\B\n            )\n        )\n    )\n    3: Stmt_Expression(\n        expr: Expr_ConstFetch(\n            name: Name_Relative(\n                name: A\\B\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/nested.test",
    "content": "Nested namespaces are not allowed\n-----\n<?php\nnamespace A {\n    namespace B {\n\n    }\n}\n-----\nNamespace declarations cannot be nested from 3:5 to 5:5\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: A\n        )\n        stmts: array(\n            0: Stmt_Namespace(\n                name: Name(\n                    name: B\n                )\n                stmts: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/notBraced.test",
    "content": "Semicolon style namespaces\n-----\n<?php\n\nnamespace Foo\\Bar;\nfoo;\n\nnamespace Bar;\nbar;\n-----\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: Foo\\Bar\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_ConstFetch(\n                    name: Name(\n                        name: foo\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Namespace(\n        name: Name(\n            name: Bar\n        )\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_ConstFetch(\n                    name: Name(\n                        name: bar\n                    )\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/nsAfterHashbang.test",
    "content": "Hashbang followed by namespace declaration\n-----\n#!/usr/bin/env php\n<?php\n\nnamespace A;\n-----\narray(\n    0: Stmt_InlineHTML(\n        value: #!/usr/bin/env php\n\n    )\n    1: Stmt_Namespace(\n        name: Name(\n            name: A\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/outsideStmt.test",
    "content": "Some statements may occur outside of namespaces\n-----\n<?php\ndeclare(A='B');\nnamespace B {\n\n}\n__halt_compiler()\n?>\nHi!\n-----\narray(\n    0: Stmt_Declare(\n        declares: array(\n            0: DeclareItem(\n                key: Identifier(\n                    name: A\n                )\n                value: Scalar_String(\n                    value: B\n                )\n            )\n        )\n        stmts: null\n    )\n    1: Stmt_Namespace(\n        name: Name(\n            name: B\n        )\n        stmts: array(\n        )\n    )\n    2: Stmt_HaltCompiler(\n        remaining: Hi!\n    )\n)\n-----\n<?php\n/* Comment */\n;\nnamespace Foo;\n-----\narray(\n    0: Stmt_Nop(\n        comments: array(\n            0: /* Comment */\n        )\n    )\n    1: Stmt_Namespace(\n        name: Name(\n            name: Foo\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/namespace/outsideStmtInvalid.test",
    "content": "There (mostly) can't be statements outside of namespaces\n-----\n<?php\necho 1;\necho 2;\nnamespace A;\n-----\nNamespace declaration statement has to be the very first statement in the script from 4:1 to 4:9\narray(\n    0: Stmt_Echo(\n        exprs: array(\n            0: Scalar_Int(\n                value: 1\n            )\n        )\n    )\n    1: Stmt_Echo(\n        exprs: array(\n            0: Scalar_Int(\n                value: 2\n            )\n        )\n    )\n    2: Stmt_Namespace(\n        name: Name(\n            name: A\n        )\n        stmts: array(\n        )\n    )\n)\n-----\n<?php\nnamespace A {}\necho 1;\n-----\nNo code may exist outside of namespace {} from 3:1 to 3:7\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: A\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Echo(\n        exprs: array(\n            0: Scalar_Int(\n                value: 1\n            )\n        )\n    )\n)\n-----\n<?php\nnamespace A {}\ndeclare(ticks=1);\nfoo();\nnamespace B {}\n-----\nNo code may exist outside of namespace {} from 3:1 to 3:17\narray(\n    0: Stmt_Namespace(\n        name: Name(\n            name: A\n        )\n        stmts: array(\n        )\n    )\n    1: Stmt_Declare(\n        declares: array(\n            0: DeclareItem(\n                key: Identifier(\n                    name: ticks\n                )\n                value: Scalar_Int(\n                    value: 1\n                )\n            )\n        )\n        stmts: null\n    )\n    2: Stmt_Expression(\n        expr: Expr_FuncCall(\n            name: Name(\n                name: foo\n            )\n            args: array(\n            )\n        )\n    )\n    3: Stmt_Namespace(\n        name: Name(\n            name: B\n        )\n        stmts: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/newInInitializer.test",
    "content": "New in initializers\n-----\n<?php\n\nconst C = new Foo;\n\nfunction a($x = new Foo) {\n    static $y = new Foo;\n}\n\n#[Attr(new Foo)]\nclass Bar {\n    const C = new Foo;\n    public $prop = new Foo;\n}\n-----\narray(\n    0: Stmt_Const(\n        attrGroups: array(\n        )\n        consts: array(\n            0: Const(\n                name: Identifier(\n                    name: C\n                )\n                value: Expr_New(\n                    class: Name(\n                        name: Foo\n                    )\n                    args: array(\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_Function(\n        attrGroups: array(\n        )\n        byRef: false\n        name: Identifier(\n            name: a\n        )\n        params: array(\n            0: Param(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                byRef: false\n                variadic: false\n                var: Expr_Variable(\n                    name: x\n                )\n                default: Expr_New(\n                    class: Name(\n                        name: Foo\n                    )\n                    args: array(\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n        returnType: null\n        stmts: array(\n            0: Stmt_Static(\n                vars: array(\n                    0: StaticVar(\n                        var: Expr_Variable(\n                            name: y\n                        )\n                        default: Expr_New(\n                            class: Name(\n                                name: Foo\n                            )\n                            args: array(\n                            )\n                        )\n                    )\n                )\n            )\n        )\n    )\n    2: Stmt_Class(\n        attrGroups: array(\n            0: AttributeGroup(\n                attrs: array(\n                    0: Attribute(\n                        name: Name(\n                            name: Attr\n                        )\n                        args: array(\n                            0: Arg(\n                                name: null\n                                value: Expr_New(\n                                    class: Name(\n                                        name: Foo\n                                    )\n                                    args: array(\n                                    )\n                                )\n                                byRef: false\n                                unpack: false\n                            )\n                        )\n                    )\n                )\n            )\n        )\n        flags: 0\n        name: Identifier(\n            name: Bar\n        )\n        extends: null\n        implements: array(\n        )\n        stmts: array(\n            0: Stmt_ClassConst(\n                attrGroups: array(\n                )\n                flags: 0\n                type: null\n                consts: array(\n                    0: Const(\n                        name: Identifier(\n                            name: C\n                        )\n                        value: Expr_New(\n                            class: Name(\n                                name: Foo\n                            )\n                            args: array(\n                            )\n                        )\n                    )\n                )\n            )\n            1: Stmt_Property(\n                attrGroups: array(\n                )\n                flags: PUBLIC (1)\n                type: null\n                props: array(\n                    0: PropertyItem(\n                        name: VarLikeIdentifier(\n                            name: prop\n                        )\n                        default: Expr_New(\n                            class: Name(\n                                name: Foo\n                            )\n                            args: array(\n                            )\n                        )\n                    )\n                )\n                hooks: array(\n                )\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/switch.test",
    "content": "Switch\n-----\n<?php\n\nswitch ($a) {\n    case 0:\n        break;\n    // Comment\n    case 1;\n    default:\n}\n\n// alternative syntax\nswitch ($a):\nendswitch;\n\n// leading semicolon\nswitch ($a) { ; }\nswitch ($a): ; endswitch;\n-----\narray(\n    0: Stmt_Switch(\n        cond: Expr_Variable(\n            name: a\n        )\n        cases: array(\n            0: Stmt_Case(\n                cond: Scalar_Int(\n                    value: 0\n                )\n                stmts: array(\n                    0: Stmt_Break(\n                        num: null\n                    )\n                )\n            )\n            1: Stmt_Case(\n                cond: Scalar_Int(\n                    value: 1\n                )\n                stmts: array(\n                )\n                comments: array(\n                    0: // Comment\n                )\n            )\n            2: Stmt_Case(\n                cond: null\n                stmts: array(\n                )\n            )\n        )\n    )\n    1: Stmt_Switch(\n        cond: Expr_Variable(\n            name: a\n        )\n        cases: array(\n        )\n        comments: array(\n            0: // alternative syntax\n        )\n    )\n    2: Stmt_Switch(\n        cond: Expr_Variable(\n            name: a\n        )\n        cases: array(\n        )\n        comments: array(\n            0: // leading semicolon\n        )\n    )\n    3: Stmt_Switch(\n        cond: Expr_Variable(\n            name: a\n        )\n        cases: array(\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/tryCatch.test",
    "content": "Try/catch\n-----\n<?php\n\ntry {\n    doTry();\n} catch (A $b) {\n    doCatchA();\n} catch (B $c) {\n    doCatchB();\n} finally {\n    doFinally();\n}\n\n// no finally\ntry { }\ncatch (A $b) { }\n\n// no catch\ntry { }\nfinally { }\n\n-----\narray(\n    0: Stmt_TryCatch(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name(\n                        name: doTry\n                    )\n                    args: array(\n                    )\n                )\n            )\n        )\n        catches: array(\n            0: Stmt_Catch(\n                types: array(\n                    0: Name(\n                        name: A\n                    )\n                )\n                var: Expr_Variable(\n                    name: b\n                )\n                stmts: array(\n                    0: Stmt_Expression(\n                        expr: Expr_FuncCall(\n                            name: Name(\n                                name: doCatchA\n                            )\n                            args: array(\n                            )\n                        )\n                    )\n                )\n            )\n            1: Stmt_Catch(\n                types: array(\n                    0: Name(\n                        name: B\n                    )\n                )\n                var: Expr_Variable(\n                    name: c\n                )\n                stmts: array(\n                    0: Stmt_Expression(\n                        expr: Expr_FuncCall(\n                            name: Name(\n                                name: doCatchB\n                            )\n                            args: array(\n                            )\n                        )\n                    )\n                )\n            )\n        )\n        finally: Stmt_Finally(\n            stmts: array(\n                0: Stmt_Expression(\n                    expr: Expr_FuncCall(\n                        name: Name(\n                            name: doFinally\n                        )\n                        args: array(\n                        )\n                    )\n                )\n            )\n        )\n    )\n    1: Stmt_TryCatch(\n        stmts: array(\n        )\n        catches: array(\n            0: Stmt_Catch(\n                types: array(\n                    0: Name(\n                        name: A\n                    )\n                )\n                var: Expr_Variable(\n                    name: b\n                )\n                stmts: array(\n                )\n            )\n        )\n        finally: null\n        comments: array(\n            0: // no finally\n        )\n    )\n    2: Stmt_TryCatch(\n        stmts: array(\n        )\n        catches: array(\n        )\n        finally: Stmt_Finally(\n            stmts: array(\n            )\n        )\n        comments: array(\n            0: // no catch\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/tryCatch_without_variable.test",
    "content": "Try/Catch without variable\n-----\n<?php\n\ntry {\n\n} catch (Exception) {\n\n}\n-----\narray(\n    0: Stmt_TryCatch(\n        stmts: array(\n        )\n        catches: array(\n            0: Stmt_Catch(\n                types: array(\n                    0: Name(\n                        name: Exception\n                    )\n                )\n                var: null\n                stmts: array(\n                )\n            )\n        )\n        finally: null\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/tryWithoutCatch.test",
    "content": "Cannot use try without catch or finally\n-----\n<?php\n\ntry {\n    foo();\n}\n-----\nCannot use try without catch or finally from 3:1 to 5:1\narray(\n    0: Stmt_TryCatch(\n        stmts: array(\n            0: Stmt_Expression(\n                expr: Expr_FuncCall(\n                    name: Name(\n                        name: foo\n                    )\n                    args: array(\n                    )\n                )\n            )\n        )\n        catches: array(\n        )\n        finally: null\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/unset.test",
    "content": "Unset\n-----\n<?php\n\nunset($a);\nunset($b, $c);\n-----\narray(\n    0: Stmt_Unset(\n        vars: array(\n            0: Expr_Variable(\n                name: a\n            )\n        )\n    )\n    1: Stmt_Unset(\n        vars: array(\n            0: Expr_Variable(\n                name: b\n            )\n            1: Expr_Variable(\n                name: c\n            )\n        )\n    )\n)\n"
  },
  {
    "path": "test/code/parser/stmt/voidCast.test",
    "content": "Void cast\n-----\n<?php\n(void)foo();\n( VOID ) foo();\n(void)$a or $b;\n\n// This is explicitly allowed.\nfor ((void)a(); $b; (void)$c) {\n}\n\n// PHP does not allow this, but the parser accepts it.\n$x = (void) $y;\n-----\narray(\n    0: Stmt_Expression(\n        expr: Expr_Cast_Void(\n            expr: Expr_FuncCall(\n                name: Name(\n                    name: foo\n                )\n                args: array(\n                )\n            )\n        )\n    )\n    1: Stmt_Expression(\n        expr: Expr_Cast_Void(\n            expr: Expr_FuncCall(\n                name: Name(\n                    name: foo\n                )\n                args: array(\n                )\n            )\n        )\n    )\n    2: Stmt_Expression(\n        expr: Expr_Cast_Void(\n            expr: Expr_BinaryOp_LogicalOr(\n                left: Expr_Variable(\n                    name: a\n                )\n                right: Expr_Variable(\n                    name: b\n                )\n            )\n        )\n    )\n    3: Stmt_For(\n        init: array(\n            0: Expr_Cast_Void(\n                expr: Expr_FuncCall(\n                    name: Name(\n                        name: a\n                    )\n                    args: array(\n                    )\n                )\n            )\n        )\n        cond: array(\n            0: Expr_Variable(\n                name: b\n            )\n        )\n        loop: array(\n            0: Expr_Cast_Void(\n                expr: Expr_Variable(\n                    name: c\n                )\n            )\n        )\n        stmts: array(\n        )\n        comments: array(\n            0: // This is explicitly allowed.\n        )\n    )\n    4: Stmt_Expression(\n        expr: Expr_Assign(\n            var: Expr_Variable(\n                name: x\n            )\n            expr: Expr_Cast_Void(\n                expr: Expr_Variable(\n                    name: y\n                )\n            )\n        )\n        comments: array(\n            0: // PHP does not allow this, but the parser accepts it.\n        )\n    )\n)"
  },
  {
    "path": "test/code/prettyPrinter/comments.test",
    "content": "Comments\n-----\n<?php\n\nfunction justForIndentation()\n{\n    // Some text\n    # Some text\n    /* Some text */\n    /** Some text */\n    /**\n     * Some text.\n     * Some more text.\n     */\n    /*\n     * Some text.\n     * Some more text.\n     */\n    /*\n        Some text.\n        Some more text.\n    */\n    /* Some text.\n       More text. */\n    /* Some text.\n       More text.\n       Even more text. */\n    $foo;\n}\n-----\nfunction justForIndentation()\n{\n    // Some text\n    # Some text\n    /* Some text */\n    /** Some text */\n    /**\n     * Some text.\n     * Some more text.\n     */\n    /*\n     * Some text.\n     * Some more text.\n     */\n    /*\n        Some text.\n        Some more text.\n    */\n    /* Some text.\n       More text. */\n    /* Some text.\n       More text.\n       Even more text. */\n    $foo;\n}\n-----\n<?php\n\nfunction test()\n{\n    // empty\n}\n-----\nfunction test()\n{\n    // empty\n}\n-----\n<?php\n\nfunction noDuplicateComment()\n{\n    if (true):\n        // TEST 1\n    elseif (true):\n        // TEST 2\n    else:\n        // TEST 3\n    endif;\n}\n-----\nfunction noDuplicateComment()\n{\n    if (true) {\n        // TEST 1\n    } elseif (true) {\n        // TEST 2\n    } else {\n        // TEST 3\n    }\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/commentsInCommaList.test",
    "content": "Comments in arrays and function calls\n-----\n<?php\n\n$arr = [\n    // Foo\n    $foo,\n    // Bar\n    $bar,\n    // Discarded\n];\n[\n    // Foo\n    $foo,\n    ,\n    // Bar\n    $bar,\n] = $arr;\nfoo(\n    // Foo\n    $foo,\n    // Bar\n    $bar\n);\nnew Foo(\n    // Foo\n    $foo\n);\n-----\n$arr = [\n    // Foo\n    $foo,\n    // Bar\n    $bar,\n];\n[\n    // Foo\n    $foo,\n    ,\n    // Bar\n    $bar,\n] = $arr;\nfoo(\n    // Foo\n    $foo,\n    // Bar\n    $bar\n);\nnew Foo(\n    // Foo\n    $foo\n);"
  },
  {
    "path": "test/code/prettyPrinter/expr/anonymousClass.test",
    "content": "Anonymous classes\n-----\n<?php\n\nnew class {};\nnew class extends A implements B, C {};\nnew class($a) extends A {\n    private $a;\n    public function __construct($a) {\n        $this->a = $a;\n    }\n};\nnew readonly class {};\n-----\nnew class\n{\n};\nnew class extends A implements B, C\n{\n};\nnew class($a) extends A\n{\n    private $a;\n    public function __construct($a)\n    {\n        $this->a = $a;\n    }\n};\nnew readonly class\n{\n};\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/arrayDestructuring.test",
    "content": "Array destructuring\n-----\n<?php\n\n[$a, $b] = [$c, $d];\n[, $a, , , $b, ,] = $foo;\n[, [[$a]], $b] = $bar;\n['a' => $b, 'b' => $a] = $baz;\n-----\n[$a, $b] = [$c, $d];\n[, $a, , , $b, ] = $foo;\n[, [[$a]], $b] = $bar;\n['a' => $b, 'b' => $a] = $baz;"
  },
  {
    "path": "test/code/prettyPrinter/expr/arraySpread.test",
    "content": "Array spread\n-----\n<?php\n\n[$a, $b] = [...$c, ...$d];\n-----\n[$a, $b] = [...$c, ...$d];\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/arrow_function.test",
    "content": "Arrow function\n-----\n<?php\n\nfn($a) => $a;\nfn($x = 42) => $x;\nfn(&$x) => $x;\nfn&($x) => $x;\nstatic fn($x, ...$rest) => $rest;\nfn(): int => $x;\nfn($a, $b) => $a and $b;\nfn($a, $b) => $a && $b;\n-----\nfn($a) => $a;\nfn($x = 42) => $x;\nfn(&$x) => $x;\nfn&($x) => $x;\nstatic fn($x, ...$rest) => $rest;\nfn(): int => $x;\nfn($a, $b) => $a and $b;\nfn($a, $b) => $a && $b;"
  },
  {
    "path": "test/code/prettyPrinter/expr/call.test",
    "content": "Calls\n-----\n<?php\n\nf($a);\nf(&$a);\nf(...$a);\nf($a, &$b, ...$c);\n-----\nf($a);\nf(&$a);\nf(...$a);\nf($a, &$b, ...$c);"
  },
  {
    "path": "test/code/prettyPrinter/expr/cast.test",
    "content": "Casts\n-----\n<?php\n\n$int = (int) $int;\n$integer = (integer) $integer;\n$bool = (bool) $bool;\n$boolean = (boolean) $boolean;\n$string = (string) $string;\n$binary = (binary) $binary;\n-----\n$int = (int) $int;\n$integer = (int) $integer;\n$bool = (bool) $bool;\n$boolean = (bool) $boolean;\n$string = (string) $string;\n$binary = (string) $binary;"
  },
  {
    "path": "test/code/prettyPrinter/expr/closure.test",
    "content": "Closures\n-----\n<?php\n\n$closureWithArgs = function (\n    $arg1,\n    $arg2\n) {\n    $comment = 'closure body';\n};\n\n$closureWithArgsAndVars = function ($arg1, $arg2) use($var1, $var2) {\n    $comment = 'closure body';\n};\n-----\n$closureWithArgs = function ($arg1, $arg2) {\n    $comment = 'closure body';\n};\n$closureWithArgsAndVars = function ($arg1, $arg2) use ($var1, $var2) {\n    $comment = 'closure body';\n};"
  },
  {
    "path": "test/code/prettyPrinter/expr/constant_deref.test",
    "content": "Constant/literal dereferencing\n-----\n<?php\n\nFOO[0];\nFOO::BAR[0];\n'FOO'[0];\narray(FOO)[0];\n-----\nFOO[0];\nFOO::BAR[0];\n'FOO'[0];\narray(FOO)[0];\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/docStrings.test",
    "content": "Literals\n-----\n<?php\n\n<<<'STR'\nSTR;\n<<<STR\nSTR;\n\n<<<'STR'\nA\nB\nSTR;\n<<<STR\nA\nB\nSTR;\n\n<<<'STR'\na\\nb$c\nSTR;\n<<<STR\na\\\\nb\\$c\nSTR;\n\n<<<STR\na$b\n{$c->d}\nSTR;\n\ncall(\n    <<<STR\nA\nSTR\n    , <<<STR\nB\nSTR\n);\n\nfunction test() {\n    <<<'STR'\n    STR;\n    <<<'STR'\n    Foo\n        Bar\n            Baz\n    STR;\n    <<<STR\n    STR;\n    <<<STR\nFoo\nBar\nSTR;\n    <<<STR\n    Bar\n        Baz\n    STR;\n    <<<STR\n    $bar\n        $baz\n    STR;\n}\n-----\n<<<'STR'\nSTR;\n<<<STR\nSTR;\n<<<'STR'\nA\nB\nSTR;\n<<<STR\nA\nB\nSTR;\n<<<'STR'\na\\nb$c\nSTR;\n<<<STR\na\\\\nb\\$c\nSTR;\n<<<STR\na{$b}\n{$c->d}\nSTR;\ncall(<<<STR\nA\nSTR, <<<STR\nB\nSTR);\nfunction test()\n{\n    <<<'STR'\n    STR;\n    <<<'STR'\n    Foo\n        Bar\n            Baz\n    STR;\n    <<<STR\n    STR;\n    <<<STR\n    Foo\n    Bar\n    STR;\n    <<<STR\n    Bar\n        Baz\n    STR;\n    <<<STR\n    {$bar}\n        {$baz}\n    STR;\n}\n-----\n<?php\nif (1) {\n    foo(<<<STR\nabc\nSTR\n    , <<<STR\nabc\nSTR\n    );\n}\n-----\n!!version=7.2\nif (1) {\n    foo(<<<STR\nabc\nSTR\n, <<<STR\nabc\nSTR\n);\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/dynamicClassConstFetch.test",
    "content": "Dynamic class constant fetch\n-----\n<?php\nFoo::{bar()};\n$foo::{bar()};\n-----\nFoo::{bar()};\n$foo::{bar()};\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/firstClassCallables.test",
    "content": "First-class callables\n-----\n<?php\nfoo(...);\n$this->foo(...);\nA::foo(...);\n-----\nfoo(...);\n$this->foo(...);\nA::foo(...);"
  },
  {
    "path": "test/code/prettyPrinter/expr/include.test",
    "content": "Include\n-----\n<?php\n\n(include $foo) && (include $bar);\n-----\n(include $foo) && include $bar;\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/intrinsics.test",
    "content": "isset, empty, unset, exit, die, clone, eval\n-----\n<?php\n\nisset($a, $a[$b]);\nempty($a);\nempty('foo');\nunset($a, $a[$b]);\nexit;\nexit();\nexit(1);\ndie;\ndie();\ndie('foo');\nclone $foo;\neval('str');\n-----\nisset($a, $a[$b]);\nempty($a);\nempty('foo');\nunset($a, $a[$b]);\nexit;\nexit;\nexit(1);\ndie;\ndie;\ndie('foo');\nclone $foo;\neval('str');"
  },
  {
    "path": "test/code/prettyPrinter/expr/list.test",
    "content": "list()\n-----\n<?php\n\nlist() = $a;\nlist($a) = $b;\nlist($a, $b, $c) = $d;\nlist(, $a) = $b;\nlist(, , $a, , $b) = $c;\nlist(list($a)) = $b;\nlist(, list(, list(, $a), $b)) = $c;\n-----\nlist() = $a;\nlist($a) = $b;\nlist($a, $b, $c) = $d;\nlist(, $a) = $b;\nlist(, , $a, , $b) = $c;\nlist(list($a)) = $b;\nlist(, list(, list(, $a), $b)) = $c;\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/literals.test",
    "content": "Literals\n-----\n<?php\n\n// magic constants\n__LINE__;\n__FILE__;\n__DIR__;\n__FUNCTION__;\n__CLASS__;\n__TRAIT__;\n__METHOD__;\n__NAMESPACE__;\n__PROPERTY__;\n\n// not actually literals, but close\nnull;\ntrue;\nfalse;\nNULL;\nTRUE;\nFALSE;\n\n// integers (normalized to decimal)\n0;\n11;\n011;\n0x11;\n0b11;\n\n// floats (normalized to ... something)\n0.;\n.0;\n0.0;\n0e1000;\n1.0;\n1e100;\n1e1000;\n1E-100;\n1000000000000000000000000000000000000000000000000000000000000000000000000000000000000;\n378282246310005.0;\n10000000000000002.0;\n\n// strings (single quoted)\n'a';\n'a\nb';\n'a\\'b';\n'a\\b';\n'a\\\\';\n'a\\\\\\\\b';\n'a\\\\\\'b';\n\n// strings (double quoted)\n\"a\";\n\"a\\nb\";\n\"a'b\";\n\"a\\b\";\n\"$a\";\n\"a$b\";\n\"$a$b\";\n\"$a $b\";\n\"a${b}c\";\n\"a{$b}c\";\n\"a$a[b]c\";\n\"\\{$A}\";\n\"\\{ $A }\";\n\"\\\\{$A}\";\n\"\\\\{ $A }\";\n\"{$$A}[B]\";\n\"$$A[B]\";\n\n// make sure indentation doesn't mess anything up\nfunction foo()\n{\n    \"a\\nb\";\n    'a\nb';\n    'a\n    b';\n}\n\n// shell exec (similar to double quoted string)\n`foo`;\n`foo$a`;\n`foo{$a}bar`;\n`\\`\\'\\\"`;\n-----\n// magic constants\n__LINE__;\n__FILE__;\n__DIR__;\n__FUNCTION__;\n__CLASS__;\n__TRAIT__;\n__METHOD__;\n__NAMESPACE__;\n__PROPERTY__;\n// not actually literals, but close\nnull;\ntrue;\nfalse;\nNULL;\nTRUE;\nFALSE;\n// integers (normalized to decimal)\n0;\n11;\n011;\n0x11;\n0b11;\n// floats (normalized to ... something)\n0.0;\n0.0;\n0.0;\n0.0;\n1.0;\n1.0E+100;\n1.0E+1000;\n1.0E-100;\n1.0E+84;\n378282246310005.0;\n10000000000000002.0;\n// strings (single quoted)\n'a';\n'a\nb';\n'a\\'b';\n'a\\b';\n'a\\\\';\n'a\\\\\\\\b';\n'a\\\\\\'b';\n// strings (double quoted)\n\"a\";\n\"a\\nb\";\n\"a'b\";\n\"a\\\\b\";\n\"{$a}\";\n\"a{$b}\";\n\"{$a}{$b}\";\n\"{$a} {$b}\";\n\"a{$b}c\";\n\"a{$b}c\";\n\"a{$a['b']}c\";\n\"\\\\{{$A}}\";\n\"\\\\{ {$A} }\";\n\"\\\\{$A}\";\n\"\\\\{ {$A} }\";\n\"{${$A}}[B]\";\n\"\\${$A['B']}\";\n// make sure indentation doesn't mess anything up\nfunction foo()\n{\n    \"a\\nb\";\n    'a\nb';\n    'a\n    b';\n}\n// shell exec (similar to double quoted string)\n`foo`;\n`foo{$a}`;\n`foo{$a}bar`;\n`\\`\\\\'\\\\\"`;\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/match.test",
    "content": "Match\n-----\n<?php\n\necho match (1) {\n    0, 1 => 'Foo',\n    // Comment\n    2 => 'Bar',\n    default => 'Foo',\n};\n-----\necho match (1) {\n    0, 1 => 'Foo',\n    // Comment\n    2 => 'Bar',\n    default => 'Foo',\n};"
  },
  {
    "path": "test/code/prettyPrinter/expr/namedArgs.test",
    "content": "Named arguments\n-----\n<?php\nfoo(a: $b, c: $d);\nbar(class: 0);\n-----\nfoo(a: $b, c: $d);\nbar(class: 0);"
  },
  {
    "path": "test/code/prettyPrinter/expr/newDerefParentheses.test",
    "content": "Parentheses for new dereferences\n-----\n<?php\nnew MyClass()::CONSTANT;\nnew MyClass()::$staticProperty;\nnew MyClass()::staticMethod();\nnew MyClass()->property;\nnew MyClass()->method();\nnew MyClass()();\nnew MyClass()[0];\nnew class {}::CONSTANT;\nnew class {}::$staticProperty;\nnew class {}::staticMethod();\nnew class {}->property;\nnew class {}->method();\nnew class {}();\nnew class {}[0];\n-----\n!!version=8.4\nnew MyClass()::CONSTANT;\nnew MyClass()::$staticProperty;\nnew MyClass()::staticMethod();\nnew MyClass()->property;\nnew MyClass()->method();\nnew MyClass()();\nnew MyClass()[0];\nnew class\n{\n}::CONSTANT;\nnew class\n{\n}::$staticProperty;\nnew class\n{\n}::staticMethod();\nnew class\n{\n}->property;\nnew class\n{\n}->method();\nnew class\n{\n}();\nnew class\n{\n}[0];\n-----\n<?php\nnew MyClass()::CONSTANT;\nnew MyClass()::$staticProperty;\nnew MyClass()::staticMethod();\nnew MyClass()->property;\nnew MyClass()->method();\nnew MyClass()();\nnew MyClass()[0];\nnew class {}::CONSTANT;\nnew class {}::$staticProperty;\nnew class {}::staticMethod();\nnew class {}->property;\nnew class {}->method();\nnew class {}();\nnew class {}[0];\n-----\n!!version=8.3\n(new MyClass())::CONSTANT;\n(new MyClass())::$staticProperty;\n(new MyClass())::staticMethod();\n(new MyClass())->property;\n(new MyClass())->method();\n(new MyClass())();\n(new MyClass())[0];\n(new class\n{\n})::CONSTANT;\n(new class\n{\n})::$staticProperty;\n(new class\n{\n})::staticMethod();\n(new class\n{\n})->property;\n(new class\n{\n})->method();\n(new class\n{\n})();\n(new class\n{\n})[0];"
  },
  {
    "path": "test/code/prettyPrinter/expr/newVariable.test",
    "content": "Parentheses for complex new/instanceof expressions\n-----\n<?php\nnew ('a' . 'b');\nnew (x);\nnew (foo());\nnew ('foo');\nnew (x[0]);\nnew (x->y);\nnew ((x)::$y);\n$x instanceof ('a' . 'b');\n$x instanceof ($y++);\n-----\nnew ('a' . 'b')();\nnew (x)();\nnew (foo())();\nnew ('foo')();\nnew (x[0])();\nnew (x->y)();\nnew ((x)::$y)();\n$x instanceof ('a' . 'b');\n$x instanceof ($y++);\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/nullsafe.test",
    "content": "Nullsafe operator\n-----\n<?php\n\n$a?->b;\n$a?->b($c);\n$a?->b?->c;\n$a?->b($c)?->d;\n$a?->b($c)();\nnew $a?->b;\n\"{$a?->b}\";\n\"$a?->b\";\n-----\n$a?->b;\n$a?->b($c);\n$a?->b?->c;\n$a?->b($c)?->d;\n$a?->b($c)();\nnew $a?->b();\n\"{$a?->b}\";\n\"{$a?->b}\";"
  },
  {
    "path": "test/code/prettyPrinter/expr/numbers.test",
    "content": "Number literals\n-----\n<?php\n\n0;\n+0;\n-0;\n0.0;\n-0.0;\n42;\n-42;\n42.0;\n-42.0;\n42.5;\n-42.5;\n1e42;\n-1e42;\n1e1000;\n-1e1000;\n-----\n0;\n+0;\n-0;\n0.0;\n-0.0;\n42;\n-42;\n42.0;\n-42.0;\n42.5;\n-42.5;\n1.0E+42;\n-1.0E+42;\n1.0E+1000;\n-1.0E+1000;\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/operators.test",
    "content": "Basic operators\n-----\n<?php\n\n$a ** $b;\n\n++$a;\n--$a;\n$a++;\n$a--;\n\n@$a;\n~$a;\n-$a;\n+$a;\n\n(int) $a;\n(integer) $a;\n(float) $a;\n(double) $a;\n(real) $a;\n( float) $a;\n(double ) $a;\n( REAL ) $a;\n(string) $a;\n(binary) $a;\n(array) $a;\n(object) $a;\n(bool) $a;\n(boolean) $a;\n(unset) $a;\n\n$a * $b;\n$a / $b;\n$a % $b;\n$a + $b;\n$a - $b;\n$a . $b;\n$a << $b;\n$a >> $b;\n$a < $b;\n$a <= $b;\n$a > $b;\n$a >= $b;\n$a == $b;\n$a != $b;\n$a <> $b;\n$a === $b;\n$a !== $b;\n$a <=> $b;\n$a & $b;\n$a ^ $b;\n$a | $b;\n$a && $b;\n$a || $b;\n$a ? $b : $c;\n$a ?: $c;\n$a ?? $c;\n$a = $b;\n$a **= $b;\n$a ??= $c;\n$a *= $b;\n$a /= $b;\n$a %= $b;\n$a += $b;\n$a -= $b;\n$a .= $b;\n$a <<= $b;\n$a >>= $b;\n$a &= $b;\n$a ^= $b;\n$a |= $b;\n$a =& $b;\n\n$a and $b;\n$a xor $b;\n$a or $b;\n\n$a instanceof Foo;\n$a instanceof $b;\n-----\n$a ** $b;\n++$a;\n--$a;\n$a++;\n$a--;\n@$a;\n~$a;\n-$a;\n+$a;\n(int) $a;\n(int) $a;\n(float) $a;\n(double) $a;\n(real) $a;\n(float) $a;\n(double) $a;\n(real) $a;\n(string) $a;\n(string) $a;\n(array) $a;\n(object) $a;\n(bool) $a;\n(bool) $a;\n(unset) $a;\n$a * $b;\n$a / $b;\n$a % $b;\n$a + $b;\n$a - $b;\n$a . $b;\n$a << $b;\n$a >> $b;\n$a < $b;\n$a <= $b;\n$a > $b;\n$a >= $b;\n$a == $b;\n$a != $b;\n$a != $b;\n$a === $b;\n$a !== $b;\n$a <=> $b;\n$a & $b;\n$a ^ $b;\n$a | $b;\n$a && $b;\n$a || $b;\n$a ? $b : $c;\n$a ?: $c;\n$a ?? $c;\n$a = $b;\n$a **= $b;\n$a ??= $c;\n$a *= $b;\n$a /= $b;\n$a %= $b;\n$a += $b;\n$a -= $b;\n$a .= $b;\n$a <<= $b;\n$a >>= $b;\n$a &= $b;\n$a ^= $b;\n$a |= $b;\n$a =& $b;\n$a and $b;\n$a xor $b;\n$a or $b;\n$a instanceof Foo;\n$a instanceof $b;\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/parentheses.test",
    "content": "Pretty printer generates least-parentheses output\n-----\n<?php\n\necho 'abc' . 'cde' . 'fgh';\necho 'abc' . ('cde' . 'fgh');\n\necho ('abc' . 1) + 2 . 'fgh';\necho 'abc' . (1 + 2) . 'fgh';\n\necho 1 * 2 + 3 / 4 % 5 . 6;\necho 1 * (2 + 3) / (4 % (5 . 6));\n\n$a = $b = $c = $d = $f && true;\n($a = $b = $c = $d = $f) && true;\n$a = $b = $c = $d = $f and true;\n$a = $b = $c = $d = ($f and true);\n\n$a ? $b : $c ? $d : $e ? $f : $g;\n$a ? $b : ($c ? $d : ($e ? $f : $g));\n$a ? $b ? $c : $d : $f;\n$a === $b ? $c : $d;\n\n$a ?? $b ?? $c;\n($a ?? $b) ?? $c;\n$a ?? ($b ? $c : $d);\n$a || ($b ?? $c);\n\n(1 > 0) > (1 < 0);\n++$a + $b;\n$a + $b++;\n\n$a ** $b ** $c;\n($a ** $b) ** $c;\n-1 ** 2;\n\nyield from $a and yield from $b;\nyield from ($a and yield from $b);\n\nprint ($a and print $b);\nclone ($a + $b);\n(throw $a) + $b;\n\n-(-$a);\n+(+$a);\n-(--$a);\n+(++$a);\n-(--$a)**$b;\n+(++$a)**$b;\n\n!$a = $b;\n++$a ** $b;\n$a ** $b++;\n$a . ($b = $c) . $d;\n!($a = $b) || $c;\n(fn() => $a) || $b;\n($a = $b and $c) + $d;\n$a ** ($b instanceof $c);\n($a = $b) instanceof $c;\n[$a and $b => $c];\n// TODO: This prints redundant parentheses\n[include $a => $c];\n-----\necho 'abc' . 'cde' . 'fgh';\necho 'abc' . ('cde' . 'fgh');\necho 'abc' . 1 + 2 . 'fgh';\necho 'abc' . (1 + 2) . 'fgh';\necho 1 * 2 + 3 / 4 % 5 . 6;\necho 1 * (2 + 3) / (4 % (5 . 6));\n$a = $b = $c = $d = $f && true;\n($a = $b = $c = $d = $f) && true;\n$a = $b = $c = $d = $f and true;\n$a = $b = $c = $d = ($f and true);\n(($a ? $b : $c) ? $d : $e) ? $f : $g;\n$a ? $b : ($c ? $d : ($e ? $f : $g));\n$a ? $b ? $c : $d : $f;\n$a === $b ? $c : $d;\n$a ?? $b ?? $c;\n($a ?? $b) ?? $c;\n$a ?? ($b ? $c : $d);\n$a || ($b ?? $c);\n(1 > 0) > (1 < 0);\n++$a + $b;\n$a + $b++;\n$a ** $b ** $c;\n($a ** $b) ** $c;\n-1 ** 2;\nyield from $a and yield from $b;\nyield from ($a and yield from $b);\nprint ($a and print $b);\nclone ($a + $b);\n(throw $a) + $b;\n-(-$a);\n+(+$a);\n-(--$a);\n+(++$a);\n-(--$a ** $b);\n+(++$a ** $b);\n!$a = $b;\n++$a ** $b;\n$a ** $b++;\n$a . ($b = $c) . $d;\n!($a = $b) || $c;\n(fn() => $a) || $b;\n($a = $b and $c) + $d;\n$a ** ($b instanceof $c);\n($a = $b) instanceof $c;\n[$a and $b => $c];\n// TODO: This prints redundant parentheses\n[(include $a) => $c];\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/pipe.test",
    "content": "Pipe operator\n-----\n<?php\n$a |> $b |> $c;\n$a . $b |> $c . $d;\n$a |> $b == $c;\n$c == $a |> $b;\n($a == $b) |> ($c == $d);\n$a . ($b |> $c) . $d;\n$a |> (fn($x) => $x) |> (fn($y) => $y) |> $b;\n(fn($x) => $x) |> $y;\nfn($x) => $x |> $y;\n-----\n$a |> $b |> $c;\n$a . $b |> $c . $d;\n$a |> $b == $c;\n$c == $a |> $b;\n($a == $b) |> ($c == $d);\n$a . ($b |> $c) . $d;\n$a |> (fn($x) => $x) |> (fn($y) => $y) |> $b;\n(fn($x) => $x) |> $y;\nfn($x) => $x |> $y;"
  },
  {
    "path": "test/code/prettyPrinter/expr/shortArraySyntax.test",
    "content": "Short array syntax\n-----\n<?php\n\n[];\narray(1, 2, 3);\n['a' => 'b', 'c' => 'd'];\n-----\n[];\narray(1, 2, 3);\n['a' => 'b', 'c' => 'd'];"
  },
  {
    "path": "test/code/prettyPrinter/expr/stringEscaping.test",
    "content": "Escape sequences in double-quoted strings\n-----\n<?php\n\"\\n\\r\\t\\f\\v\\$\\\"\\\\\";\n\"@@{ implode(range(\"\\0\", \"\\37\")) }@@\";\n\"\\0000\\0001\";\n\"äöü\";\n\"\\xc0\\x80\";\n\"\\xd0\\x01\";\n\"\\xf0\\x80\\x80\";\n\n<<<DOC\n\\n\\r\\t\\f\\v\\$\\\"\\\\\n@@{ implode(range(\"\\0\", \"\\37\")) }@@\n\\0000\\0001\näöü\nDOC;\n-----\n\"\\n\\r\\t\\f\\v\\$\\\"\\\\\";\n\"\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\v\\f\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f\";\n\"\\x000\\x001\";\n\"äöü\";\n\"\\xc0\\x80\";\n\"\\xd0\\x01\";\n\"\\xf0\\x80\\x80\";\n<<<DOC\n@@{ \"\\n\" }@@\\r\\t\\f\\v\\$\\\\\"\\\\\n\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t@@{ \"\\n\" }@@\\v\\f\\r\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f\n\\x000\\x001\näöü\nDOC;\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/throw.test",
    "content": "Throw expression\n-----\n<?php\ntest(throw $x);\n$a ?? throw new Exception;\n-----\ntest(throw $x);\n$a ?? throw new Exception();"
  },
  {
    "path": "test/code/prettyPrinter/expr/uvs.test",
    "content": "Uniform variable syntax\n-----\n<?php\n\n(function() {})();\narray('a', 'b')()();\nA::$b::$c;\n$A::$b[$c]();\n$A::{$b[$c]}();\nA::$$b[$c]();\n($a->b)();\n(A::$b)();\n('a' . 'b')::X;\n(A)::X;\n(A)::$x;\n(A)::x();\n-----\n(function () {\n})();\narray('a', 'b')()();\nA::$b::$c;\n$A::$b[$c]();\n$A::{$b[$c]}();\nA::${$b}[$c]();\n($a->b)();\n(A::$b)();\n('a' . 'b')::X;\n(A)::X;\n(A)::$x;\n(A)::x();\n"
  },
  {
    "path": "test/code/prettyPrinter/expr/variables.test",
    "content": "Variables\n-----\n<?php\n\n$a;\n$$a;\n${$a};\n$a->b;\n$a->b();\n$a->b($c);\n$a->$b();\n$a->{$b}();\n$a->$b[$c]();\n$$a->b;\n$a[$b];\n$a[$b]();\n$$a[$b];\n$a::B;\n$a::$b;\n$a::b();\n$a::b($c);\n$a::$b();\n$a::$b[$c];\n$a::$b[$c]($d);\n$a::{$b[$c]}($d);\n$a::{$b->c}();\nA::$$b[$c]();\na();\n$a();\n$a()[$b];\n$a->b()[$c];\n$a::$b()[$c];\n(new A)->b;\n(new A())->b();\n(new $$a)[$b];\n(new $a->b)->c;\n\nglobal $a, $$a;\n-----\n$a;\n${$a};\n${$a};\n$a->b;\n$a->b();\n$a->b($c);\n$a->{$b}();\n$a->{$b}();\n$a->{$b}[$c]();\n${$a}->b;\n$a[$b];\n$a[$b]();\n${$a}[$b];\n$a::B;\n$a::$b;\n$a::b();\n$a::b($c);\n$a::$b();\n$a::$b[$c];\n$a::$b[$c]($d);\n$a::{$b[$c]}($d);\n$a::{$b->c}();\nA::${$b}[$c]();\na();\n$a();\n$a()[$b];\n$a->b()[$c];\n$a::$b()[$c];\n(new A())->b;\n(new A())->b();\n(new ${$a}())[$b];\n(new $a->b())->c;\nglobal $a, ${$a};"
  },
  {
    "path": "test/code/prettyPrinter/expr/yield.test",
    "content": "Yield\n-----\n<?php\n\nfunction gen()\n{\n    yield;\n    yield $a;\n    yield $a => $b;\n    $a = yield;\n    $a = yield $b;\n    $a = yield $b => $c;\n    yield from $a;\n    $a = yield from $b;\n    (yield $a) + $b;\n    (yield from $a) + $b;\n    [yield $a => $b];\n    [(yield $a) => $b];\n    [$a + (yield $b) => $c];\n    yield yield $a => $b;\n    yield (yield $a) => $b;\n    match ($x) {\n        yield $a, (yield $b) => $c,\n    };\n    yield -$a;\n    (yield) - $a;\n    yield * $a;\n}\n-----\nfunction gen()\n{\n    yield;\n    yield $a;\n    yield $a => $b;\n    $a = yield;\n    $a = yield $b;\n    $a = yield $b => $c;\n    yield from $a;\n    $a = yield from $b;\n    (yield $a) + $b;\n    (yield from $a) + $b;\n    [yield $a => $b];\n    [(yield $a) => $b];\n    [$a + (yield $b) => $c];\n    yield yield $a => $b;\n    yield (yield $a) => $b;\n    match ($x) {\n        yield $a, (yield $b) => $c,\n    };\n    yield -$a;\n    (yield) - $a;\n    (yield) * $a;\n}\n-----\n<?php\n\nfunction gen()\n{\n    yield;\n    yield $a;\n    yield $a => $b;\n    $a = yield;\n    $a = yield $b;\n    $a = yield $b => $c;\n    yield from $a;\n    $a = yield from $b;\n    (yield $a) + $b;\n    (yield from $a) + $b;\n    [yield $a => $b];\n    [(yield $a) => $b];\n    [$a + (yield $b) => $c];\n    yield yield $a => $b;\n    yield (yield $a) => $b;\n    match ($x) {\n        yield $a, (yield $b) => $c,\n    };\n    yield -$a;\n    (yield) - $a;\n    yield * $a;\n}\n-----\n!!version=5.6,parserVersion=8.0\nfunction gen()\n{\n    yield;\n    (yield $a);\n    (yield $a => $b);\n    $a = yield;\n    $a = (yield $b);\n    $a = (yield $b => $c);\n    yield from $a;\n    $a = yield from $b;\n    (yield $a) + $b;\n    (yield from $a) + $b;\n    [(yield $a => $b)];\n    [(yield $a) => $b];\n    [$a + (yield $b) => $c];\n    (yield (yield $a => $b));\n    (yield (yield $a) => $b);\n    match ($x) {\n        (yield $a), (yield $b) => $c,\n    };\n    (yield -$a);\n    (yield) - $a;\n    (yield) * $a;\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/indent.test",
    "content": "Indentation\n-----\n<?php\n\nclass Test {\n    /**\n     * Comment\n     */\n    public function foo() {\n        if (1) {\n            echo $bar;\n        }\n    }\n}\n-----\n!!indent=\"  \"\nclass Test\n{\n  /**\n   * Comment\n   */\n  public function foo()\n  {\n    if (1) {\n      echo $bar;\n    }\n  }\n}\n-----\n<?php\n\nclass Test {\n    /**\n     * Comment\n     */\n    public function foo() {\n        if (1) {\n            echo $bar;\n        }\n    }\n}\n-----\n!!indent=\"   \"\nclass Test\n{\n   /**\n    * Comment\n    */\n   public function foo()\n   {\n      if (1) {\n         echo $bar;\n      }\n   }\n}\n-----\n<?php\n\nclass Test {\n    /**\n     * Comment\n     */\n    public function foo() {\n        if (1) {\n            echo $bar;\n        }\n    }\n}\n-----\n!!indent=\"\\t\"\nclass Test\n{\n@@{\"\\t\"}@@/**\n@@{\"\\t\"}@@ * Comment\n@@{\"\\t\"}@@ */\n@@{\"\\t\"}@@public function foo()\n@@{\"\\t\"}@@{\n@@{\"\\t\\t\"}@@if (1) {\n@@{\"\\t\\t\\t\"}@@echo $bar;\n@@{\"\\t\\t\"}@@}\n@@{\"\\t\"}@@}\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/inlineHTMLandPHPtest.file-test",
    "content": "File containing both inline HTML and PHP\n-----\nHTML\n<?php\necho 'PHP';\n-----\nHTML\n<?php\necho 'PHP';\n-----\n<?php\necho 'PHP';\n?>\nHTML\n-----\n<?php\n\necho 'PHP';\n?>\nHTML\n-----\nHTML\n<?php\necho 'PHP';\n?>\nHTML\n-----\nHTML\n<?php\necho 'PHP';\n?>\nHTML\n-----\nHTML\n<?php\necho 'PHP';\n?>\nHTML\n<?php\necho 'PHP';\n?>\nHTML\n-----\nHTML\n<?php\necho 'PHP';\n?>\nHTML\n<?php\necho 'PHP';\n?>\nHTML\n-----\nHTML<?php echo 'PHP'; ?>HTML\n-----\nHTML<?php\necho 'PHP';\n?>HTML\n-----\n<?php\necho 'PHP';\n?>@@{ \"\\r\\r\\n\" }@@Test\n-----\n<?php\n\necho 'PHP';\n?>@@{ \"\\n\\n\" }@@Test"
  },
  {
    "path": "test/code/prettyPrinter/nestedInlineHTML.test",
    "content": "InlineHTML node nested inside other code\n-----\n<?php\n\nfunction test() {\n    ?>\nTest\n    <?php\n}\n-----\nfunction test()\n{\n    ?>\nTest\n    <?php\n}"
  },
  {
    "path": "test/code/prettyPrinter/onlyInlineHTML.file-test",
    "content": "File containing only inline HTML\n-----\nHallo World\nFoo Bar\nBar Foo\nWorld Hallo\n-----\nHallo World\nFoo Bar\nBar Foo\nWorld Hallo\n-----\n\n\nTest\n-----\n\n\nTest"
  },
  {
    "path": "test/code/prettyPrinter/onlyPHP.file-test",
    "content": "File containing only PHP\n-----\n<?php\n\necho 'Foo Bar';\necho 'Bar Foo';\n-----\n<?php\n\necho 'Foo Bar';\necho 'Bar Foo';\n-----\n<?php\n\n-----\n<?php\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/alias.test",
    "content": "Aliases (namespacing)\n-----\n<?php\n\nuse A\\B;\nuse C\\D as E;\nuse F\\G as H, J;\n\nuse function foo\\bar;\nuse function foo\\bar as baz;\nuse const foo\\BAR;\nuse const foo\\BAR as BAZ;\n-----\nuse A\\B;\nuse C\\D as E;\nuse F\\G as H, J;\nuse function foo\\bar;\nuse function foo\\bar as baz;\nuse const foo\\BAR;\nuse const foo\\BAR as BAZ;"
  },
  {
    "path": "test/code/prettyPrinter/stmt/asymmetric_visibility.test",
    "content": "Asymmetric visibility modifiers\n-----\n<?php\n\nclass Test {\n    final protected private(set) $a;\n    private public(set) static $b;\n    protected(set) $c;\n\n    public function __construct(\n        protected private(set) $d,\n        private public(set) $e,\n        protected(set) $f,\n    ) {}\n}\n-----\nclass Test\n{\n    final protected private(set) $a;\n    private public(set) static $b;\n    protected(set) $c;\n    public function __construct(protected private(set) $d, private public(set) $e, protected(set) $f)\n    {\n    }\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/attributes.test",
    "content": "Attributes\n-----\n<?php\n\n#[\n    A1,\n    A2(),\n    A3(0),\n    A4(x: 1),\n]\nfunction a() {\n}\n\n#[A5]\nclass C {\n    #[A6]\n    public function m(\n        #[A7] $param,\n    ) {}\n    #[A12]\n    public $prop;\n}\n\n#[A8]\ninterface I {}\n#[A9]\ntrait T {}\n\n$x = #[A10] function() {};\n$y = #[A11] fn() => 0;\nnew #[A13] class {};\n-----\n#[A1, A2, A3(0), A4(x: 1)]\nfunction a()\n{\n}\n#[A5]\nclass C\n{\n    #[A6]\n    public function m(\n        #[A7]\n        $param\n    )\n    {\n    }\n    #[A12]\n    public $prop;\n}\n#[A8]\ninterface I\n{\n}\n#[A9]\ntrait T\n{\n}\n$x = #[A10] function () {\n};\n$y = #[A11] fn() => 0;\nnew #[A13] class\n{\n};\n-----\n<?php\nfunction test(#[A] $b) {}\n-----\n!!version=8.0\nfunction test(#[A] $b)\n{\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/block.test",
    "content": "Block statements\n-----\n<?php\necho \"a\";\n{\n}\n{\n    echo \"b\";\n}\nif ($c) {\n    echo \"c\";\n    {\n        echo \"d\";\n    }\n}\n-----\necho \"a\";\n{\n}\n{\n    echo \"b\";\n}\nif ($c) {\n    echo \"c\";\n    {\n        echo \"d\";\n    }\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/break_continue.test",
    "content": "break/continue\n-----\n<?php\n\ncontinue;\ncontinue 2;\nbreak;\nbreak 2;\n-----\ncontinue;\ncontinue 2;\nbreak;\nbreak 2;"
  },
  {
    "path": "test/code/prettyPrinter/stmt/class.test",
    "content": "Class\n-----\n<?php\n\nclass Foo extends Bar implements ABC, \\DEF, namespace\\GHI\n{\n    var $a = 'foo';\n    private $b = 'bar';\n    static $c = 'baz';\n    function test()\n    {\n        $this->a = 'bar';\n        echo 'test';\n    }\n\n    protected function baz() {}\n    public function foo() {}\n    abstract static function bar() {}\n}\n\ntrait Bar\n{\n    function test()\n    {\n    }\n}\n-----\nclass Foo extends Bar implements ABC, \\DEF, namespace\\GHI\n{\n    var $a = 'foo';\n    private $b = 'bar';\n    static $c = 'baz';\n    function test()\n    {\n        $this->a = 'bar';\n        echo 'test';\n    }\n    protected function baz()\n    {\n    }\n    public function foo()\n    {\n    }\n    abstract static function bar()\n    {\n    }\n}\ntrait Bar\n{\n    function test()\n    {\n    }\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/class_const.test",
    "content": "Class constants\n-----\n<?php\n\nclass Foo\n{\n    const A = 1, B = 2;\n    public const C = 3, D = 4;\n    protected const E = 5, F = 6;\n    private const int G = 7, H = 8;\n}\n-----\nclass Foo\n{\n    const A = 1, B = 2;\n    public const C = 3, D = 4;\n    protected const E = 5, F = 6;\n    private const int G = 7, H = 8;\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/const.test",
    "content": "Constant declarations\n-----\n<?php\n\nconst FOO = 'BAR';\nconst FOO = 1 + 1;\nconst FOO = BAR, BAR = FOO;\n\n#[Example]\nconst FOO = true;\n\n#[First]\n#[Second]\nconst FOO = true;\n\n#[First, Second]\nconst FOO = true;\n-----\nconst FOO = 'BAR';\nconst FOO = 1 + 1;\nconst FOO = BAR, BAR = FOO;\n#[Example]\nconst FOO = true;\n#[First]\n#[Second]\nconst FOO = true;\n#[First, Second]\nconst FOO = true;"
  },
  {
    "path": "test/code/prettyPrinter/stmt/declare.test",
    "content": "declare\n-----\n<?php\n\ndeclare (strict_types=1);\ndeclare (ticks=1) {\n    foo();\n}\ndeclare (ticks=2) {\n}\n-----\ndeclare (strict_types=1);\ndeclare (ticks=1) {\n    foo();\n}\ndeclare (ticks=2) {\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/disjointNormalFormTypes.test",
    "content": "Union types\n-----\n<?php\n\nclass Test {\n    public (A&B)|(X&Y) $prop;\n}\n\nfunction test((A&B)|(X&Y) $a): (A&B)|(X&Y) {}\n-----\nclass Test\n{\n    public (A&B)|(X&Y) $prop;\n}\nfunction test((A&B)|(X&Y) $a): (A&B)|(X&Y)\n{\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/do_while.test",
    "content": "doWhile\n-----\n<?php\n\ndo {\n\n} while (true);\n-----\ndo {\n} while (true);"
  },
  {
    "path": "test/code/prettyPrinter/stmt/enum.test",
    "content": "Enum\n-----\n<?php\n\nenum A implements B\n{\n    case X;\n    case Y;\n\n    public function foo() {}\n}\n\nenum B: int {\n    case X = 1;\n    case Y = 2;\n}\n\nenum C: string implements D {\n    case Z = 'A';\n}\n\nenum D: \\Foo\\Bar {}\n-----\nenum A implements B\n{\n    case X;\n    case Y;\n    public function foo()\n    {\n    }\n}\nenum B : int\n{\n    case X = 1;\n    case Y = 2;\n}\nenum C : string implements D\n{\n    case Z = 'A';\n}\nenum D : \\Foo\\Bar\n{\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/for.test",
    "content": "for\n-----\n<?php\n\nfor ($i = 0; $i < 10; $i++) {\n\n}\n\nfor ($i = 0,$j = 0; $i < 10; $i++) {\n\n}\n\nfor ($i = 0; $i < 10;) {\n\n}\n\nfor (;;) {\n\n}\n-----\nfor ($i = 0; $i < 10; $i++) {\n}\nfor ($i = 0, $j = 0; $i < 10; $i++) {\n}\nfor ($i = 0; $i < 10;) {\n}\nfor (;;) {\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/foreach.test",
    "content": "foreach\n-----\n<?php\n\nforeach ($arr as $val) {\n\n}\n\nforeach ($arr as &$val) {\n\n}\n\nforeach ($arr as $key => $val) {\n\n}\n\nforeach ($arr as $key => &$val) {\n\n}\n-----\nforeach ($arr as $val) {\n}\nforeach ($arr as &$val) {\n}\nforeach ($arr as $key => $val) {\n}\nforeach ($arr as $key => &$val) {\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/function_signatures.test",
    "content": "Function signatures\n-----\n<?php\n\ninterface A\n{\n    function f1();\n    function f2($a, $b);\n    function f3(&$a);\n    function f4(A\\B $a);\n    function f4(array $a);\n    function f5(callable $a);\n    function f6(&$a);\n    function f7(...$a);\n    function f8(&...$a);\n    function f9(A &$a);\n    function f10(A ...$a);\n    function f11(A &$a);\n    function f12(A &...$a);\n    function f13($a) : array;\n    function f14($a) : callable;\n    function f15($a) : B\\C;\n}\n-----\ninterface A\n{\n    function f1();\n    function f2($a, $b);\n    function f3(&$a);\n    function f4(A\\B $a);\n    function f4(array $a);\n    function f5(callable $a);\n    function f6(&$a);\n    function f7(...$a);\n    function f8(&...$a);\n    function f9(A &$a);\n    function f10(A ...$a);\n    function f11(A &$a);\n    function f12(A &...$a);\n    function f13($a): array;\n    function f14($a): callable;\n    function f15($a): B\\C;\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/global_static_variables.test",
    "content": "Global and static variables\n-----\n<?php\n\nglobal $a, $$a, ${$a[$a]};\nstatic $a, $b;\nstatic $a = 'foo', $b = 'bar';\n-----\nglobal $a, ${$a}, ${$a[$a]};\nstatic $a, $b;\nstatic $a = 'foo', $b = 'bar';"
  },
  {
    "path": "test/code/prettyPrinter/stmt/goto.test",
    "content": "goto\n-----\n<?php\n\nmarker:\ngoto marker;\n-----\nmarker:\ngoto marker;"
  },
  {
    "path": "test/code/prettyPrinter/stmt/groupUse.test",
    "content": "Group use declaration\n-----\n<?php\nuse A\\{B};\nuse A\\{B\\C, D};\nuse A\\B\\{C\\D, E};\nuse function A\\{b\\c, d};\nuse const A\\{B\\C, D};\nuse A\\B\\{C\\D, function b\\c, const D};\n-----\nuse A\\{B};\nuse A\\{B\\C, D};\nuse A\\B\\{C\\D, E};\nuse function A\\{b\\c, d};\nuse const A\\{B\\C, D};\nuse A\\B\\{C\\D, function b\\c, const D};\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/haltCompiler.file-test",
    "content": "__halt_compiler\n-----\n<?php\n\necho 'foo';\n__halt_compiler();\n!!!\n???\n-----\n<?php\n\necho 'foo';\n__halt_compiler();\n!!!\n???\n-----\n<?php\n\necho 'foo';\n__halt_compiler();\n<?php\n-----\n<?php\n\necho 'foo';\n__halt_compiler();\n<?php"
  },
  {
    "path": "test/code/prettyPrinter/stmt/if.test",
    "content": "if/elseif/else\n-----\n<?php\n\nif ($expr) {\n\n} elseif ($expr2) {\n\n} else if ($expr3) {\n\n} else {\n}\n-----\nif ($expr) {\n} elseif ($expr2) {\n} else if ($expr3) {\n} else {\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/intersection_types.test",
    "content": "Union types\n-----\n<?php\n\nclass Test {\n    public A&B $prop;\n}\n\nfunction test(A&B $a): A&B {}\n-----\nclass Test\n{\n    public A&B $prop;\n}\nfunction test(A&B $a): A&B\n{\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/multiCatch.test",
    "content": "Multi catch\n-----\n<?php\ntry {\n    $x;\n} catch (X|Y $e1) {\n    $y;\n} catch (\\A|B\\C $e2) {\n    $z;\n}\n-----\ntry {\n    $x;\n} catch (X|Y $e1) {\n    $y;\n} catch (\\A|B\\C $e2) {\n    $z;\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/namespaces.test",
    "content": "Namespaces\n-----\n<?php\n\nnamespace Foo;\n\nfunction foo()\n{\n}\n\nnamespace Bar;\n\nfunction bar()\n{\n}\n-----\nnamespace Foo;\n\nfunction foo()\n{\n}\nnamespace Bar;\n\nfunction bar()\n{\n}\n-----\n<?php\n\nnamespace Foo {\n    function foo()\n    {\n    }\n}\n\nnamespace {\n    function glob() {\n    }\n}\n-----\nnamespace Foo {\n    function foo()\n    {\n    }\n}\nnamespace {\n    function glob()\n    {\n    }\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/nullable_types.test",
    "content": "Nullable types\n-----\n<?php\nfunction test(?Foo $bar, ?string $foo, ?\\Xyz $zyx) : ?Baz\n{\n}\n-----\nfunction test(?Foo $bar, ?string $foo, ?\\Xyz $zyx): ?Baz\n{\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/param_comments.test",
    "content": "Comments on function parameters\n-----\n<?php\n\nclass Test {\n    function test(\n        // Comment\n        $param\n    ) {\n    }\n}\n\nfunction test(\n    // Comment\n    $param\n) {\n}\n\nfunction(\n    // Comment\n    $param\n) {\n};\n\nfn(\n    // Comment\n    $param\n) => 42;\n-----\nclass Test\n{\n    function test(\n        // Comment\n        $param\n    )\n    {\n    }\n}\nfunction test(\n    // Comment\n    $param\n)\n{\n}\nfunction (\n    // Comment\n    $param\n) {\n};\nfn(\n    // Comment\n    $param\n) => 42;\n-----\n<?php\n\nclass Test {\n    function test(\n        // Comment\n        $param\n    ) {\n    }\n}\n\nfunction test(\n    // Comment\n    $param\n) {\n}\n\nfunction(\n    // Comment\n    $param\n) {\n};\n\nfn(\n    // Comment\n    $param\n) => 42;\n-----\n!!version=8.0\nclass Test\n{\n    function test(\n        // Comment\n        $param,\n    )\n    {\n    }\n}\nfunction test(\n    // Comment\n    $param,\n)\n{\n}\nfunction (\n    // Comment\n    $param,\n) {\n};\nfn(\n    // Comment\n    $param,\n) => 42;\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/properties.test",
    "content": "Class properties\n-----\n<?php\n\nclass A\n{\n    public $a;\n    public string $b;\n    protected static ?float $c = 5.0;\n    private static ?self $d;\n    public readonly int|float $e;\n}\n-----\nclass A\n{\n    public $a;\n    public string $b;\n    protected static ?float $c = 5.0;\n    private static ?self $d;\n    public readonly int|float $e;\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/property_hooks.test",
    "content": "Property hooks\n-----\n<?php\nclass Test {\n    public int $prop {\n        get {\n            return $this->prop + 1;\n        }\n        set {\n            $this->prop = $value - 1;\n        }\n    }\n    public $prop = 1 {\n        #[Attr]\n        &get => $this->prop;\n        final set($value) => $value - 1;\n    }\n    abstract public $prop {\n        get;\n        set;\n    }\n\n    // TODO: Force multiline for hooks?\n    public function __construct(\n        public $foo {\n            get => 42;\n            set => 123;\n        },\n        public $bar\n    ) {}\n}\n-----\nclass Test\n{\n    public int $prop {\n        get {\n            return $this->prop + 1;\n        }\n        set {\n            $this->prop = $value - 1;\n        }\n    }\n    public $prop = 1 {\n        #[Attr]\n        &get => $this->prop;\n        final set($value) => $value - 1;\n    }\n    abstract public $prop {\n        get;\n        set;\n    }\n    // TODO: Force multiline for hooks?\n    public function __construct(public $foo {\n        get => 42;\n        set => 123;\n    }, public $bar)\n    {\n    }\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/property_promotion.test",
    "content": "Property promotion\n-----\n<?php\n\nclass Point\n{\n    public function __construct(\n        public float $x = 0.0,\n        protected array $y = [],\n        private string $z = 'hello',\n        public readonly int $a = 0,\n        protected final bool $b = true,\n    ) {\n    }\n}\n-----\nclass Point\n{\n    public function __construct(public float $x = 0.0, protected array $y = [], private string $z = 'hello', public readonly int $a = 0, final protected bool $b = true)\n    {\n    }\n}\n-----\n<?php\nclass Test\n{\n    public $z;\n    public function __construct(\n        public int $x,\n        /** @SomeAnnotation() */\n        public string $y = \"123\",\n        string $z = \"abc\"\n    )\n    {\n    }\n}\n-----\nclass Test\n{\n    public $z;\n    public function __construct(\n        public int $x,\n        /** @SomeAnnotation() */\n        public string $y = \"123\",\n        string $z = \"abc\"\n    )\n    {\n    }\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/readonly_class.test",
    "content": "Readonly class\n-----\n<?php\n\nreadonly class Foo\n{\n}\n-----\nreadonly class Foo\n{\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/staticType.test",
    "content": "Static return type\n-----\n<?php\nclass Test {\n    public static function create(): static {}\n}\n-----\nclass Test\n{\n    public static function create(): static\n    {\n    }\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/switch.test",
    "content": "switch/case/default\n-----\n<?php\n\nswitch ($expr) {\n    case 0:\n        echo 'First case, with a break';\n        break;\n    case 1:\n        echo 'Second case, which falls through';\n    case 2:\n    case 3:\n    case 4:\n        echo 'Third case, return instead of break';\n        return;\n    // Comment\n    default:\n        echo 'Default case';\n        break;\n}\n-----\nswitch ($expr) {\n    case 0:\n        echo 'First case, with a break';\n        break;\n    case 1:\n        echo 'Second case, which falls through';\n    case 2:\n    case 3:\n    case 4:\n        echo 'Third case, return instead of break';\n        return;\n    // Comment\n    default:\n        echo 'Default case';\n        break;\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/throw.test",
    "content": "throw\n-----\n<?php\n\nthrow $e;\n-----\nthrow $e;"
  },
  {
    "path": "test/code/prettyPrinter/stmt/traitUse.test",
    "content": "Trait uses and adaptations\n-----\n<?php\n\nclass A\n{\n    use B, C, D {\n        f as g;\n        f as private;\n        f as private g;\n        B::f as g;\n        B::f insteadof C, D;\n    }\n}\n-----\nclass A\n{\n    use B, C, D {\n        f as g;\n        f as private;\n        f as private g;\n        B::f as g;\n        B::f insteadof C, D;\n    }\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/tryCatch.test",
    "content": "tryCatch\n-----\n<?php\n\ntry {\n\n} catch (Exception $e) {\n\n}\n\ntry {\n} catch (Exception $e) {\n\n} finally {\n\n}\n-----\ntry {\n} catch (Exception $e) {\n}\ntry {\n} catch (Exception $e) {\n} finally {\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/tryCatch_without_variable.test",
    "content": "tryCatch without variable\n-----\n<?php\n\ntry {\n\n} catch (Exception) {\n\n} finally {\n\n}\n-----\ntry {\n} catch (Exception) {\n} finally {\n}\n"
  },
  {
    "path": "test/code/prettyPrinter/stmt/union_types.test",
    "content": "Union types\n-----\n<?php\n\nclass Test {\n    public A|iterable|null $prop;\n}\n\nfunction test(A|B $a): int|false {}\n-----\nclass Test\n{\n    public A|iterable|null $prop;\n}\nfunction test(A|B $a): int|false\n{\n}"
  },
  {
    "path": "test/code/prettyPrinter/stmt/voidCast.test",
    "content": "Void cast\n-----\n<?php\n(void) foo();\n-----\n(void) foo();"
  },
  {
    "path": "test/code/prettyPrinter/stmt/while.test",
    "content": "while\n-----\n<?php\n\nwhile (true) {\n\n}\n-----\nwhile (true) {\n}"
  },
  {
    "path": "test/fixtures/Suit.php",
    "content": "<?php declare(strict_types=1);\n\nenum Suit {\n    case Hearts;\n    case Diamonds;\n    case Clubs;\n    case Spades;\n}\n"
  },
  {
    "path": "test/updateTests.php",
    "content": "<?php declare(strict_types=1);\n\nnamespace PhpParser;\n\nrequire __DIR__ . '/bootstrap.php';\nrequire __DIR__ . '/PhpParser/CodeTestParser.php';\nrequire __DIR__ . '/PhpParser/CodeParsingTest.php';\n\n$dir = __DIR__ . '/code/parser';\n\n$testParser = new CodeTestParser();\n$codeParsingTest = new CodeParsingTest();\nforeach (filesInDir($dir, 'test') as $fileName => $code) {\n    if (false !== strpos($code, '@@{')) {\n        // Skip tests with evaluate segments\n        continue;\n    }\n\n    list($name, $tests) = $testParser->parseTest($code, 2);\n    $newTests = [];\n    foreach ($tests as list($modeLine, list($input, $expected))) {\n        $modes = $codeParsingTest->parseModeLine($modeLine);\n        $parser = $codeParsingTest->createParser($modes['version'] ?? null);\n        list(, $output) = $codeParsingTest->getParseOutput($parser, $input, $modes);\n        $newTests[] = [$modeLine, [$input, $output]];\n    }\n\n    $newCode = $testParser->reconstructTest($name, $newTests);\n    file_put_contents($fileName, $newCode);\n}\n"
  },
  {
    "path": "test_old/run-php-src.sh",
    "content": "VERSION=$1\nif [[ ! -f php-$VERSION.tar.gz ]]; then\n    wget -q https://github.com/php/php-src/archive/php-$VERSION.tar.gz\nfi\nrm -rf ./data/php-src\nmkdir -p ./data/php-src\ntar -xzf ./php-$VERSION.tar.gz -C ./data/php-src --strip-components=1\nphp test_old/run.php --verbose --no-progress --php-version=$VERSION PHP ./data/php-src\n"
  },
  {
    "path": "test_old/run.php",
    "content": "<?php\n\nerror_reporting(E_ALL);\nini_set('short_open_tag', false);\n\nif ('cli' !== php_sapi_name()) {\n    die('This script is designed for running on the command line.');\n}\n\nfunction showHelp($error) {\n    die($error . \"\\n\\n\" .\n<<<OUTPUT\nThis script has to be called with the following signature:\n\n    php run.php [--no-progress] testType pathToTestFiles\n\nThe test type must be one of: PHP, Symfony\n\nThe following options are available:\n\n    --no-progress            Disables showing which file is currently tested.\n    --verbose                Print more information for failures.\n    --php-version=VERSION    PHP version to use for lexing/parsing.\n\nOUTPUT\n    );\n}\n\n$allowedOptions = [\n    '--no-progress' => true,\n    '--verbose' => true,\n    '--php-version' => true,\n];\n\n$options = array();\n$arguments = array();\n\n// remove script name from argv\narray_shift($argv);\n\nforeach ($argv as $arg) {\n    if ('-' === $arg[0]) {\n        $parts = explode('=', $arg);\n        $name = $parts[0];\n        if (!isset($allowedOptions[$name])) {\n            showHelp(\"Unknown option \\\"$name\\\"\");\n        }\n        $options[$name] = $parts[1] ?? true;\n    } else {\n        $arguments[] = $arg;\n    }\n}\n\nif (count($arguments) !== 2) {\n    showHelp('Too few arguments passed!');\n}\n\n$showProgress = !isset($options['--no-progress']);\n$verbose = isset($options['--verbose']);\n$phpVersion = $options['--php-version'] ?? '8.0';\n$testType = $arguments[0];\n$dir = $arguments[1];\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\nswitch ($testType) {\n    case 'Symfony':\n        $fileFilter = function($path) {\n            if (!preg_match('~\\.php$~', $path)) {\n                return false;\n            }\n\n            if (preg_match('~(?:\n# invalid php code\n  dependency-injection.Tests.Fixtures.xml.xml_with_wrong_ext\n# difference in nop statement\n| framework-bundle.Resources.views.Form.choice_widget_options\\.html\n# difference due to INF\n| yaml.Tests.InlineTest\n)\\.php$~x', $path)) {\n                return false;\n            }\n\n            return true;\n        };\n        $codeExtractor = function($file, $code) {\n            return $code;\n        };\n        break;\n    case 'PHP':\n        $fileFilter = function($path) {\n            return preg_match('~\\.phpt$~', $path);\n        };\n        $codeExtractor = function($file, $code) {\n            if (preg_match('~(?:\n# skeleton files\n  ext.gmp.tests.001\n| ext.skeleton.tests.00\\d\n# multibyte encoded files\n| ext.mbstring.tests.zend_multibyte-01\n| Zend.tests.multibyte.multibyte_encoding_001\n| Zend.tests.multibyte.multibyte_encoding_004\n| Zend.tests.multibyte.multibyte_encoding_005\n# invalid code due to missing WS after opening tag\n| tests.run-test.bug75042-3\n# contains invalid chars, which we treat as parse error\n| Zend.tests.warning_during_heredoc_scan_ahead\n# pretty print differences due to negative LNumbers\n| Zend.tests.neg_num_string\n| Zend.tests.numeric_strings.neg_num_string\n| Zend.tests.bug72918\n# pretty print difference due to nop statements\n| ext.mbstring.tests.htmlent\n| ext.standard.tests.file.fread_basic\n# its too hard to emulate these on old PHP versions\n| Zend.tests.flexible-heredoc-complex-test[1-4]\n# whitespace in namespaced name\n| Zend.tests.bug55086\n| Zend.tests.grammar.regression_010\n# not worth emulating on old PHP versions\n| Zend.tests.type_declarations.intersection_types.parsing_comment\n# comments in property fetch syntax, not emulated on old PHP versions\n| Zend.tests.gh14961\n# harmless pretty print difference for clone($x, )\n| Zend.tests.clone.ast\n)\\.phpt$~x', $file)) {\n                return null;\n            }\n\n            if (!preg_match('~--FILE--\\s*(.*?)\\n--[A-Z]+--~s', $code, $matches)) {\n                return null;\n            }\n            if (preg_match('~--EXPECT(?:F|REGEX)?--\\s*(?:Parse|Fatal) error~', $code)) {\n                return null;\n            }\n\n            return $matches[1];\n        };\n        break;\n    default:\n        showHelp('Test type must be one of: PHP or Symfony');\n}\n\n$parser = (new PhpParser\\ParserFactory())->createForVersion(PhpParser\\PhpVersion::fromString($phpVersion));\n$prettyPrinter = new PhpParser\\PrettyPrinter\\Standard;\n$nodeDumper = new PhpParser\\NodeDumper;\n\n$cloningTraverser = new PhpParser\\NodeTraverser;\n$cloningTraverser->addVisitor(new PhpParser\\NodeVisitor\\CloningVisitor);\n\n$parseFail = $fpppFail = $ppFail = $compareFail = $count = 0;\n\n$readTime = $parseTime = $cloneTime = 0;\n$fpppTime = $ppTime = $reparseTime = $compareTime = 0;\n$totalStartTime = microtime(true);\n\nforeach (new RecursiveIteratorIterator(\n             new RecursiveDirectoryIterator($dir),\n             RecursiveIteratorIterator::LEAVES_ONLY)\n         as $file) {\n    if (!$fileFilter($file)) {\n        continue;\n    }\n\n    $startTime = microtime(true);\n    $origCode = file_get_contents($file);\n    $readTime += microtime(true) - $startTime;\n\n    if (null === $origCode = $codeExtractor($file, $origCode)) {\n        continue;\n    }\n\n    set_time_limit(10);\n\n    ++$count;\n\n    if ($showProgress) {\n        echo substr(str_pad('Testing file ' . $count . ': ' . substr($file, strlen($dir)), 79), 0, 79), \"\\r\";\n    }\n\n    try {\n        $startTime = microtime(true);\n        $origStmts = $parser->parse($origCode);\n        $parseTime += microtime(true) - $startTime;\n\n        $origTokens = $parser->getTokens();\n\n        $startTime = microtime(true);\n        $stmts = $cloningTraverser->traverse($origStmts);\n        $cloneTime += microtime(true) - $startTime;\n\n        $startTime = microtime(true);\n        $code = $prettyPrinter->printFormatPreserving($stmts, $origStmts, $origTokens);\n        $fpppTime += microtime(true) - $startTime;\n\n        if ($code !== $origCode) {\n            echo $file, \":\\n Result of format-preserving pretty-print differs\\n\";\n            if ($verbose) {\n                echo \"FPPP output:\\n=====\\n$code\\n=====\\n\\n\";\n            }\n\n            ++$fpppFail;\n        }\n\n        $startTime = microtime(true);\n        $code = \"<?php\\n\" . $prettyPrinter->prettyPrint($stmts);\n        $ppTime += microtime(true) - $startTime;\n\n        try {\n            $startTime = microtime(true);\n            $ppStmts = $parser->parse($code);\n            $reparseTime += microtime(true) - $startTime;\n\n            $startTime = microtime(true);\n            $same = $nodeDumper->dump($stmts) == $nodeDumper->dump($ppStmts);\n            $compareTime += microtime(true) - $startTime;\n\n            if (!$same) {\n                echo $file, \":\\n    Result of initial parse and parse after pretty print differ\\n\";\n                if ($verbose) {\n                    echo \"Pretty printer output:\\n=====\\n$code\\n=====\\n\\n\";\n                }\n\n                ++$compareFail;\n            }\n        } catch (PhpParser\\Error $e) {\n            echo $file, \":\\n    Parse of pretty print failed with message: {$e->getMessage()}\\n\";\n            if ($verbose) {\n                echo \"Pretty printer output:\\n=====\\n$code\\n=====\\n\\n\";\n            }\n\n            ++$ppFail;\n        }\n    } catch (PhpParser\\Error $e) {\n        echo $file, \":\\n    Parse failed with message: {$e->getMessage()}\\n\";\n\n        ++$parseFail;\n    } catch (Throwable $e) {\n        echo $file, \":\\n    Unknown error occurred: $e\\n\";\n    }\n}\n\nif (0 === $parseFail && 0 === $ppFail && 0 === $compareFail) {\n    $exit = 0;\n    echo \"\\n\\n\", 'All tests passed.', \"\\n\";\n} else {\n    $exit = 1;\n    echo \"\\n\\n\", '==========', \"\\n\\n\", 'There were: ', \"\\n\";\n    if (0 !== $parseFail) {\n        echo '    ', $parseFail,   ' parse failures.',        \"\\n\";\n    }\n    if (0 !== $ppFail) {\n        echo '    ', $ppFail,      ' pretty print failures.', \"\\n\";\n    }\n    if (0 !== $fpppFail) {\n        echo '    ', $fpppFail,      ' FPPP failures.', \"\\n\";\n    }\n    if (0 !== $compareFail) {\n        echo '    ', $compareFail, ' compare failures.',      \"\\n\";\n    }\n}\n\necho \"\\n\",\n     'Tested files:         ', $count,        \"\\n\",\n     \"\\n\",\n     'Reading files took:   ', $readTime,    \"\\n\",\n     'Parsing took:         ', $parseTime,   \"\\n\",\n     'Cloning took:         ', $cloneTime,   \"\\n\",\n     'FPPP took:            ', $fpppTime,    \"\\n\",\n     'Pretty printing took: ', $ppTime,      \"\\n\",\n     'Reparsing took:       ', $reparseTime, \"\\n\",\n     'Comparing took:       ', $compareTime, \"\\n\",\n     \"\\n\",\n     'Total time:           ', microtime(true) - $totalStartTime, \"\\n\",\n     'Maximum memory usage: ', memory_get_peak_usage(true), \"\\n\";\n\nexit($exit);\n"
  },
  {
    "path": "tools/composer.json",
    "content": "{\n    \"require\": {\n        \"friendsofphp/php-cs-fixer\": \"^3.10\",\n        \"phpstan/phpstan\": \"^2.0\"\n    }\n}\n"
  },
  {
    "path": "tools/fuzzing/generateCorpus.php",
    "content": "<?php declare(strict_types=1);\n\n$testDir = __DIR__ . '/../../test';\nrequire $testDir . '/bootstrap.php';\nrequire $testDir . '/PhpParser/CodeTestParser.php';\nrequire $testDir . '/PhpParser/CodeParsingTest.php';\n\n$inputDirs = [$testDir . '/code/parser', $testDir . '/code/prettyPrinter'];\n\nif ($argc < 2) {\n    echo \"Usage: php generateCorpus.php dir/\\n\";\n    exit(1);\n}\n\n$corpusDir = $argv[1];\nif (!is_dir($corpusDir)) {\n    mkdir($corpusDir, 0777, true);\n}\n\n$testParser = new PhpParser\\CodeTestParser();\n$codeParsingTest = new PhpParser\\CodeParsingTest();\nforeach ($inputDirs as $inputDir) {\n    foreach (PhpParser\\filesInDir($inputDir, 'test') as $fileName => $code) {\n        list($_name, $tests) = $testParser->parseTest($code, 2);\n        foreach ($tests as list($_modeLine, list($input, $_expected))) {\n            $path = $corpusDir . '/' . md5($input) . '.txt';\n            file_put_contents($path, $input);\n        }\n    }\n}\n"
  },
  {
    "path": "tools/fuzzing/php.dict",
    "content": "\"<?\"\n\"<?php\"\n\"?>\"\n\"__class__\"\n\"__dir__\"\n\"__file__\"\n\"__function__\"\n\"__halt_compiler\"\n\"__line__\"\n\"__method__\"\n\"__namespace__\"\n\"__trait__\"\n\"abstract\"\n\"array\"\n\"as\"\n\"binary\"\n\"bool\"\n\"boolean\"\n\"break\"\n\"callable\"\n\"case\"\n\"catch\"\n\"class\"\n\"clone\"\n\"const\"\n\"continue\"\n\"declare\"\n\"default\"\n\"die\"\n\"do\"\n\"double\"\n\"echo\"\n\"else\"\n\"elseif\"\n\"empty\"\n\"enddeclare\"\n\"endfor\"\n\"endforeach\"\n\"endif\"\n\"endswitch\"\n\"endwhile\"\n\"eval\"\n\"exit\"\n\"extends\"\n\"final\"\n\"finally\"\n\"float\"\n\"fn\"\n\"for\"\n\"foreach\"\n\"function\"\n\"global\"\n\"goto\"\n\"if\"\n\"implements\"\n\"include\"\n\"include_once\"\n\"instanceof\"\n\"insteadof\"\n\"int\"\n\"integer\"\n\"interface\"\n\"isset\"\n\"list\"\n\"namespace\"\n\"new\"\n\"object\"\n\"print\"\n\"private\"\n\"protected\"\n\"public\"\n\"readonly\"\n\"real\"\n\"require\"\n\"require_once\"\n\"return\"\n\"static\"\n\"string\"\n\"switch\"\n\"throw\"\n\"trait\"\n\"try\"\n\"unset\"\n\"unset\"\n\"use\"\n\"var\"\n\"while\"\n\"yield from\"\n\"yield\"\n"
  },
  {
    "path": "tools/fuzzing/target.php",
    "content": "<?php declare(strict_types=1);\n\n/** @var PhpFuzzer\\Fuzzer $fuzzer */\n\nuse PhpParser\\Node;\nuse PhpParser\\Node\\Expr;\nuse PhpParser\\Node\\Scalar;\nuse PhpParser\\Node\\Stmt;\nuse PhpParser\\NodeVisitor;\n\nif (class_exists(PhpParser\\Parser\\Php7::class)) {\n    echo \"The PHP-Parser target can only be used with php-fuzzer.phar,\\n\";\n    echo \"otherwise there is a conflict with php-fuzzer's own use of PHP-Parser.\\n\";\n    exit(1);\n}\n\n$autoload = __DIR__ . '/../../vendor/autoload.php';\nif (!file_exists($autoload)) {\n    echo \"Cannot find PHP-Parser installation in \" . __DIR__ . \"/PHP-Parser\\n\";\n    exit(1);\n}\n\nrequire $autoload;\n\n$lexer = new PhpParser\\Lexer();\n$parser = new PhpParser\\Parser\\Php7($lexer);\n$prettyPrinter = new PhpParser\\PrettyPrinter\\Standard();\n$nodeDumper = new PhpParser\\NodeDumper();\n$visitor = new class extends PhpParser\\NodeVisitorAbstract {\n    private const CAST_NAMES = [\n        'int', 'integer',\n        'double', 'float', 'real',\n        'string', 'binary',\n        'array', 'object',\n        'bool', 'boolean',\n        'unset',\n    ];\n\n\n    private $tokens;\n    public $hasProblematicConstruct;\n\n    public function setTokens(array $tokens): void {\n        $this->tokens = $tokens;\n    }\n\n    public function beforeTraverse(array $nodes): void {\n        $this->hasProblematicConstruct = false;\n    }\n\n    public function leaveNode(PhpParser\\Node $node) {\n        // We don't precisely preserve nop statements.\n        if ($node instanceof Stmt\\Nop) {\n            return NodeVisitor::REMOVE_NODE;\n        }\n\n        // We don't precisely preserve redundant trailing commas in array destructuring.\n        if ($node instanceof Expr\\List_) {\n            while (!empty($node->items) && $node->items[count($node->items) - 1] === null) {\n                array_pop($node->items);\n            }\n        }\n\n        // For T_NUM_STRING the parser produced negative integer literals. Convert these into\n        // a unary minus followed by a positive integer.\n        if ($node instanceof Scalar\\Int_ && $node->value < 0) {\n            if ($node->value === \\PHP_INT_MIN) {\n                // PHP_INT_MIN == -PHP_INT_MAX - 1\n                return new Expr\\BinaryOp\\Minus(\n                    new Expr\\UnaryMinus(new Scalar\\Int_(\\PHP_INT_MAX)),\n                    new Scalar\\Int_(1));\n            }\n            return new Expr\\UnaryMinus(new Scalar\\Int_(-$node->value));\n        }\n\n        // If a constant with the same name as a cast operand occurs inside parentheses, it will\n        // be parsed back as a cast. E.g. \"foo(int)\" will fail to parse, because the argument is\n        // interpreted as a cast. We can run into this with inputs like \"foo(int\\n)\", where the\n        // newline is not preserved.\n        if ($node instanceof Expr\\ConstFetch && $node->name->isUnqualified() &&\n            in_array($node->name->toLowerString(), self::CAST_NAMES)\n        ) {\n            $this->hasProblematicConstruct = true;\n        }\n\n        // The parser does not distinguish between use X and use \\X, as they are semantically\n        // equivalent. However, use \\keyword is legal PHP, while use keyword is not, so we inspect\n        // tokens to detect this situation here.\n        if ($node instanceof Stmt\\Use_ && $node->uses[0]->name->isUnqualified() &&\n            $this->tokens[$node->uses[0]->name->getStartTokenPos()]->is(\\T_NAME_FULLY_QUALIFIED)\n        ) {\n            $this->hasProblematicConstruct = true;\n        }\n        if ($node instanceof Stmt\\GroupUse && $node->prefix->isUnqualified() &&\n            $this->tokens[$node->prefix->getStartTokenPos()]->is(\\T_NAME_FULLY_QUALIFIED)\n        ) {\n            $this->hasProblematicConstruct = true;\n        }\n\n        // clone($x, ) is not preserved precisely.\n        if ($node instanceof Expr\\FuncCall && $node->name instanceof Node\\Name &&\n            $node->name->toLowerString() == 'clone' && count($node->args) == 1\n        ) {\n            $this->hasProblematicConstruct = true;\n        }\n    }\n};\n$traverser = new PhpParser\\NodeTraverser();\n$traverser->addVisitor($visitor);\n\n$fuzzer->setTarget(function(string $input) use($lexer, $parser, $prettyPrinter, $nodeDumper, $visitor, $traverser) {\n    $stmts = $parser->parse($input);\n    $printed = $prettyPrinter->prettyPrintFile($stmts);\n\n    $visitor->setTokens($parser->getTokens());\n    $stmts = $traverser->traverse($stmts);\n    if ($visitor->hasProblematicConstruct) {\n        return;\n    }\n\n    try {\n        $printedStmts = $parser->parse($printed);\n    } catch (PhpParser\\Error $e) {\n        throw new Error(\"Failed to parse pretty printer output\");\n    }\n\n    $visitor->setTokens($parser->getTokens());\n    $printedStmts = $traverser->traverse($printedStmts);\n    $same = $nodeDumper->dump($stmts) == $nodeDumper->dump($printedStmts);\n    if (!$same && !preg_match('/<\\?php<\\?php/i', $input)) {\n        throw new Error(\"Result after pretty printing differs\");\n    }\n});\n\n$fuzzer->setMaxLen(1024);\n$fuzzer->addDictionary(__DIR__ . '/php.dict');\n$fuzzer->setAllowedExceptions([PhpParser\\Error::class]);\n"
  }
]