github nikic/PHP-Parser v4.13.0
PHP-Parser 4.13.0

latest releases: v4.19.1, v4.19.0, v5.0.2...
2 years ago

This release features full PHP 8.1 support.

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.

Don't miss a new PHP-Parser release

NewReleases is sending notifications on new releases.