Skip to content

Commit 55390a7

Browse files
saundefinedFlote37
andcommitted
PHP 8.3 release page updates
Closes #827 Co-authored-by: Florian <bulbuzard37@gmail.com>
1 parent 23ecbbc commit 55390a7

File tree

3 files changed

+46
-42
lines changed

3 files changed

+46
-42
lines changed

releases/8.3/languages/en.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
return [
4-
'common_header' => 'PHP 8.3 is a major update of the PHP language. It contains many new features, such as explicit typing of class constants, deep-cloning of readonly properties and additions to the randomness functionality. As always it also includes performance improvements, bug fixes and general cleanup.',
4+
'common_header' => 'PHP 8.3 is a major update of the PHP language. It contains many new features, such as explicit typing of class constants, deep-cloning of readonly properties and additions to the randomness functionality. As always it also includes performance improvements, bug fixes, and general cleanup.',
55
'documentation' => 'Doc',
66
'main_title' => 'Released!',
7-
'main_subtitle' => 'PHP 8.3 is a major update of the PHP language.<br class="display-none-md">It contains many new features, such as explicit typing of class constants, deep-cloning of readonly properties and additions to the randomness functionality. As always it also includes performance improvements, bug fixes and general cleanup.',
7+
'main_subtitle' => 'PHP 8.3 is a major update of the PHP language.<br class="display-none-md">It contains many new features, such as explicit typing of class constants, deep-cloning of readonly properties and additions to the randomness functionality. As always it also includes performance improvements, bug fixes, and general cleanup.',
88
'upgrade_now' => 'Upgrade to PHP 8.3 now!',
99

1010
'readonly_title' => 'Deep-cloning of readonly properties',
@@ -15,7 +15,7 @@
1515
'override_title' => 'New <code>#[\Override]</code> attribute',
1616
'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.',
1717
'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.',
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 the developer to easily generate random identifiers, such as domain names, and numeric strings of arbitrary length.',
1919
'randomizer_getfloat_nextfloat_title' => 'New <code>Randomizer::getFloat()</code> and <code>Randomizer::nextFloat()</code> methods',
2020
'randomizer_getfloat_nextfloat_description' => '<p>Due to the limited precision and implicit rounding of floating point numbers, generating an unbiased float lying within a specific interval is non-trivial and the commonly used userland solutions may generate biased results or numbers outside the requested range.</p><p>The Randomizer was also extended with two methods to generate random floats in an unbiased fashion. The <code>Randomizer::getFloat()</code> method uses the γ-section algorithm that was published in <a href="https://doi.org/10.1145/3503512" target="_blank" rel="noopener noreferrer">Drawing Random Floating-Point Numbers from an Interval. Frédéric Goualard, ACM Trans. Model. Comput. Simul., 32:3, 2022.</a></p>',
2121
'dynamic_class_constant_fetch_title' => 'Dynamic class constant fetch',
@@ -28,7 +28,7 @@
2828
'new_posix' => 'New <a href="/manual/en/function.posix-sysconf.php"><code>posix_sysconf()</code></a>, <a href="/manual/en/function.posix-pathconf.php"><code>posix_pathconf()</code></a>, <a href="/manual/en/function.posix-fpathconf.php"><code>posix_fpathconf()</code></a>, and <a href="/manual/en/function.posix-eaccess.php"><code>posix_eaccess()</code></a> functions.',
2929
'new_reflection' => 'New <a href="/manual/en/reflectionmethod.createfrommethodname.php"><code>ReflectionMethod::createFromMethodName()</code></a> method.',
3030
'new_socket' => 'New <a href="/manual/en/function.socket-atmark.php"><code>socket_atmark()</code></a> function.',
31-
'new_str' => 'New <a href="/manual/en/function.str-increment.php"><code>str_increment()</code></a>, <a href="/manual/en/function.str-decrement.php"><code>str_decrement()</code></a>, and <a href="/manual/en/function.stream-context-set-option.php"><code>stream_context_set_options()</code></a> functions.',
31+
'new_str' => 'New <a href="/manual/en/function.str-increment.php"><code>str_increment()</code></a>, <a href="/manual/en/function.str-decrement.php"><code>str_decrement()</code></a>, and <a href="/manual/en/function.stream-context-set-options.php"><code>stream_context_set_options()</code></a> functions.',
3232
'new_ziparchive' => 'New <a href="/manual/en/ziparchive.getarchiveflag.php"><code>ZipArchive::getArchiveFlag()</code></a> method.',
3333
'new_openssl_ec' => 'Support for generation EC keys with custom EC parameters in OpenSSL extension.',
3434
'new_ini' => 'New INI setting <a href="/manual/en/migration83.other-changes.php#migration83.other-changes.ini"><code>zend.max_allowed_stack_size</code></a> to set the maximum allowed stack size.',
@@ -42,6 +42,7 @@
4242
'bc_mtrand' => 'The <a href="/manual/en/random.constants.php#constant.mt-rand-php"><code>MT_RAND_PHP</code></a> Mt19937 variant is deprecated.',
4343
'bc_reflection' => '<a href="/manual/en/reflectionclass.getstaticproperties.php"><code>ReflectionClass::getStaticProperties()</code></a> is no longer nullable.',
4444
'bc_ini' => 'INI settings <a href="/manual/en/info.configuration.php#ini.assert.active"><code>assert.active</code></a>, <a href="/manual/en/info.configuration.php#ini.assert.bail"><code>assert.bail</code></a>, <a href="/manual/en/info.configuration.php#ini.assert.callback"><code>assert.callback</code></a>, <a href="/manual/en/info.configuration.php#ini.assert.exception"><code>assert.exception</code></a>, and <a href="/manual/en/info.configuration.php#ini.assert.warning"><code>assert.warning</code></a> have been deprecated.',
45+
'bc_standard' => 'Calling <a href="/manual/en/function.get-class.php"><code>get_class()</code></a> and <a href="/manual/en/function.get-parent-class.php"><code>get_parent_class()</code></a> without arguments are deprecated.',
4546

4647
'footer_title' => 'Better performance, better syntax, improved type safety.',
4748
'footer_description' => '<p>For source downloads of PHP 8.3 please visit the <a href="/downloads">downloads</a> page. Windows binaries can be found on the <a href="https://windows.php.net/download">PHP for Windows</a> site. The list of changes is recorded in the <a href="/ChangeLog-8.php#PHP_8_3">ChangeLog</a>.</p>

releases/8.3/languages/ru.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
'new_posix' => 'Новые функции <a href="/manual/ru/function.posix-sysconf.php"><code>posix_sysconf()</code></a>, <a href="/manual/ru/function.posix-pathconf.php"><code>posix_pathconf()</code></a>, <a href="/manual/ru/function.posix-fpathconf.php"><code>posix_fpathconf()</code></a> и <a href="/manual/ru/function.posix-eaccess.php"><code>posix_eaccess()</code></a>.',
2929
'new_reflection' => 'Новый метод <a href="/manual/ru/reflectionmethod.createfrommethodname.php"><code>ReflectionMethod::createFromMethodName()</code></a>.',
3030
'new_socket' => 'Новая функция <a href="/manual/ru/function.socket-atmark.php"><code>socket_atmark()</code></a>.',
31-
'new_str' => 'Новые функции <a href="/manual/ru/function.str-increment.php"><code>str_increment()</code></a>, <a href="/manual/ru/function.str-decrement.php"><code>str_decrement()</code></a> и <a href="/manual/ru/function.stream-context-set-option.php"><code>stream_context_set_options()</code></a>.',
31+
'new_str' => 'Новые функции <a href="/manual/ru/function.str-increment.php"><code>str_increment()</code></a>, <a href="/manual/ru/function.str-decrement.php"><code>str_decrement()</code></a> и <a href="/manual/ru/function.stream-context-set-options.php"><code>stream_context_set_options()</code></a>.',
3232
'new_ziparchive' => 'Новый метод <a href="/manual/ru/ziparchive.getarchiveflag.php"><code>ZipArchive::getArchiveFlag()</code></a>.',
3333
'new_openssl_ec' => 'Поддержка генерации EC-ключей с пользовательскими EC-параметрами в модуле OpenSSL.',
3434
'new_ini' => 'Новый параметр INI <a href="/manual/ru/migration83.other-changes.php#migration83.other-changes.ini"><code>zend.max_allowed_stack_size</code></a> для установки максимально допустимого размера стека.',
@@ -42,6 +42,7 @@
4242
'bc_mtrand' => 'Вариант Mt19937 <a href="/manual/ru/random.constants.php#constant.mt-rand-php"><code>MT_RAND_PHP</code></a> объявлен устаревшим.',
4343
'bc_reflection' => '<a href="/manual/ru/reflectionclass.getstaticproperties.php"><code>ReflectionClass::getStaticProperties()</code></a> теперь не возвращает значение <code>null</code>.',
4444
'bc_ini' => 'Параметры INI <a href="/manual/ru/info.configuration.php#ini.assert.active"><code>assert.active</code></a>, <a href="/manual/ru/info.configuration.php#ini.assert.bail"><code>assert.bail</code></a>, <a href="/manual/ru/info.configuration.php#ini.assert.callback"><code>assert.callback</code></a>, <a href="/manual/ru/info.configuration.php#ini.assert.exception"><code>assert.exception</code></a> и <a href="/manual/ru/info.configuration.php#ini.assert.warning"><code>assert.warning</code></a> объявлены устаревшими.',
45+
'bc_standard' => 'Вызов функции <a href="/manual/en/function.get-class.php"><code>get_class()</code></a> и <a href="/manual/en/function.get-parent-class.php"><code>get_parent_class()</code></a> без аргументов объявлен устаревшим.',
4546

4647
'footer_title' => 'Выше производительность, лучше синтаксис, надёжнее система типов.',
4748
'footer_description' => '<p>Для загрузки исходного кода PHP 8.3 посетите страницу <a href="/downloads">Downloads</a>. Бинарные файлы Windows находятся на сайте <a href="https://windows.php.net/download">PHP for Windows</a>. Список изменений перечислен на странице <a href="/ChangeLog-8.php#PHP_8_3">ChangeLog</a>.</p>

releases/8.3/release.inc

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,14 @@ PHP
141141
<<<'PHP'
142142
use PHPUnit\Framework\TestCase;
143143
144-
final class MyTest extends TestCase
145-
{
144+
final class MyTest extends TestCase {
146145
protected $logFile;
147146
148-
protected function setUp(): void
149-
{
147+
protected function setUp(): void {
150148
$this->logFile = fopen('/tmp/logfile', 'w');
151149
}
152150
153-
protected function taerDown(): void
154-
{
151+
protected function taerDown(): void {
155152
fclose($this->logFile);
156153
unlink('/tmp/logfile');
157154
}
@@ -172,18 +169,15 @@ PHP
172169
<<<'PHP'
173170
use PHPUnit\Framework\TestCase;
174171
175-
final class MyTest extends TestCase
176-
{
172+
final class MyTest extends TestCase {
177173
protected $logFile;
178174
179-
protected function setUp(): void
180-
{
175+
protected function setUp(): void {
181176
$this->logFile = fopen('/tmp/logfile', 'w');
182177
}
183178
184179
#[\Override]
185-
protected function taerDown(): void
186-
{
180+
protected function taerDown(): void {
187181
fclose($this->logFile);
188182
unlink('/tmp/logfile');
189183
}
@@ -213,23 +207,24 @@ PHP
213207
<div class="php8-code phpcode">
214208
<?php highlight_php_trimmed(
215209
<<<'PHP'
216-
readonly class Foo {
217-
public \DateTime $dateTime;
210+
class PHP {
211+
public string $version = '8.2';
212+
}
218213
219-
function __construct(\DateTime $dateTime) {
220-
$this->dateTime = $dateTime;
221-
}
214+
readonly class Foo {
215+
public function __construct(
216+
public PHP $php
217+
) {}
222218
223-
public function __clone()
224-
{
225-
$this->dateTime = clone $this->dateTime;
219+
public function __clone(): void {
220+
$this->php = clone $this->php;
226221
}
227222
}
228223
229-
$today = new Foo(new \DateTime());
230-
$tomorrow = clone $today;
224+
$instance = new Foo(new PHP());
225+
$cloned = clone $instance;
231226
232-
// Fatal error: Cannot modify readonly property Foo::$dateTime
227+
// Fatal error: Cannot modify readonly property Foo::$php
233228
PHP
234229

235230
); ?>
@@ -241,23 +236,24 @@ PHP
241236
<div class="php8-code phpcode">
242237
<?php highlight_php_trimmed(
243238
<<<'PHP'
244-
readonly class Foo {
245-
public \DateTime $dateTime;
239+
class PHP {
240+
public string $version = '8.2';
241+
}
246242
247-
function __construct(\DateTime $dateTime) {
248-
$this->dateTime = $dateTime;
249-
}
243+
readonly class Foo {
244+
public function __construct(
245+
public PHP $php
246+
) {}
250247
251-
public function __clone()
252-
{
253-
$this->dateTime = clone $this->dateTime;
248+
public function __clone(): void {
249+
$this->php = clone $this->php;
254250
}
255251
}
256252
257-
$today = new Foo(new \DateTime());
258-
$tomorrow = clone $today;
253+
$instance = new Foo(new PHP());
254+
$cloned = clone $instance;
259255
260-
$tomorrow->dateTime->modify('+1 day');
256+
$cloned->php->version = '8.3';
261257
PHP
262258
); ?>
263259
</div>
@@ -272,7 +268,8 @@ PHP
272268
<h2 class="php8-h2" id="json_validate">
273269
<?= message('json_validate_title', $lang) ?>
274270
<a class="php8-rfc" href="https://wiki.php.net/rfc/json_validate">RFC</a>
275-
<a class="php8-rfc" href="/manual/<?= $lang ?>/function.json-validate.php"><?= message('documentation', $lang) ?></a>
271+
<a class="php8-rfc"
272+
href="/manual/<?= $lang ?>/function.json-validate.php"><?= message('documentation', $lang) ?></a>
276273
</h2>
277274
<div class="php8-compare__main">
278275
<div class="php8-compare__block example-contents">
@@ -282,6 +279,7 @@ PHP
282279
<<<'PHP'
283280
function json_validate(string $string): bool {
284281
json_decode($string);
282+
285283
return json_last_error() === JSON_ERROR_NONE;
286284
}
287285
@@ -312,7 +310,8 @@ PHP
312310
<h2 class="php8-h2" id="randomizer_get_bytes_from_string">
313311
<?= message('randomizer_getbytesfromstring_title', $lang) ?>
314312
<a class="php8-rfc" href="https://wiki.php.net/rfc/randomizer_additions#getbytesfromstring">RFC</a>
315-
<a class="php8-rfc" href="/manual/<?= $lang ?>/random-randomizer.getbytesfromstring.php"><?= message('documentation', $lang) ?></a>
313+
<a class="php8-rfc"
314+
href="/manual/<?= $lang ?>/random-randomizer.getbytesfromstring.php"><?= message('documentation', $lang) ?></a>
316315
</h2>
317316
<div class="php8-compare__main">
318317
<div class="php8-compare__block example-contents">
@@ -381,7 +380,8 @@ PHP
381380
<h2 class="php8-h2" id="randomizer_get_float">
382381
<?= message('randomizer_getfloat_nextfloat_title', $lang) ?>
383382
<a class="php8-rfc" href="https://wiki.php.net/rfc/randomizer_additions#getfloat">RFC</a>
384-
<a class="php8-rfc" href="/manual/<?= $lang ?>/random-randomizer.getfloat.php"><?= message('documentation', $lang) ?></a>
383+
<a class="php8-rfc"
384+
href="/manual/<?= $lang ?>/random-randomizer.getfloat.php"><?= message('documentation', $lang) ?></a>
385385
</h2>
386386
<div class="php8-compare__main">
387387
<div class="php8-compare__block example-contents">
@@ -395,6 +395,7 @@ function getFloat(float $min, float $max) {
395395
// return values outside the given range. This is impossible
396396
// to work around in userland.
397397
$offset = random_int(0, PHP_INT_MAX) / PHP_INT_MAX;
398+
398399
return $offset * ($max - $min) + $min;
399400
}
400401
@@ -474,6 +475,7 @@ PHP
474475
<li><?= message('bc_mtrand', $lang) ?></li>
475476
<li><?= message('bc_reflection', $lang) ?></li>
476477
<li><?= message('bc_ini', $lang) ?></li>
478+
<li><?= message('bc_standard', $lang) ?></li>
477479
</ul>
478480
</div>
479481
</div>

0 commit comments

Comments
 (0)