2017-01-19 21:03:46 +01:00
|
|
|
Upgrading from PHP-Parser 3.x to 4.0
|
|
|
|
====================================
|
|
|
|
|
|
|
|
### PHP version requirements
|
|
|
|
|
|
|
|
PHP-Parser now requires PHP 5.6 or newer to run. It is however still possible to *parse* PHP 5.2-5.5
|
|
|
|
source code, while running on a newer version.
|
|
|
|
|
2017-01-19 22:46:28 +01:00
|
|
|
### Changes to the node structure
|
|
|
|
|
|
|
|
* Expression statements (`expr;`) are now represented using a `Stmt\Expression` node. Previously
|
|
|
|
these statements were directly represented as their constituent expression.
|
2017-01-19 23:49:18 +01:00
|
|
|
* The `name` subnode of `Param` has been renamed to `var` and now contains a `Variable` rather than
|
|
|
|
a plain string.
|
|
|
|
* The `name` subnode of `StaticVar` has been renamed to `var` and now contains a `Variable` rather
|
|
|
|
than a plain string.
|
|
|
|
* The `var` subnode of `ClosureUse` now contains a `Variable` rather than a plain string.
|
|
|
|
* The `var` subnode of `Catch` now contains a `Variable` rather than a plain string.
|
2017-01-19 22:46:28 +01:00
|
|
|
|
2017-01-19 21:03:46 +01:00
|
|
|
### Removed functionality
|
|
|
|
|
2017-01-26 00:16:54 +01:00
|
|
|
* Removed `type` subnode on `Class`, `ClassMethod` and `Property` nodes. Use `flags` instead.
|
2017-02-03 22:34:27 +01:00
|
|
|
* The `ClassConst::isStatic()` method has been removed. Constants cannot have a static modifier.
|
|
|
|
* The `NodeTraverser` no longer accepts `false` as a return value from a `leaveNode()` method.
|
2017-02-04 01:10:09 +01:00
|
|
|
`NodeTraverser::REMOVE_NODE` should be returned instead.
|
|
|
|
* The XML serializer has been removed. As such, the classes `Serializer\XML`, and
|
|
|
|
`Unserializer\XML`, as well as the interfaces `Serializer` and `Unserializer` no longer exist.
|