Releases: nikic/PHP-Parser
Releases Β· nikic/PHP-Parser
PHP-Parser 5.3.1
PHP-Parser 5.3.0
Added
- Added
indent
option 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
PropertyHook
s in theNameResolver
. - Include the trailing semicolon inside
Stmt\GroupUse
nodes, making them consistent withStmt\Use_
nodes. - Fixed indentation sometimes becoming negative in formatting-preserving pretty printer, resulting in
ValueError
s.
PHP-Parser 4.19.4
Fixed
- Remove the
Parser\Php8
class from PHP-Parser 5.x that was mistakenly added. It could cause errors when using something likecomposer preload
.
PHP-Parser 4.19.3
Fixed
- Include the trailing semicolon inside
Stmt\GroupUse
nodes, making them consistent withStmt\Use_
nodes. - Fixed indentation sometimes becoming negative in formatting-preserving pretty printer, resulting in
ValueError
s.
PHP-Parser 4.19.2
Added
- Added support for passing enum values to various builder methods, like
BuilderFactory::val()
.
PHP-Parser 5.2.0
Added
- [8.4] Added support for
__PROPERTY__
magic constant, represented using aNode\Scalar\MagicConst\Property
node. - [8.4] Added support for property hooks, which are represented using a new
hooks
subnode onNode\Stmt\Property
andNode\Param
, which contains an array ofNode\PropertyHook
. - [8.4] Added support for asymmetric visibility modifiers. Property
flags
can now hold the additional bitsModifiers::PUBLIC_SET
,Modifiers::PROTECTED_SET
andModifiers::PRIVATE_SET
. - [8.4] Added support for generalized exit function. For backwards compatibility, exit without argument or a single plain argument continues to use a
Node\Expr\Exit_
node. Otherwise (e.g. if a named argument is used) it will be represented as a plainNode\Expr\FuncCall
. - Added support for passing enum values to various builder methods, like
BuilderFactory::val()
.
Removed
- Removed support for alternative array syntax
$array{0}
from the PHP 8 parser. It is still supported by the PHP 7 parser. This is necessary in order to support property hooks.
PHP-Parser 5.1.0
Added
- [8.4] Added support for dereferencing
new
expressions without parentheses.
Fixed
- Fixed redundant parentheses being added when pretty printing ternary expressions.
Changed
- Made some phpdoc types more precise.
PHP-Parser 4.19.1
Fixed
- Fixed "Optional parameter before required parameter" deprecation warning introduced in previous version.
PHP-Parser 4.19.0
Changed
- Do not use implicitly nullable parameters, which are deprecated in PHP 8.4.
- Remove support for running on PHP 7.0, which does not support explicitly nullable parameters.
PHP-Parser 5.0.2
Fixed
- Fix handling of indentation on next line after opening PHP tag in formatting-preserving pretty printer.
Changed
- Avoid cyclic references in
Parser
objects. This means that no longer used parser objects are immediately destroyed now, instead of requiring cycle GC. - Update
PhpVersion::getNewestSupported()
to report PHP 8.3 instead of PHP 8.2.