Version 2.0.2-dev ----------------- Nothing yet. Version 2.0.1 (2016-02-28) -------------------------- ### Fixed * `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`. * Magic constants are now supported as semi-reserved keywords. * A shebang line like `#!/usr/bin/env php` is now allowed at the start of a namespaced file. Previously this generated an exception. * The `prettyPrintFile()` method will not strip a trailing `?>` from the raw data that follows a `__halt_compiler()` statement. * The `prettyPrintFile()` method will not strip an opening `slice()` which takes a subslice of a name. ### Changed * `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. * Token constants are now defined on `PhpParser\Parser\Tokens` rather than `PhpParser\Parser`. * The `Name->set()`, `Name->append()`, `Name->prepend()` and `Name->setFirst()` methods are deprecated in favor of `Name::concat()` and `Name->slice()`. * The `NodeTraverser` no longer clones nodes by default. The old behavior can be restored by passing `true` to the constructor. * The constructor for `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](https://github.com/nikic/PHP-Parser/blob/1.x/CHANGELOG.md) and the [0.9 series changelog](https://github.com/nikic/PHP-Parser/blob/0.9/CHANGELOG.md).**