github nikic/PHP-Parser v0.9.4
PHP-Parser 0.9.4

latest releases: v4.19.1, v4.19.0, v5.0.2...
10 years ago
  • [PHP 5.5] Add support for ClassName::class. This is parsed as an Expr_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 to PHPParser_PrettyPrinter_Default as the default pretty printer only very loosely applies the Zend Coding Standard. The class PHPParser_PrettyPrinter_Zend extends PHPParser_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 the uniqid() function.

Don't miss a new PHP-Parser release

NewReleases is sending notifications on new releases.