A PHP parser written in PHP
This release features full PHP 8.1 support.
IntersectionType
node. Additionally a ComplexType
parent class for NullableType
, UnionType
and IntersectionType
has been added.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>
.public readonly
for promoted properties.MODIFIER_READONLY
).&
tokens are now canonicalized to the T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG
and T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG
tokens used in PHP 8.1. This happens unconditionally, regardless of whether the emulative lexer is used.BuilderFactory::args()
now accepts named arguments.BuilderFactory::attribute()
has been added.addAttribute()
method accepting an Attribute
or AttributeGroup
has been added to all builders that accept attributes, such as Builder\Class_
.NameResolver
now handles enums.PrettyPrinter
now prints backing enum type.never
type.Stmt\Enum_
and Stmt\EnumCase
nodes.Identifier
rather than Name
.ClassConst
builder."{$x}"
.error_clear_last()
call in lexer, which may interfere with fatal error handlers if invoked during shutdown.