All Versions
64
Latest Version
Avg Release Cycle
43 days
Latest Release
597 days ago
Changelog History
Page 1
Changelog History
Page 1
-
v5.0.0-alpha1 Changes
September 04, 2022โฌ๏ธ See UPGRADE-5.0 for detailed migration instructions.
๐ Changed
- ๐ PHP 7.1 is now required to run PHP-Parser.
- ๐จ Formatting of the standard pretty printer has been adjusted to match PSR-12 more closely.
- ๐ The internal token representation now uses a
PhpParser\Token
class, which is compatible with PHP 8 token representation (PhpToken
). - Destructuring is now always represented using
Expr\List_
nodes, even if it uses[]
syntax. - ๐ Renamed a number of node classes, and moved things that were not real expressions/statements
outside the
Expr
/Stmt
hierarchy. Compatibility shims for the old names have been retained.
โ Added
- โ Added
PhpVersion
class, which is accepted in a number of places (e.g. ParserFactory, Parser, Lexer, PrettyPrinter) and gives more precise control over the PHP version being targeted. - โ Added PHP 8 parser though it only differs from the PHP 7 parser in concatenation precedence.
- โ Added
Parser::getLexer()
method. - Added a
Modifiers
class, as a replacement forStmt\Class_::MODIFIER_*
. - โ Added support for returning an array or
REMOVE_NODE
fromNodeVisitor::enterNode()
.
โ Removed
- ๐ The PHP 5 parser has been removed. The PHP 7 parser has been adjusted to deal with PHP 5 code more gracefully.
-
v4.15.2 Changes
November 12, 2022๐ Fixed
- ๐ Fixed parsing of large hex float literals that contain an "e" character.
- ๐ Fixed tests to pass on 32-bit.
- ๐ Fixed generation of invalid code when using formatting-preserving pretty printer with code that uses inline HTML.
-
v4.15.1 Changes
September 04, 2022๐ Fixed
- Fixed formatting preservation when adding multiple attributes to a class/method/etc that previously had none. This fixes a regression in the 4.15.0 release.
-
v4.15.0 Changes
September 03, 2022โ Added
- ๐ PHP 8.2: Added support for
true
type. - ๐ PHP 8.2: Added support for DNF types.
๐ Fixed
- ๐ Support
readonly
as a function name. - Added
__serialize
and__unserialize
to magic method list. - ๐ Fixed bounds check in
Name::slice()
. - ๐ Fixed formatting preservation when adding attributes to a class/method/etc that previously had none.
- ๐ PHP 8.2: Added support for
-
v4.14.1-dev Changes
Nothing yet.
-
v4.14.0 Changes
May 31, 2022โ 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
).
-
v4.13.2 Changes
November 30, 2021โ 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.
-
v4.13.1 Changes
November 03, 2021๐ Fixed
- ๐ Support reserved keywords as enum cases.
- ๐ Support array unpacking in constant expression evaluator.
-
v4.13.0 Changes
September 20, 2021โ 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 8.1] Added support for intersection types using a new
-
v4.12.0 Changes
July 21, 2021โ 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 8.1] Added support for readonly properties (through a new