-
[PHP 5.5] Add support for
ClassName::class
. This is parsed as anExpr_ClassConstFetch
with'class'
being the constant name. -
Syntax errors now include information on expected tokens and mimic the format of PHP's own (pre 5.4) error messages. Example:
Old: Unexpected token T_STATIC on line 1 New: Syntax error, unexpected T_STATIC, expecting T_STRING or T_NS_SEPARATOR or '{'
-
PHPParser_PrettyPrinter_Zend
was renamed toPHPParser_PrettyPrinter_Default
as the default pretty printer only very loosely applies the Zend Coding Standard. The classPHPParser_PrettyPrinter_Zend
extendsPHPParser_PrettyPrinter_Default
to maintain backwards compatibility. -
The pretty printer now prints namespaces in semicolon-style if possible (i.e. if the file does not contain a global namespace declaration).
-
Added
prettyPrintFile(array $stmts)
method which will pretty print a file of statements including the opening<?php
tag if it is required. Use of this method will also eliminate the unnecessary<?php ?>
at the start and end of files using inline HTML. -
There now is a builder for interfaces (
PHPParser_Builder_Interface
). -
An interface for the node traversation has been added:
PHPParser_NodeTraverserInterface
-
Fix pretty printing of
include
expressions (precedence information was missing). -
Improve performance of
PrettyPrinter
construction by no longer using theuniqid()
function.