Skip to content

Releases: nikic/PHP-Parser

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).

PHP-Parser 4.1.0

10 Oct 09:26
Compare
Choose a tag to compare

Added

  • Added support for PHP 7.3 flexible heredoc/nowdoc strings, completing support for PHP 7.3. There are two caveats for this feature:
    • In some rare, pathological cases flexible heredoc/nowdoc strings change the interpretation of existing doc strings. PHP-Parser will now use the new interpretation.
    • Flexible heredoc/nowdoc strings require special support from the lexer. Because this is not available on PHP versions before 7.3, support has to be emulated. This emulation is not perfect and some cases which we do not expect to occur in practice (such as flexible doc strings being nested within each other through abuse of variable-variable interpolation syntax) may not be recognized correctly.
  • Added DONT_TRAVERSE_CURRENT_AND_CHILDREN to NodeTraverser to skip both traversal of child nodes, and prevent subsequent visitors from visiting the current node.

PHP-Parser 4.0.4

18 Sep 07:04
Compare
Choose a tag to compare

Added

  • The following methods have been added to BuilderFactory:
    • useTrait() (fluent builder)
    • traitUseAdaptation() (fluent builder)
    • useFunction() (fluent builder)
    • useConst() (fluent builder)
    • var()
    • propertyFetch()

Deprecated

  • Builder\Param::setTypeHint() has been deprecated in favor of the newly introduced Builder\Param::setType().

PHP-Parser 4.0.3

15 Jul 17:26
Compare
Choose a tag to compare

Fixed

  • Fixed possible undefined offset notice in formatting-preserving printer. (#513)

Added

  • Improved error recovery inside arrays.
  • Preserve trailing comment inside classes. Note: This change is possibly BC breaking if your code validates that classes can only contain certain statement types. After this change, classes can also contain Nop statements, while this was not previously possible. (#509)