mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-11-27 12:24:39 +01:00
1.4 KiB
1.4 KiB
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.
Changes to the node structure
- Expression statements (
expr;
) are now represented using aStmt\Expression
node. Previously these statements were directly represented as their constituent expression. - The
name
subnode ofParam
has been renamed tovar
and now contains aVariable
rather than a plain string. - The
name
subnode ofStaticVar
has been renamed tovar
and now contains aVariable
rather than a plain string. - The
var
subnode ofClosureUse
now contains aVariable
rather than a plain string. - The
var
subnode ofCatch
now contains aVariable
rather than a plain string.
Removed functionality
- Removed
type
subnode onClass
,ClassMethod
andProperty
nodes. Useflags
instead. - The
ClassConst::isStatic()
method has been removed. Constants cannot have a static modifier. - The
NodeTraverser
no longer acceptsfalse
as a return value from aleaveNode()
method.NodeTraverser::REMOVE_NODE
should be returned instead. - The XML serializer has been removed. As such, the classes
Serializer\XML
, andUnserializer\XML
, as well as the interfacesSerializer
andUnserializer
no longer exist.