Nothing yet.
\x00-\x1F
inside double
quoted strings. If no special escape sequence is available, an octal escape will be used.$var =& new Obj
assignments.B""
strings (with uppercase B
) in a number of places.dumpComments
option to node dumper, to enable dumping of comments associated with nodes.Stmt\Nop
node, that is used to collect comments located at the end of a block or at the
end of a file (without a following node with which they could otherwise be associated).kind
attribute to Expr\Exit
to distinguish between exit
and die
.kind
attribute to Scalar\LNumber
to distinguish between decimal, binary, octal and
hexadecimal numbers.kind
attribtue to Expr\Array
to distinguish between array()
and []
.kind
attribute to Scalar\String
and Scalar\Encapsed
to distinguish between
single-quoted, double-quoted, heredoc and nowdoc string.docLabel
attribute to Scalar\String
and Scalar\Encapsed
, if it is a heredoc or
nowdoc string.Comment
nodes.setReturnType()
method to function and method builders.-h
and --help
options to php-parse
script.AbstractPrettyPrinter::pComments()
method no longer returns a trailing newline.PhpParser
for easier downstream distribution.Comment::setLine()
and Comment::setText()
methods have been deprecated. Construct new
objects instead.Scalar\LNumber::parse()
has been removed. A non-internal
LNumber::fromString()
method has been added instead.declare() {}
and declare();
are not semantically equivalent and will now result in different
ASTs. The format case will have an empty stmts
array, while the latter will set stmts
to
null
.#!/usr/bin/env php
is now allowed at the start of a namespaced file.
Previously this generated an exception.prettyPrintFile()
method will not strip a trailing ?>
from the raw data that follows a
__halt_compiler()
statement.prettyPrintFile()
method will not strip an opening <?php
if the file starts with a
comment followed by InlineHTML.Scalar\EncapsStringPart
nodes.
Previously raw strings were used. This affects the parts
child of Scalar\Encaps
and
Expr\ShellExec
. The change has been done to allow assignment of attributes to encapsed string
parts.php-parse.php
to php-parse
and registered it as a composer bin.shortArraySyntax
option to pretty printer, to print all arrays using short syntax.A more detailed description of backwards incompatible changes can be found in the upgrading guide.
getSubNodeNames()
method now.Stmt\GroupUse
nodes. Furthermore a type
attribute was added to Stmt\UseUse
to handle mixed group use declarations.'bool'
, 'int'
, 'float'
and 'string'
as the type. The PHP 5 parser also accepts these, however they'll be Name
instances there.PhpParser\ParserFactory
class, which should be used to create parser instances.Name::concat()
which concatenates two names.Name->slice()
which takes a subslice of a name.PhpParser\Parser
is now an interface, implemented by Parser\Php5
, Parser\Php7
and
Parser\Multiple
. The Multiple
parser will try multiple parsers, until one succeeds.PhpParser\Parser\Tokens
rather than PhpParser\Parser
.Name->set()
, Name->append()
, Name->prepend()
and Name->setFirst()
methods are
deprecated in favor of Name::concat()
and Name->slice()
.NodeTraverser
no longer clones nodes by default. The old behavior can be restored by
passing true
to the constructor.Scalar
nodes no longer has a default value. E.g. new LNumber()
should now
be written as new LNumber(0)
.This changelog only includes changes from the 2.0 series. For older changes see the 1.x series changelog and the 0.9 series changelog.