Skip to content

Commit 4b9493b

Browse files
saundefinedTimWolla
andcommitted
Apply suggestions from code review
Co-authored-by: Tim Düsterhus <[email protected]>
1 parent dab41e0 commit 4b9493b

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

releases/8.3/languages/en.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
'upgrade_now' => 'Upgrade to PHP 8.3 now!',
99

1010
'readonly_title' => 'Readonly amendments',
11+
'readonly_description' => '<code>readonly</code> properties may now be modified once within the magic <code>__clone</code> method to enable deep-cloning of readonly properties.',
1112
'json_validate_title' => 'New <code>json_validate()</code> function',
13+
'json_validate_description' => '<code>json_validate()</code> allows to check if a string is syntactically valid JSON, while being more efficient than <code>json_decode()</code>.',
1214
'typed_class_constants_title' => 'Typed class constants',
1315
'override_title' => '<code>#[\Override]</code> attribute',
16+
'override_description' => 'By adding the <code>#[\Override]</code> attribute to a method, PHP will ensure that a method with the same name exists in a parent class or in an implemented interface. Adding the attribute makes it clear that overriding a parent method is intentional and simplifies refactoring, because the removal of an overridden parent method will be detected.',
1417
'randomizer_getbytesfromstring_title' => 'New <code>Randomizer<span style="word-break: break-all;">::</span>getBytesFromString()</code> method',
18+
'randomizer_getbytesfromstring_description' => 'The <a href="/releases/8.2/en.php#random_extension">Random Extension</a> that was added in PHP 8.2 was extended by a new method to generate random strings consisting of specific bytes only. This method allows to easily generate random identifiers, such as domain names, and numeric strings of arbitrary length.',
1519
'randomizer_getfloat_nextfloat_title' => 'New <code>Randomizer::getFloat()</code> and <code>Randomizer::nextFloat()</code> methods',
1620
'randomizer_getfloat_nextfloat_description' => 'The algorithm used is the γ-section algorithm as published in:
1721
<a href="https://doi.org/10.1145/3503512" target="_blank" rel="noopener noreferrer">Drawing Random

releases/8.3/release.inc

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ PHP
194194
</div>
195195
</div>
196196
</div>
197+
198+
<div class="php8-compare__content">
199+
<?= message('override_description', $lang) ?>
200+
</div>
197201
</div>
198202

199203
<div class="php8-compare">
@@ -243,9 +247,9 @@ readonly class Foo {
243247
}
244248
245249
public function __clone()
246-
{
247-
$this->dateTime = clone $this->dateTime;
248-
}
250+
{
251+
$this->dateTime = clone $this->dateTime;
252+
}
249253
}
250254
251255
$today = new Foo(new \DateTime());
@@ -257,6 +261,9 @@ PHP
257261
</div>
258262
</div>
259263
</div>
264+
<div class="php8-compare__content">
265+
<?= message('readonly_description', $lang) ?>
266+
</div>
260267
</div>
261268

262269
<div class="php8-compare">
@@ -270,7 +277,7 @@ PHP
270277
<div class="php8-code phpcode">
271278
<?php highlight_php_trimmed(
272279
<<<'PHP'
273-
function json_validate(string $string) {
280+
function json_validate(string $string): bool {
274281
json_decode($string);
275282
return json_last_error() === JSON_ERROR_NONE;
276283
}
@@ -293,6 +300,9 @@ PHP
293300
</div>
294301
</div>
295302
</div>
303+
<div class="php8-compare__content">
304+
<?= message('json_validate_description', $lang) ?>
305+
</div>
296306
</div>
297307

298308
<div class="php8-compare">
@@ -358,6 +368,10 @@ PHP
358368
</div>
359369
</div>
360370
</div>
371+
372+
<div class="php8-compare__content">
373+
<?= message('randomizer_getbytesfromstring_description', $lang) ?>
374+
</div>
361375
</div>
362376

363377
<div class="php8-compare">

0 commit comments

Comments
 (0)