2016-07-05 22:58:49 +02:00
|
|
|
Invalid class constant modifiers
|
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
class A {
|
|
|
|
static const X = 1;
|
|
|
|
}
|
|
|
|
-----
|
|
|
|
!!php7
|
2016-10-09 00:59:44 +02:00
|
|
|
Cannot use 'static' as constant modifier from 3:5 to 3:10
|
|
|
|
array(
|
|
|
|
0: Stmt_Class(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
flags: 0
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: A
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
extends: null
|
|
|
|
implements: array(
|
|
|
|
)
|
|
|
|
stmts: array(
|
|
|
|
0: Stmt_ClassConst(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
flags: MODIFIER_STATIC (8)
|
|
|
|
consts: array(
|
|
|
|
0: Const(
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: X
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
value: Scalar_LNumber(
|
|
|
|
value: 1
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2016-07-05 22:58:49 +02:00
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
class A {
|
|
|
|
abstract const X = 1;
|
|
|
|
}
|
|
|
|
-----
|
|
|
|
!!php7
|
2016-10-09 00:59:44 +02:00
|
|
|
Cannot use 'abstract' as constant modifier from 3:5 to 3:12
|
|
|
|
array(
|
|
|
|
0: Stmt_Class(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
flags: 0
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: A
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
extends: null
|
|
|
|
implements: array(
|
|
|
|
)
|
|
|
|
stmts: array(
|
|
|
|
0: Stmt_ClassConst(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
flags: MODIFIER_ABSTRACT (16)
|
|
|
|
consts: array(
|
|
|
|
0: Const(
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: X
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
value: Scalar_LNumber(
|
|
|
|
value: 1
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2016-07-05 22:58:49 +02:00
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
class A {
|
2021-07-21 12:43:29 +02:00
|
|
|
readonly const X = 1;
|
2016-07-05 22:58:49 +02:00
|
|
|
}
|
|
|
|
-----
|
|
|
|
!!php7
|
2021-07-21 12:43:29 +02:00
|
|
|
Cannot use 'readonly' as constant modifier from 3:5 to 3:12
|
2016-10-09 00:59:44 +02:00
|
|
|
array(
|
|
|
|
0: Stmt_Class(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
flags: 0
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: A
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
extends: null
|
|
|
|
implements: array(
|
|
|
|
)
|
|
|
|
stmts: array(
|
|
|
|
0: Stmt_ClassConst(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2021-07-21 12:43:29 +02:00
|
|
|
flags: MODIFIER_READONLY (64)
|
2016-10-09 00:59:44 +02:00
|
|
|
consts: array(
|
|
|
|
0: Const(
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: X
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
value: Scalar_LNumber(
|
|
|
|
value: 1
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2016-07-05 22:58:49 +02:00
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
class A {
|
|
|
|
public public const X = 1;
|
|
|
|
}
|
|
|
|
-----
|
2016-10-09 00:59:44 +02:00
|
|
|
!!php7
|
|
|
|
Multiple access type modifiers are not allowed from 3:12 to 3:17
|
|
|
|
array(
|
|
|
|
0: Stmt_Class(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
flags: 0
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: A
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
extends: null
|
|
|
|
implements: array(
|
|
|
|
)
|
|
|
|
stmts: array(
|
|
|
|
0: Stmt_ClassConst(
|
2020-09-13 21:01:17 +02:00
|
|
|
attrGroups: array(
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
flags: MODIFIER_PUBLIC (1)
|
|
|
|
consts: array(
|
|
|
|
0: Const(
|
2017-04-28 19:09:39 +02:00
|
|
|
name: Identifier(
|
|
|
|
name: X
|
|
|
|
)
|
2016-10-09 00:59:44 +02:00
|
|
|
value: Scalar_LNumber(
|
|
|
|
value: 1
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2021-07-21 12:43:29 +02:00
|
|
|
)
|