File tree 1 file changed +19
-4
lines changed 1 file changed +19
-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
+ }
83
90
PHP
84
91
85
92
); ?>
91
98
<div class="php8-code phpcode">
92
99
<?php highlight_php_trimmed (
93
100
<<<'PHP'
94
- // TODO
101
+ interface I {
102
+ const string PHP = 'PHP 8.3';
103
+ }
104
+
105
+ class Foo implements I {
106
+ const string PHP = [];
107
+ }
108
+
109
+ // Fatal error: Cannot use array as value for class constant Foo::PHP of type string
95
110
PHP
96
111
); ?>
97
112
</div>
141
156
<div class="php8-code phpcode">
142
157
<?php highlight_php_trimmed (
143
158
<<<'PHP'
144
- // TODO
145
159
use PHPUnit\Framework\TestCase;
146
160
147
161
final class MyTest extends TestCase
359
373
<li>Negative indices in arrays.</li>
360
374
<li>Changes to the <code>range</code> function.</li>
361
375
<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>
376
+ <li>The <code>U_MULTIPLE_DECIMAL_SEPERATORS</code> constant had been deprecated in favor of <code>U_MULTIPLE_DECIMAL_SEPARATORS</code>.
377
+ </li>
363
378
<li>The <code>MT_RAND_PHP</code> Mt19937 variant is deprecated.</li>
364
379
<li><code>ReflectionClass::getStaticProperties</code> is no longer nullable.</li>
365
380
</ul>
You can’t perform that action at this time.
0 commit comments