Releases: nikic/PHP-Parser
Releases Β· nikic/PHP-Parser
PHP-Parser 5.7.0
Fixed
- Fixed changing modifier on anonymous class with formatting preserving pretty printer.
- Emit an error for unparenthesized arrow functions in pipe operator, and print necessary parentheses in the pretty printer.
- Fix PHP 8.5 deprecation warning in php-parse binary.
Changed
- When targeting PHP 8.4 or newer, omit parentheses around immediately dereferenced new expressions.
Added
- Added
shouldPrintRawValueattribute toScalar\Int_, which makes the pretty printer use therawValueof the node. This can be used to print integers with separators.
PHP-Parser 4.19.5
Fixed
- Fixed deprecation warnings on PHP 8.5.
PHP-Parser 5.6.2
Fixed
- Fixed formatting-preserving pretty-printing when changing the visibility modifier on a node that has attributes.
- Fixed
chr()deprecation warning on PHP 8.5.
Added
- Added
Param::isFinal()method.
PHP-Parser 5.6.1
Fixed
- Fixed
Param::isPublic()for parameters with asymmetric visibility keyword. - Fixed PHP 8.5 deprecation warnings for
SplObjectStoragemethods.
Added
- Added cast
kindattributes toCast\Int_,Cast\Bool_andCast\String_. These allow distinguishing the deprecated versions of these casts.
PHP-Parser 5.6.0
Added
- [8.5] Added support for
clonewith arbitrary function arguments. This will be parsed as anExpr\FuncCallnode, instead of the usualExpr\Clone_node. - [8.5] Permit declaration of
function clonefor use in stubs. - [8.5] Added support for the pipe operator, represented by
Expr\BinaryOp\Pipe. - [8.5] Added support for the
(void)cast, represented byExpr\Cast\Void_. - [8.5] Added support for the
finalmodifier on promoted properties. - Added
CallLike::getArg()to fetch an argument by position and name.
PHP-Parser 5.5.0
Added
- [8.5] Added support for attributes on constants.
Stmt\Const_now has anattrGroupssubnode. - Added
weakReferencesoption toNodeConnectingVisitorandParentConnectingVisitor. This will create the parent/next/prev references as WeakReferences, to avoid making the AST cyclic and thus increasing GC pressure.
Changed
- Attributes on parameters are now printed on separate lines if the pretty printer target version is PHP 7.4 or older (which is the default). This allows them to be interpreted as comments, instead of causing a parse error. Specify a target version of PHP 8.0 or newer to restore the previous behavior.
PHP-Parser 5.4.0
Added
- Added
Property::isAbstract()andProperty::isFinal()methods. - Added
PropertyHook::isFinal()method. - Emit an error if property hook is used on declaration with multiple properties.
Fixed
- Make legacy class aliases compatible with classmap-authoritative autoloader.
Param::isPromoted()andParam::isPublic()now returns true for parameters that have property hooks but no explicit visibility modifier.PropertyHook::getStmts()now correctly desugars shortsethooks.set => $valuewill be expanded toset { $this->propertyName = $value; }. This requires thepropertyNameattribute on the hook to be set, which is now also set by the parser. If the attribute is not set,getStmts()will throw an error for short set hooks, as it is not possible to produce a correct desugaring.
PHP-Parser 5.3.1
Added
- Added support for declaring functions with name
exitordie, to allow their use in stubs.
PHP-Parser 5.3.0
Added
- Added
indentoption to pretty printer, which can be used to specify the indentation to use (defaulting to four spaces). This also allows using tab indentation.
Fixed
- Resolve names in
PropertyHooks in theNameResolver. - Include the trailing semicolon inside
Stmt\GroupUsenodes, making them consistent withStmt\Use_nodes. - Fixed indentation sometimes becoming negative in formatting-preserving pretty printer, resulting in
ValueErrors.
PHP-Parser 4.19.4
Fixed
- Remove the
Parser\Php8class from PHP-Parser 5.x that was mistakenly added. It could cause errors when using something likecomposer preload.