File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 79
79
<div class="php8-code phpcode">
80
80
<?php highlight_php_trimmed (
81
81
<<<'PHP'
82
- // TODO
82
+ interface I {
83
+ // We may naively assume that the PHP constant is always a string
84
+ const PHP = 'PHP 8.2';
85
+ }
86
+
87
+ class Foo implements I {
88
+ const PHP = []; // But it may be an array...
89
+ }
90
+
91
+ // Parse error
83
92
PHP
84
93
85
94
); ?>
91
100
<div class="php8-code phpcode">
92
101
<?php highlight_php_trimmed (
93
102
<<<'PHP'
94
- // TODO
103
+ interface I {
104
+ const string PHP = 'PHP 8.3';
105
+ }
106
+
107
+ class Foo implements I {
108
+ const string PHP = [];
109
+ }
110
+
111
+ // Fatal error: Cannot use array as value for class constant Foo::PHP of type string
95
112
PHP
96
113
); ?>
97
114
</div>
141
158
<div class="php8-code phpcode">
142
159
<?php highlight_php_trimmed (
143
160
<<<'PHP'
144
- // TODO
145
161
use PHPUnit\Framework\TestCase;
146
162
147
163
final class MyTest extends TestCase
359
375
<li>Negative indices in arrays.</li>
360
376
<li>Changes to the <code>range</code> function.</li>
361
377
<li>Traits and static properties.</li>
362
- <li>The <code>U_MULTIPLE_DECIMAL_SEPERATORS</code> constant had been deprecated in favor of <code>U_MULTIPLE_DECIMAL_SEPARATORS</code>.</li>
378
+ <li>The <code>U_MULTIPLE_DECIMAL_SEPERATORS</code> constant had been deprecated in favor of <code>U_MULTIPLE_DECIMAL_SEPARATORS</code>.
379
+ </li>
363
380
<li>The <code>MT_RAND_PHP</code> Mt19937 variant is deprecated.</li>
364
381
<li><code>ReflectionClass::getStaticProperties</code> is no longer nullable.</li>
365
382
</ul>
You can’t perform that action at this time.
0 commit comments