File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 1+ --TEST--
2+ Class constants can be used as a class name
3+ --FILE--
4+ <?php
5+
6+ class Test {
7+ const NAME = 'Test2 ' ;
8+ }
9+
10+ class Test2 {
11+ const FOO = 42 ;
12+ public static $ foo = 42 ;
13+
14+ public static function foo () {
15+ return 42 ;
16+ }
17+ }
18+
19+ var_dump (Test::NAME ::FOO );
20+ var_dump (Test::NAME ::$ foo );
21+ var_dump (Test::NAME ::foo ());
22+
23+ ?>
24+ --EXPECT--
25+ int(42)
26+ int(42)
27+ int(42)
Original file line number Diff line number Diff line change @@ -1150,12 +1150,12 @@ fully_dereferencable:
11501150 variable { $$ = $1 ; }
11511151 | ' (' expr ' )' { $$ = $2 ; }
11521152 | dereferencable_scalar { $$ = $1 ; }
1153+ | class_constant { $$ = $1 ; }
11531154;
11541155
11551156array_object_dereferencable :
11561157 fully_dereferencable { $$ = $1 ; }
11571158 | constant { $$ = $1 ; }
1158- | class_constant { $$ = $1 ; }
11591159;
11601160
11611161callable_expr :
You can’t perform that action at this time.
0 commit comments