All Versions
64
Latest Version
Avg Release Cycle
43 days
Latest Release
597 days ago

Changelog History
Page 1

  • v5.0.0-alpha1 Changes

    September 04, 2022

    โฌ†๏ธ See UPGRADE-5.0 for detailed migration instructions.

    ๐Ÿ”„ Changed

    • ๐Ÿ“œ PHP 7.1 is now required to run PHP-Parser.
    • ๐Ÿ–จ Formatting of the standard pretty printer has been adjusted to match PSR-12 more closely.
    • ๐Ÿ“œ The internal token representation now uses a PhpParser\Token class, which is compatible with PHP 8 token representation (PhpToken).
    • Destructuring is now always represented using Expr\List_ nodes, even if it uses [] syntax.
    • ๐Ÿšš Renamed a number of node classes, and moved things that were not real expressions/statements outside the Expr/Stmt hierarchy. Compatibility shims for the old names have been retained.

    โž• Added

    • โž• Added PhpVersion class, which is accepted in a number of places (e.g. ParserFactory, Parser, Lexer, PrettyPrinter) and gives more precise control over the PHP version being targeted.
    • โž• Added PHP 8 parser though it only differs from the PHP 7 parser in concatenation precedence.
    • โž• Added Parser::getLexer() method.
    • Added a Modifiers class, as a replacement for Stmt\Class_::MODIFIER_*.
    • โž• Added support for returning an array or REMOVE_NODE from NodeVisitor::enterNode().

    โœ‚ Removed

    • ๐Ÿšš The PHP 5 parser has been removed. The PHP 7 parser has been adjusted to deal with PHP 5 code more gracefully.
  • v4.15.2 Changes

    November 12, 2022

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fixed parsing of large hex float literals that contain an "e" character.
    • ๐Ÿ›  Fixed tests to pass on 32-bit.
    • ๐Ÿ›  Fixed generation of invalid code when using formatting-preserving pretty printer with code that uses inline HTML.
  • v4.15.1 Changes

    September 04, 2022

    ๐Ÿ›  Fixed

    • Fixed formatting preservation when adding multiple attributes to a class/method/etc that previously had none. This fixes a regression in the 4.15.0 release.
  • v4.15.0 Changes

    September 03, 2022

    โž• Added

    • ๐Ÿ‘ PHP 8.2: Added support for true type.
    • ๐Ÿ‘ PHP 8.2: Added support for DNF types.

    ๐Ÿ›  Fixed

    • ๐Ÿ‘Œ Support readonly as a function name.
    • Added __serialize and __unserialize to magic method list.
    • ๐Ÿ›  Fixed bounds check in Name::slice().
    • ๐Ÿ›  Fixed formatting preservation when adding attributes to a class/method/etc that previously had none.
  • v4.14.1-dev Changes

    Nothing yet.

  • v4.14.0 Changes

    May 31, 2022

    โž• Added

    • โž• Added support for readonly classes.
    • โž• Added rawValue attribute to LNumber, DNumber and String_ nodes, which stores the unparsed value of the literal (e.g. "1_000" rather than 1000).
  • v4.13.2 Changes

    November 30, 2021

    โž• Added

    • โž• Added builders for enums and enum cases.

    ๐Ÿ›  Fixed

    • NullsafeMethodCall now extends from CallLike.
    • The namespacedName property populated by the NameResolver is now declared on relevant nodes, to avoid a dynamic property deprecation warning with PHP 8.2.
  • v4.13.1 Changes

    November 03, 2021

    ๐Ÿ›  Fixed

    • ๐Ÿ‘Œ Support reserved keywords as enum cases.
    • ๐Ÿ‘Œ Support array unpacking in constant expression evaluator.
  • v4.13.0 Changes

    September 20, 2021

    โž• Added

    • ๐Ÿ‘ [PHP 8.1] Added support for intersection types using a new IntersectionType node. Additionally a ComplexType parent class for NullableType, UnionType and IntersectionType has been added.
    • ๐Ÿ‘ [PHP 8.1] Added support for explicit octal literals.
    • ๐Ÿ‘ [PHP 8.1] Added support for first-class callables. These are represented using a call whose first argument is a VariadicPlaceholder. The representation is intended to be forward-compatible with partial function application, just like the PHP feature itself. Call nodes now extend from Expr\CallLike, which provides an isFirstClassCallable() method to determine whether a placeholder id present. getArgs() can be used to assert that the call is not a first-class callable and returns Arg[] rather than array<Arg|VariadicPlaceholder>.

    ๐Ÿ›  Fixed

    • Multiple modifiers for promoted properties are now accepted. In particular this allows something like public readonly for promoted properties.
    • ๐Ÿ–จ Formatting-preserving pretty printing for comments in array literals has been fixed.
  • v4.12.0 Changes

    July 21, 2021

    โž• Added

    • ๐Ÿ‘ [PHP 8.1] Added support for readonly properties (through a new MODIFIER_READONLY).
    • ๐Ÿ‘ [PHP 8.1] Added support for final class constants.

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fixed compatibility with PHP 8.1. & tokens are now canonicalized to the T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG and T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG tokens used in PHP 8.1. This happens unconditionally, regardless of whether the emulative lexer is used.