packagist nikic/php-parser v5.0.0rc1
PHP-Parser 5.0.0 Release Candidate 1

latest releases: dev-master, v5.3.1, v4.19.4...
10 months ago

See UPGRADE-5.0 for detailed migration instructions. The changelog is relative to beta 1.

Fixed

  • Fixed parsing of empty files.

Added

  • Added support for printing additional attributes (like kind) in NodeDumper.
  • Added rawValue attribute to InterpolatedStringPart and heredoc/nowdoc String_s, which provides the original, unparsed value. It was previously only available for non-interpolated single/double quoted strings.
  • Added Stmt\Block to represent {} code blocks. Previously, such code blocks were flattened into the parent statements array. Stmt\Block will not be created for structures that are typically used with code blocks, for example if ($x) { $y; } will be represented as previously, while if ($x) { { $y; } } will have an extra Stmt\Block wrapper.

Changed

  • Use visitor to assign comments. This fixes the long-standing issue where comments were assigned to all nodes sharing a starting position. Now only the outer-most node will hold the comments.
  • Don't parse unicode escape sequences when targeting PHP < 7.0.
  • Improve NodeDumper performance for large dumps.

Removed

  • Removed Stmt\Throw_ node, use Expr\Throw_ inside Stmt\Expression instead.
  • Removed ParserFactory::create().

Don't miss a new php-parser release

NewReleases is sending notifications on new releases.