Author: Sergey Panteleev (saundefined) Date: 2023-11-22T00:25:34+03:00 Commit: https://github.com/php/web-php/commit/55390a7898d58ea61e951fe27eca3acd5d1b5426 Raw diff: https://github.com/php/web-php/commit/55390a7898d58ea61e951fe27eca3acd5d1b5426.diff
PHP 8.3 release page updates Closes #827 Co-authored-by: Florian <bulbuzar...@gmail.com> Changed paths: M releases/8.3/languages/en.php M releases/8.3/languages/ru.php M releases/8.3/release.inc Diff: diff --git a/releases/8.3/languages/en.php b/releases/8.3/languages/en.php index 0ad1638dd4..f5e2600c5f 100644 --- a/releases/8.3/languages/en.php +++ b/releases/8.3/languages/en.php @@ -1,10 +1,10 @@ <?php return [ - '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.', + '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.', 'documentation' => 'Doc', 'main_title' => 'Released!', - '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.', + '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.', 'upgrade_now' => 'Upgrade to PHP 8.3 now!', 'readonly_title' => 'Deep-cloning of readonly properties', @@ -15,7 +15,7 @@ 'override_title' => 'New <code>#[\Override]</code> attribute', '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.', 'randomizer_getbytesfromstring_title' => 'New <code>Randomizer<span style="word-break: break-all;">::</span>getBytesFromString()</code> method', - '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.', + '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.', 'randomizer_getfloat_nextfloat_title' => 'New <code>Randomizer::getFloat()</code> and <code>Randomizer::nextFloat()</code> methods', '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>', 'dynamic_class_constant_fetch_title' => 'Dynamic class constant fetch', @@ -28,7 +28,7 @@ '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.', 'new_reflection' => 'New <a href="/manual/en/reflectionmethod.createfrommethodname.php"><code>ReflectionMethod::createFromMethodName()</code></a> method.', 'new_socket' => 'New <a href="/manual/en/function.socket-atmark.php"><code>socket_atmark()</code></a> function.', - '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.', + '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.', 'new_ziparchive' => 'New <a href="/manual/en/ziparchive.getarchiveflag.php"><code>ZipArchive::getArchiveFlag()</code></a> method.', 'new_openssl_ec' => 'Support for generation EC keys with custom EC parameters in OpenSSL extension.', '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 @@ 'bc_mtrand' => 'The <a href="/manual/en/random.constants.php#constant.mt-rand-php"><code>MT_RAND_PHP</code></a> Mt19937 variant is deprecated.', 'bc_reflection' => '<a href="/manual/en/reflectionclass.getstaticproperties.php"><code>ReflectionClass::getStaticProperties()</code></a> is no longer nullable.', '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.', + '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.', 'footer_title' => 'Better performance, better syntax, improved type safety.', '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> diff --git a/releases/8.3/languages/ru.php b/releases/8.3/languages/ru.php index cef2e7e8fd..54bafafdf1 100644 --- a/releases/8.3/languages/ru.php +++ b/releases/8.3/languages/ru.php @@ -28,7 +28,7 @@ '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>.', 'new_reflection' => 'Новый метод <a href="/manual/ru/reflectionmethod.createfrommethodname.php"><code>ReflectionMethod::createFromMethodName()</code></a>.', 'new_socket' => 'Новая функция <a href="/manual/ru/function.socket-atmark.php"><code>socket_atmark()</code></a>.', - '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>.', + '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>.', 'new_ziparchive' => 'Новый метод <a href="/manual/ru/ziparchive.getarchiveflag.php"><code>ZipArchive::getArchiveFlag()</code></a>.', 'new_openssl_ec' => 'Поддержка генерации EC-ключей с пользовательскими EC-параметрами в модуле OpenSSL.', '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 @@ 'bc_mtrand' => 'Вариант Mt19937 <a href="/manual/ru/random.constants.php#constant.mt-rand-php"><code>MT_RAND_PHP</code></a> объявлен устаревшим.', 'bc_reflection' => '<a href="/manual/ru/reflectionclass.getstaticproperties.php"><code>ReflectionClass::getStaticProperties()</code></a> теперь не возвращает значение <code>null</code>.', '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> объявлены устаревшими.', + '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> без аргументов объявлен устаревшим.', 'footer_title' => 'Выше производительность, лучше синтаксис, надёжнее система типов.', '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> diff --git a/releases/8.3/release.inc b/releases/8.3/release.inc index 501f873067..c99a528383 100644 --- a/releases/8.3/release.inc +++ b/releases/8.3/release.inc @@ -141,17 +141,14 @@ PHP <<<'PHP' use PHPUnit\Framework\TestCase; -final class MyTest extends TestCase -{ +final class MyTest extends TestCase { protected $logFile; - protected function setUp(): void - { + protected function setUp(): void { $this->logFile = fopen('/tmp/logfile', 'w'); } - protected function taerDown(): void - { + protected function taerDown(): void { fclose($this->logFile); unlink('/tmp/logfile'); } @@ -172,18 +169,15 @@ PHP <<<'PHP' use PHPUnit\Framework\TestCase; -final class MyTest extends TestCase -{ +final class MyTest extends TestCase { protected $logFile; - protected function setUp(): void - { + protected function setUp(): void { $this->logFile = fopen('/tmp/logfile', 'w'); } #[\Override] - protected function taerDown(): void - { + protected function taerDown(): void { fclose($this->logFile); unlink('/tmp/logfile'); } @@ -213,23 +207,24 @@ PHP <div class="php8-code phpcode"> <?php highlight_php_trimmed( <<<'PHP' -readonly class Foo { - public \DateTime $dateTime; +class PHP { + public string $version = '8.2'; +} - function __construct(\DateTime $dateTime) { - $this->dateTime = $dateTime; - } +readonly class Foo { + public function __construct( + public PHP $php + ) {} - public function __clone() - { - $this->dateTime = clone $this->dateTime; + public function __clone(): void { + $this->php = clone $this->php; } } -$today = new Foo(new \DateTime()); -$tomorrow = clone $today; +$instance = new Foo(new PHP()); +$cloned = clone $instance; -// Fatal error: Cannot modify readonly property Foo::$dateTime +// Fatal error: Cannot modify readonly property Foo::$php PHP ); ?> @@ -241,23 +236,24 @@ PHP <div class="php8-code phpcode"> <?php highlight_php_trimmed( <<<'PHP' -readonly class Foo { - public \DateTime $dateTime; +class PHP { + public string $version = '8.2'; +} - function __construct(\DateTime $dateTime) { - $this->dateTime = $dateTime; - } +readonly class Foo { + public function __construct( + public PHP $php + ) {} - public function __clone() - { - $this->dateTime = clone $this->dateTime; + public function __clone(): void { + $this->php = clone $this->php; } } -$today = new Foo(new \DateTime()); -$tomorrow = clone $today; +$instance = new Foo(new PHP()); +$cloned = clone $instance; -$tomorrow->dateTime->modify('+1 day'); +$cloned->php->version = '8.3'; PHP ); ?> </div> @@ -272,7 +268,8 @@ PHP <h2 class="php8-h2" id="json_validate"> <?= message('json_validate_title', $lang) ?> <a class="php8-rfc" href="https://wiki.php.net/rfc/json_validate">RFC</a> - <a class="php8-rfc" href="/manual/<?= $lang ?>/function.json-validate.php"><?= message('documentation', $lang) ?></a> + <a class="php8-rfc" + href="/manual/<?= $lang ?>/function.json-validate.php"><?= message('documentation', $lang) ?></a> </h2> <div class="php8-compare__main"> <div class="php8-compare__block example-contents"> @@ -282,6 +279,7 @@ PHP <<<'PHP' function json_validate(string $string): bool { json_decode($string); + return json_last_error() === JSON_ERROR_NONE; } @@ -312,7 +310,8 @@ PHP <h2 class="php8-h2" id="randomizer_get_bytes_from_string"> <?= message('randomizer_getbytesfromstring_title', $lang) ?> <a class="php8-rfc" href="https://wiki.php.net/rfc/randomizer_additions#getbytesfromstring">RFC</a> - <a class="php8-rfc" href="/manual/<?= $lang ?>/random-randomizer.getbytesfromstring.php"><?= message('documentation', $lang) ?></a> + <a class="php8-rfc" + href="/manual/<?= $lang ?>/random-randomizer.getbytesfromstring.php"><?= message('documentation', $lang) ?></a> </h2> <div class="php8-compare__main"> <div class="php8-compare__block example-contents"> @@ -381,7 +380,8 @@ PHP <h2 class="php8-h2" id="randomizer_get_float"> <?= message('randomizer_getfloat_nextfloat_title', $lang) ?> <a class="php8-rfc" href="https://wiki.php.net/rfc/randomizer_additions#getfloat">RFC</a> - <a class="php8-rfc" href="/manual/<?= $lang ?>/random-randomizer.getfloat.php"><?= message('documentation', $lang) ?></a> + <a class="php8-rfc" + href="/manual/<?= $lang ?>/random-randomizer.getfloat.php"><?= message('documentation', $lang) ?></a> </h2> <div class="php8-compare__main"> <div class="php8-compare__block example-contents"> @@ -395,6 +395,7 @@ function getFloat(float $min, float $max) { // return values outside the given range. This is impossible // to work around in userland. $offset = random_int(0, PHP_INT_MAX) / PHP_INT_MAX; + return $offset * ($max - $min) + $min; } @@ -474,6 +475,7 @@ PHP <li><?= message('bc_mtrand', $lang) ?></li> <li><?= message('bc_reflection', $lang) ?></li> <li><?= message('bc_ini', $lang) ?></li> + <li><?= message('bc_standard', $lang) ?></li> </ul> </div> </div> -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php