Skip to content

Releases: nikic/PHP-Parser

PHP-Parser 4.5.0

03 Jun 07:26
Compare
Choose a tag to compare

Added

  • [PHP 8.0] Added support for the mixed type. This means mixed types are now parsed as an Identifier rather than a Name.
  • [PHP 8.0] Added support for catching without capturing the exception. This means that Catch_::$var may now be null.

PHP-Parser 4.4.0

10 Apr 16:39
Compare
Choose a tag to compare

Added

  • Added support for passing union types in builders.
  • Added end line, token position and file position information for comments.
  • Added getProperty() method to ClassLike nodes.
  • [PHP 8.0] Add support for variable syntax tweaks RFC.

Fixed

  • Fixed generation of invalid code when using the formatting preserving pretty printer, and inserting code next to certain nop statements. The formatting is still ugly though.
  • getDocComment() no longer requires that the very last comment before a node be a doc comment. There may not be non-doc comments between the doc comment and the declaration.
  • Allowed arbitrary expressions in isset() and list(), rather than just variables. In particular, this allows isset(($x)), which is legal PHP code.

PHP-Parser 4.3.0

10 Apr 16:38
Compare
Choose a tag to compare

Added

  • [PHP 8.0] Added support for union types using a new UnionType node.

PHP-Parser 4.2.5

25 Oct 18:39
Compare
Choose a tag to compare

Changed

  • Tests and documentation are no longer included in source archives. They can still be accessed by cloning the repository.
  • php-yacc is now used to generate the parser. This has no impact on users of the library.

PHP-Parser 4.2.4

01 Sep 08:35
Compare
Choose a tag to compare

Added

  • Added getProperties(), getConstants() and getTraitUses() to ClassLike. (#629, #630)

Fixed

  • Fixed flexible heredoc emulation to check for digits after the end label. This synchronizes behavior with the upcoming PHP 7.3.10 release.

PHP-Parser 4.2.3

12 Aug 20:18
Compare
Choose a tag to compare

Added

  • [PHP 7.4] Add support for numeric literal separators. (#615)

Fixed

  • Fixed resolution of return types for arrow functions. (#613)
  • Fixed compatibility with PHP 7.4.

PHP-Parser 4.2.2

25 May 20:08
Compare
Choose a tag to compare

Added

  • [PHP 7.4] Add support for arrow functions using a new Expr\ArrowFunction node. (#602)
  • [PHP 7.4] Add support for array spreads, using a new unpack subnode on ArrayItem. (#609)
  • Added support for inserting into empty list nodes in the formatting preserving pretty printer.

Changed

  • php-parse will now print messages to stderr, so that stdout only contains the actual result of the operation (such as a JSON dump). (#605)

Fixed

  • Fixed attribute assignment for zero-length nop statements, and a related assertion failure in the formatting-preserving pretty printer. (#589)

PHP-Parser 4.2.1

16 Feb 20:57
Compare
Choose a tag to compare

Added

  • [PHP 7.4] Add support for ??= operator through a new AssignOp\Coalesce node. (#575)

PHP-Parser 4.2.0

12 Jan 16:34
Compare
Choose a tag to compare

Added

  • [PHP 7.4] Add support for typed properties through a new type subnode of Stmt\Property. Additionally Builder\Property now has a setType() method. (#567)
  • Add kind attribute to Cast\Double_, which allows to distinguish between (float), (double) and (real). The form of the cast will be preserved by the pretty printer. (#565)

Fixed

  • Remove assertion when pretty printing anonymous class with a name (#554).

PHP-Parser 4.1.1

26 Dec 12:27
Compare
Choose a tag to compare

Fixed

  • Fix "undefined offset" notice when parsing specific malformed code (#551).

Added

  • Support error recovery for missing return type (function foo() : {}) (#544).