2016-07-05 22:58:49 +02:00
|
|
|
Class constant modifiers
|
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
|
|
|
|
class Foo {
|
|
|
|
const A = 1;
|
|
|
|
public const B = 2;
|
|
|
|
protected const C = 3;
|
|
|
|
private const D = 4;
|
2021-07-21 12:43:29 +02:00
|
|
|
final const E = 5;
|
2016-07-05 22:58:49 +02:00
|
|
|
}
|
|
|
|
-----
|
|
|
|
!!php7
|
|
|
|
array(
|
|
|
|
0: Stmt_Class(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-07-25 13:33:19 +02:00
|
|
|
flags: 0
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: Foo
|
|
|
|
)
|
2016-07-05 22:58:49 +02:00
|
|
|
extends: null
|
|
|
|
implements: array(
|
|
|
|
)
|
|
|
|
stmts: array(
|
|
|
|
0: Stmt_ClassConst(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-07-25 13:33:19 +02:00
|
|
|
flags: 0
|
2016-07-05 22:58:49 +02:00
|
|
|
consts: array(
|
|
|
|
0: Const(
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: A
|
|
|
|
)
|
2016-07-05 22:58:49 +02:00
|
|
|
value: Scalar_LNumber(
|
|
|
|
value: 1
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
1: Stmt_ClassConst(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-07-25 13:53:49 +02:00
|
|
|
flags: MODIFIER_PUBLIC (1)
|
2016-07-05 22:58:49 +02:00
|
|
|
consts: array(
|
|
|
|
0: Const(
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: B
|
|
|
|
)
|
2016-07-05 22:58:49 +02:00
|
|
|
value: Scalar_LNumber(
|
|
|
|
value: 2
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
2: Stmt_ClassConst(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-07-25 13:53:49 +02:00
|
|
|
flags: MODIFIER_PROTECTED (2)
|
2016-07-05 22:58:49 +02:00
|
|
|
consts: array(
|
|
|
|
0: Const(
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: C
|
|
|
|
)
|
2016-07-05 22:58:49 +02:00
|
|
|
value: Scalar_LNumber(
|
|
|
|
value: 3
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
3: Stmt_ClassConst(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-07-25 13:53:49 +02:00
|
|
|
flags: MODIFIER_PRIVATE (4)
|
2016-07-05 22:58:49 +02:00
|
|
|
consts: array(
|
|
|
|
0: Const(
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: D
|
|
|
|
)
|
2016-07-05 22:58:49 +02:00
|
|
|
value: Scalar_LNumber(
|
|
|
|
value: 4
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2021-07-21 12:43:29 +02:00
|
|
|
4: Stmt_ClassConst(
|
|
|
|
attrGroups: array(
|
|
|
|
)
|
|
|
|
flags: MODIFIER_FINAL (32)
|
|
|
|
consts: array(
|
|
|
|
0: Const(
|
|
|
|
name: Identifier(
|
|
|
|
name: E
|
|
|
|
)
|
|
|
|
value: Scalar_LNumber(
|
|
|
|
value: 5
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2016-07-05 22:58:49 +02:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|