@@ -7,6 +7,9 @@ use function releases\php81\message;
77if (!isset ($ lang )) {
88 $ lang = 'en ' ;
99}
10+ if (!isset ($ documentation )) {
11+ $ documentation = $ lang ;
12+ }
1013
1114$ _SERVER ['BASE_PAGE ' ] = 'releases/8.1/ ' . $ lang . '.php ' ;
1215
@@ -37,7 +40,8 @@ common_header(message('common_header', $lang));
3740 <div class="php8-compare">
3841 <h2 class="php8-h2" id="enumerations">
3942 <?= message ('enumerations_title ' , $ lang ) ?>
40- <a class="php8-rfc" href="https://wiki.php.net/rfc/enumerations">RFC</a> <a class="php8-rfc" href="/manual/<?= $ lang ?> /language.enumerations.php"><?= message ('documentation ' , $ lang ) ?> </a>
43+ <a class="php8-rfc" href="https://wiki.php.net/rfc/enumerations">RFC</a>
44+ <a class="php8-rfc" href="/manual/<?= $ documentation ?> /language.enumerations.php"><?= message ('documentation ' , $ lang ) ?> </a>
4145 </h2>
4246 <div class="php8-compare__main">
4347 <div class="php8-compare__block example-contents">
8488 <div class="php8-compare">
8589 <h2 class="php8-h2" id="readonly_properties">
8690 <?= message ('readonly_properties_title ' , $ lang ) ?>
87- <a class="php8-rfc" href="https://wiki.php.net/rfc/readonly_properties_v2">RFC</a> <a class="php8-rfc" href="/manual/<?= $ lang ?> /language.oop5.properties.php#language.oop5.properties.readonly-properties"><?= message ('documentation ' , $ lang ) ?> </a>
91+ <a class="php8-rfc" href="https://wiki.php.net/rfc/readonly_properties_v2">RFC</a>
92+ <a class="php8-rfc" href="/manual/<?= $ documentation ?> /language.oop5.properties.php#language.oop5.properties.readonly-properties"><?= message ('documentation ' , $ lang ) ?> </a>
8893 </h2>
8994 <div class="php8-compare__main">
9095 <div class="php8-compare__block example-contents">
95100class BlogData
96101{
97102 private Status $status;
98-
99- public function __construct(Status $status)
103+
104+ public function __construct(Status $status)
100105 {
101106 $this->status = $status;
102107 }
103-
104- public function getStatus(): Status
108+
109+ public function getStatus(): Status
105110 {
106- return $this->status;
111+ return $this->status;
107112 }
108113}
109114PHP
120125class BlogData
121126{
122127 public readonly Status $status;
123-
124- public function __construct(Status $status)
128+
129+ public function __construct(Status $status)
125130 {
126131 $this->status = $status;
127132 }
139144 <div class="php8-compare">
140145 <h2 class="php8-h2" id="first_class_callable_syntax">
141146 <?= message ('first_class_callable_syntax_title ' , $ lang ) ?>
142- <a class="php8-rfc" href="https://wiki.php.net/rfc/first_class_callable_syntax">RFC</a> <a class="php8-rfc" href="/manual/<?= $ lang ?> /functions.first_class_callable_syntax.php"><?= message ('documentation ' , $ lang ) ?> </a>
147+ <a class="php8-rfc" href="https://wiki.php.net/rfc/first_class_callable_syntax">RFC</a>
148+ <a class="php8-rfc" href="/manual/<?= $ documentation ?> /functions.first_class_callable_syntax.php"><?= message ('documentation ' , $ lang ) ?> </a>
143149 </h2>
144150 <div class="php8-compare__main">
145151 <div class="php8-compare__block example-contents">
@@ -184,10 +190,10 @@ PHP
184190 <div class="php8-code phpcode">
185191 <?php highlight_php_trimmed (
186192 <<<'PHP'
187- class Service
193+ class Service
188194{
189195 private Logger $logger;
190-
196+
191197 public function __construct(
192198 ?Logger $logger = null,
193199 ) {
@@ -204,10 +210,10 @@ PHP
204210 <div class="php8-code phpcode">
205211 <?php highlight_php_trimmed (
206212 <<<'PHP'
207- class Service
213+ class Service
208214{
209215 private Logger $logger;
210-
216+
211217 public function __construct(
212218 Logger $logger = new NullLogger(),
213219 ) {
229235 <div class="php8-code phpcode">
230236 <?php highlight_php_trimmed (
231237 <<<'PHP'
232- class User
238+ class User
233239{
234240 /**
235241 * @Assert\All({
249255 <div class="php8-code phpcode">
250256 <?php highlight_php_trimmed (
251257 <<<'PHP'
252- class User
258+ class User
253259{
254260 #[\Assert\All(
255261 new \Assert\NotNull,
267273 <div class="php8-compare">
268274 <h2 class="php8-h2" id="pure_intersection_types">
269275 <?= message ('pure_intersection_types_title ' , $ lang ) ?>
270- <a class="php8-rfc" href="https://wiki.php.net/rfc/pure-intersection-types">RFC</a> <a class="php8-rfc" href="/manual/<?= $ lang ?> /language.types.declarations.php#language.types.declarations.composite.intersection"><?= message ('documentation ' , $ lang ) ?> </a>
276+ <a class="php8-rfc" href="https://wiki.php.net/rfc/pure-intersection-types">RFC</a>
277+ <a class="php8-rfc" href="/manual/<?= $ documentation ?> /language.types.declarations.php#language.types.declarations.composite.intersection"><?= message ('documentation ' , $ lang ) ?> </a>
271278 </h2>
272279 <div class="php8-compare__main">
273280 <div class="php8-compare__block example-contents">
317324 <div class="php8-compare">
318325 <h2 class="php8-h2" id="never_return_type">
319326 <?= message ('never_return_type_title ' , $ lang ) ?>
320- <a class="php8-rfc" href="https://wiki.php.net/rfc/noreturn_type">RFC</a> <a class="php8-rfc" href="/manual/<?= $ lang ?> /language.types.declarations.php#language.types.declarations.never"><?= message ('documentation ' , $ lang ) ?> </a>
327+ <a class="php8-rfc" href="https://wiki.php.net/rfc/noreturn_type">RFC</a>
328+ <a class="php8-rfc" href="/manual/<?= $ documentation ?> /language.types.declarations.php#language.types.declarations.never"><?= message ('documentation ' , $ lang ) ?> </a>
321329 </h2>
322330 <div class="php8-compare__main">
323331 <div class="php8-compare__block example-contents">
@@ -329,7 +337,7 @@ function redirect(string $uri) {
329337 header('Location: ' . $uri);
330338 exit();
331339}
332-
340+
333341function redirectToLoginPage() {
334342 redirect('/login');
335343 echo 'Hello'; // <- dead code
@@ -349,10 +357,10 @@ function redirect(string $uri): never {
349357 header('Location: ' . $uri);
350358 exit();
351359}
352-
360+
353361function redirectToLoginPage(): never {
354362 redirect('/login');
355- echo 'Hello'; // <- dead code detected by static analysis
363+ echo 'Hello'; // <- dead code detected by static analysis
356364}
357365PHP
358366
368376 <div class="php8-compare">
369377 <h2 class="php8-h2" id="final_class_constants">
370378 <?= message ('final_class_constants_title ' , $ lang ) ?>
371- <a class="php8-rfc" href="https://wiki.php.net/rfc/final_class_const">RFC</a> <a class="php8-rfc" href="/manual/<?= $ lang ?> /language.oop5.final.php#language.oop5.final.example.php81"><?= message ('documentation ' , $ lang ) ?> </a>
379+ <a class="php8-rfc" href="https://wiki.php.net/rfc/final_class_const">RFC</a>
380+ <a class="php8-rfc" href="/manual/<?= $ documentation ?> /language.oop5.final.php#language.oop5.final.example.php81"><?= message ('documentation ' , $ lang ) ?> </a>
372381 </h2>
373382 <div class="php8-compare__main">
374383 <div class="php8-compare__block example-contents">
419428 <div class="php8-compare">
420429 <h2 class="php8-h2" id="explicit_octal_numeral_notation">
421430 <?= message ('octal_numeral_notation_title ' , $ lang ) ?>
422- <a class="php8-rfc" href="https://wiki.php.net/rfc/explicit_octal_notation">RFC</a> <a class="php8-rfc" href="/manual/<?= $ lang ?> /migration81.new-features.php#migration81.new-features.core.octal-literal-prefix"><?= message ('documentation ' , $ lang ) ?> </a>
431+ <a class="php8-rfc" href="https://wiki.php.net/rfc/explicit_octal_notation">RFC</a>
432+ <a class="php8-rfc" href="/manual/<?= $ documentation ?> /migration81.new-features.php#migration81.new-features.core.octal-literal-prefix"><?= message ('documentation ' , $ lang ) ?> </a>
423433 </h2>
424434 <div class="php8-compare__main">
425435 <div class="php8-compare__block example-contents">
428438 <?php highlight_php_trimmed (
429439 <<<'PHP'
430440016 === 16; // false because `016` is octal for `14` and it's confusing
431- 016 === 14; // true
441+ 016 === 14; // true
432442PHP
433443
434444 );?>
441451 <?php highlight_php_trimmed (
442452 <<<'PHP'
4434530o16 === 16; // false — not confusing with explicit notation
444- 0o16 === 14; // true
454+ 0o16 === 14; // true
445455PHP
446456 );?>
447457 </div>
455465 <div class="php8-compare">
456466 <h2 class="php8-h2" id="fibers">
457467 <?= message ('fibers_title ' , $ lang ) ?>
458- <a class="php8-rfc" href="https://wiki.php.net/rfc/fibers">RFC</a> <a class="php8-rfc" href="/manual/<?= $ lang ?> /language.fibers.php"><?= message ('documentation ' , $ lang ) ?> </a>
468+ <a class="php8-rfc" href="https://wiki.php.net/rfc/fibers">RFC</a>
469+ <a class="php8-rfc" href="/manual/<?= $ documentation ?> /language.fibers.php"><?= message ('documentation ' , $ lang ) ?> </a>
459470 </h2>
460471 <div class="php8-compare__main">
461472 <div class="php8-compare__block example-contents">
496507 <div class="php8-compare">
497508 <h2 class="php8-h2" id="array_unpacking_support_for_string_keyed_arrays">
498509 <?= message ('array_unpacking_title ' , $ lang ) ?>
499- <a class="php8-rfc" href="https://wiki.php.net/rfc/array_unpacking_string_keys">RFC</a> <a class="php8-rfc" href="/manual/<?= $ lang ?> /language.types.array.php#language.types.array.unpacking"><?= message ('documentation ' , $ lang ) ?> </a>
510+ <a class="php8-rfc" href="https://wiki.php.net/rfc/array_unpacking_string_keys">RFC</a>
511+ <a class="php8-rfc" href="/manual/<?= $ documentation ?> /language.types.array.php#language.types.array.unpacking"><?= message ('documentation ' , $ lang ) ?> </a>
500512 </h2>
501513 <div class="php8-compare__main">
502514 <div class="php8-compare__block example-contents">
0 commit comments