Commit 2a0925d
Matt Turland
PHP 8.0: NewNestedStaticAccess: add support for class constant dereferencing
> ... class constant accesses are only array and object dereferencable. This
> means that while `Foo::$bar::$baz` is legal, `Foo::BAR::$baz` is not.
>
> This RFC proposes to make class constant accesses static derefencable as
> well, so that `Foo::BAR::$baz` and `Foo::BAR::BAZ` become legal.
Ref:
* https://wiki.php.net/rfc/variable_syntax_tweaks#class_constant_dereferencability
* php/php-src#5061
* php/php-src@ab154b7
Includes unit tests.
Relates to PHPCompatibility#809.1 parent 0da6d71 commit 2a0925d
File tree
3 files changed
+53
-11
lines changed- PHPCompatibility
- Sniffs/Syntax
- Tests/Syntax
3 files changed
+53
-11
lines changedLines changed: 20 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
67 | | - | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
122 | 127 | | |
123 | 128 | | |
124 | 129 | | |
125 | | - | |
| 130 | + | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| 134 | + | |
129 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
130 | 141 | | |
131 | 142 | | |
132 | 143 | | |
133 | 144 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
139 | 152 | | |
140 | 153 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
Lines changed: 32 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
72 | 103 | | |
73 | 104 | | |
74 | 105 | | |
| |||
98 | 129 | | |
99 | 130 | | |
100 | 131 | | |
101 | | - | |
102 | | - | |
103 | 132 | | |
104 | 133 | | |
105 | 134 | | |
| |||
111 | 140 | | |
112 | 141 | | |
113 | 142 | | |
114 | | - | |
| 143 | + | |
115 | 144 | | |
116 | 145 | | |
117 | 146 | | |
0 commit comments