Releases: nikic/PHP-Parser
Releases · nikic/PHP-Parser
PHP-Parser 4.2.5
Changed
- Tests and documentation are no longer included in source archives. They can still be accessed by cloning the repository.
- php-yacc is now used to generate the parser. This has no impact on users of the library.
PHP-Parser 4.2.4
PHP-Parser 4.2.3
PHP-Parser 4.2.2
Added
- [PHP 7.4] Add support for arrow functions using a new
Expr\ArrowFunction
node. (#602) - [PHP 7.4] Add support for array spreads, using a new
unpack
subnode onArrayItem
. (#609) - Added support for inserting into empty list nodes in the formatting preserving pretty printer.
Changed
php-parse
will now print messages to stderr, so that stdout only contains the actual result of the operation (such as a JSON dump). (#605)
Fixed
- Fixed attribute assignment for zero-length nop statements, and a related assertion failure in the formatting-preserving pretty printer. (#589)
PHP-Parser 4.2.1
Added
- [PHP 7.4] Add support for
??=
operator through a newAssignOp\Coalesce
node. (#575)
PHP-Parser 4.2.0
Added
- [PHP 7.4] Add support for typed properties through a new
type
subnode ofStmt\Property
. AdditionallyBuilder\Property
now has asetType()
method. (#567) - Add
kind
attribute toCast\Double_
, which allows to distinguish between(float)
,(double)
and(real)
. The form of the cast will be preserved by the pretty printer. (#565)
Fixed
- Remove assertion when pretty printing anonymous class with a name (#554).
PHP-Parser 4.1.1
PHP-Parser 4.1.0
Added
- Added support for PHP 7.3 flexible heredoc/nowdoc strings, completing support for PHP 7.3. There are two caveats for this feature:
- In some rare, pathological cases flexible heredoc/nowdoc strings change the interpretation of existing doc strings. PHP-Parser will now use the new interpretation.
- Flexible heredoc/nowdoc strings require special support from the lexer. Because this is not available on PHP versions before 7.3, support has to be emulated. This emulation is not perfect and some cases which we do not expect to occur in practice (such as flexible doc strings being nested within each other through abuse of variable-variable interpolation syntax) may not be recognized correctly.
- Added
DONT_TRAVERSE_CURRENT_AND_CHILDREN
toNodeTraverser
to skip both traversal of child nodes, and prevent subsequent visitors from visiting the current node.
PHP-Parser 4.0.4
Added
- The following methods have been added to
BuilderFactory
:useTrait()
(fluent builder)traitUseAdaptation()
(fluent builder)useFunction()
(fluent builder)useConst()
(fluent builder)var()
propertyFetch()
Deprecated
Builder\Param::setTypeHint()
has been deprecated in favor of the newly introducedBuilder\Param::setType()
.
PHP-Parser 4.0.3
Fixed
- Fixed possible undefined offset notice in formatting-preserving printer. (#513)
Added
- Improved error recovery inside arrays.
- Preserve trailing comment inside classes. Note: This change is possibly BC breaking if your code validates that classes can only contain certain statement types. After this change, classes can also contain Nop statements, while this was not previously possible. (#509)