The following changelog only lists changes relative to the alpha 1 release. A description of backwards incompatible changes between version 2.x and 3.0 can be found in the upgrading guide.
Added
- [7.1] Function/method and parameter builders now support PHP 7.1 type hints (void, iterable and nullable types).
- Nodes and Comments now implement
JsonSerializable
. The node kind is stored in anodeType
property. - The
InlineHTML
node now has anhasLeadingNewline
attribute, that specifies whether the
preceding closing tag contained a newline. The pretty printer honors this attribute. - Partial parsing of
$obj->
(with missing property name) is now supported in error recovery mode. - The error recovery mode is now exposed in the
php-parse
script through the--with-recovery
or-r
flags.
Changes also in PHP-Parser 2.1.1
- The PHP 7 parser will now generate a parse error for
$var =& new Obj
assignments. - Comments on free-standing code blocks will now be retained as comments on the first statement in the code block.