Skip to content

PHP-Parser 1.3.0

Compare
Choose a tag to compare
@nikic nikic released this 02 May 15:45
· 1153 commits to master since this release

Added

  • Errors can now store the attributes of the node/token where the error occurred. Previously only the start line was
    stored.
  • If file positions are enabled in the lexer, errors can now provide column information if it is available. See documentation.
  • The parser now provides an experimental error recovery mode, which can be enabled by disabling the throwOnError parser option. In this mode the parser will try to construct a partial AST even if the code is not valid PHP. See documentation.
  • Added support for PHP 7 yield from expression. It is represented by Expr\YieldFrom.
  • Added support for PHP 7 anonymous classes. These are represented by ordinary Stmt\Class_ nodes with the name set to null. Furthermore this implies that Expr\New_ can now contain a Stmt\Class_ in its class subnode.

Fixed

  • Fixed registration of PHP 7 aliases, for the case where the old name was used before the new name.
  • Fixed handling of precedence when pretty-printing print expressions.
  • Floating point numbers are now pretty-printed with a higher precision.
  • Checks for special class names like self are now case-insensitive.