php-parser/test/code/parser/stmt/class/php4Style.test
Tomas Votruba 4c22c62783
[PHP 8.0] Add attributes support (#661)
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>
2020-09-13 21:01:17 +02:00

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(
)
)
)
)
)