mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-12-15 02:16:56 +01:00
4c22c62783
Adds support for PHP 8 attributes, represented using `AttrGroup` nodes containing `Attribute` nodes. The `attrGroup` subnode is added to all nodes that can have attributes. This is still missing FPPP support. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
67 lines
1.5 KiB
Plaintext
67 lines
1.5 KiB
Plaintext
PHP 4 style declarations
|
|
-----
|
|
<?php
|
|
|
|
class A {
|
|
var $foo;
|
|
function bar() {}
|
|
static abstract function baz() {}
|
|
}
|
|
-----
|
|
array(
|
|
0: Stmt_Class(
|
|
attrGroups: array(
|
|
)
|
|
flags: 0
|
|
name: Identifier(
|
|
name: A
|
|
)
|
|
extends: null
|
|
implements: array(
|
|
)
|
|
stmts: array(
|
|
0: Stmt_Property(
|
|
attrGroups: array(
|
|
)
|
|
flags: 0
|
|
type: null
|
|
props: array(
|
|
0: Stmt_PropertyProperty(
|
|
name: VarLikeIdentifier(
|
|
name: foo
|
|
)
|
|
default: null
|
|
)
|
|
)
|
|
)
|
|
1: Stmt_ClassMethod(
|
|
attrGroups: array(
|
|
)
|
|
flags: 0
|
|
byRef: false
|
|
name: Identifier(
|
|
name: bar
|
|
)
|
|
params: array(
|
|
)
|
|
returnType: null
|
|
stmts: array(
|
|
)
|
|
)
|
|
2: Stmt_ClassMethod(
|
|
attrGroups: array(
|
|
)
|
|
flags: MODIFIER_ABSTRACT | MODIFIER_STATIC (24)
|
|
byRef: false
|
|
name: Identifier(
|
|
name: baz
|
|
)
|
|
params: array(
|
|
)
|
|
returnType: null
|
|
stmts: array(
|
|
)
|
|
)
|
|
)
|
|
)
|
|
) |