Releases: nikic/PHP-Parser
Releases · nikic/PHP-Parser
PHP-Parser 4.9.1
Added
- Added support for removing the first element of a list to the formatting-preserving pretty printer.
Fixed
- Allow member modifiers as part of namespaced names. These were missed when support for other keywords was added.
PHP-Parser 4.9.0
Added
- [PHP 8.0] Added support for named arguments, represented using a new
name
subnode onArg
. - [PHP 8.0] Added support for static return type, represented like a normal class return type.
- [PHP 8.0] Added support for throw expression, represented using a new
Expr\Throw_
node. For backwards compatibility reasons, throw expressions in statement context continue to be represented usingStmt\Throw_
. - [PHP 8.0] Added support for keywords as parts of namespaced names.
Fixed
- Emit parentheses for class constant fetch with complex left-hand-side.
- Emit parentheses for new/instanceof on complex class expression.
PHP-Parser 4.8.0
Added
- [PHP 8.0] Added support for nullsafe operator, represented using the new
Expr\NullsafePropertyFetch
andExpr\NullsafeMethodCall
nodes. - Added
phpVersion
option to the emulative lexer, which allows controlling the target version to emulate (defaults to the latest available, currently PHP 8.0). This is useful to parse code that uses reserved keywords from newer PHP versions as identifiers.
PHP-Parser 4.7.0
Added
- Add
ParentConnectingVisitor
andNodeConnectingVisitor
classes. - [PHP 8.0] Added support for match expressions. These are represented using a new
Expr\Match_
containingMatchArm
s. - [PHP 8.0] Added support for trailing comma in closure use lists.
Fixed
- Fixed missing error for unterminated comment with trailing newline (#688).
- Compatibility with PHP 8.0 has been restored: Namespaced names are now always represented by
T_NAME_*
tokens, using emulationg on older PHP versions. Full support for reserved keywords in namespaced names is not yet present.
PHP-Parser 4.6.0
Added
- [PHP 8.0] Added support for trailing commas in parameter lists.
- [PHP 8.0] Added support for constructor promotion. The parameter visibility is stored in
Node\Param::$flags
.
Fixed
- Comment tokens now always follow the PHP 8 interpretation, and do not include trailing whitespace.
- As a result of the previous change, some whitespace issues when inserting a statement into a method containing only a comment, and using the formatting-preserving pretty printer, have been resolved.
PHP-Parser 4.5.0
Added
- [PHP 8.0] Added support for the mixed type. This means
mixed
types are now parsed as anIdentifier
rather than aName
. - [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
Added
- Added support for passing union types in builders.
- Added end line, token position and file position information for comments.
- Added
getProperty()
method toClassLike
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()
andlist()
, rather than just variables. In particular, this allowsisset(($x))
, which is legal PHP code.
PHP-Parser 4.3.0
Added
- [PHP 8.0] Added support for union types using a new
UnionType
node.
PHP-Parser 4.2.5
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.