Releases: nikic/PHP-Parser
Releases Β· nikic/PHP-Parser
PHP-Parser 4.14.0
Added
- Added support for readonly classes.
- Added
rawValue
attribute toLNumber
,DNumber
andString_
nodes, which stores the unparsed value of the literal (e.g."1_000"
rather than1000
).
PHP-Parser 4.13.2
Added
- Added builders for enums and enum cases.
Fixed
- NullsafeMethodCall now extends from CallLike.
- The
namespacedName
property populated by theNameResolver
is now declared on relevant nodes,
to avoid a dynamic property deprecation warning with PHP 8.2.
PHP-Parser 4.13.1
Fixed
- Support reserved keywords as enum cases.
- Support array unpacking in constant expression evaluator.
PHP-Parser 4.13.0
This release features full PHP 8.1 support.
Added
- [PHP 8.1] Added support for intersection types using a new
IntersectionType
node. Additionally aComplexType
parent class forNullableType
,UnionType
andIntersectionType
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 fromExpr\CallLike
, which provides anisFirstClassCallable()
method to determine whether a placeholder id present.getArgs()
can be used to assert that the call is not a first-class callable and returnsArg[]
rather thanarray<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.
PHP-Parser 4.12.0
Added
- [PHP 8.1] Added support for readonly properties (through a new
MODIFIER_READONLY
). - [PHP 8.1] Added support for final class constants.
Fixed
- Fixed compatibility with PHP 8.1.
&
tokens are now canonicalized to theT_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG
andT_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG
tokens used in PHP 8.1. This happens unconditionally, regardless of whether the emulative lexer is used.
PHP-Parser 4.11.0
Added
BuilderFactory::args()
now accepts named arguments.BuilderFactory::attribute()
has been added.- An
addAttribute()
method accepting anAttribute
orAttributeGroup
has been added to all builders that accept attributes, such asBuilder\Class_
.
Fixed
NameResolver
now handles enums.PrettyPrinter
now prints backing enum type.- Builder methods for types now property handle
never
type.
PHP-Parser 4.10.5
Added
- [PHP 8.1] Added support for enums. These are represented using the
Stmt\Enum_
andStmt\EnumCase
nodes. - [PHP 8.1] Added support for never type. This type will now be returned as an
Identifier
rather thanName
. - Added
ClassConst
builder.
Changed
- Non-UTF-8 code units in strings will now be hex-encoded.
Fixed
- Fixed precedence of arrow functions.
PHP-Parser 4.10.4
PHP-Parser 4.10.3
Fixed
- Fixed formatting-preserving pretty printing for
"{$x}"
. - Ternary expressions are now treated as non-associative in the pretty printer, in order to generate code that is compatible with the parentheses requirement introduced in PHP 8.
- Removed no longer necessary
error_clear_last()
call in lexer, which may interfere with fatal error handlers if invoked during shutdown.
PHP-Parser 4.10.2
Fixed
- Fixed check for token emulation conflicts with other libraries.