-
Notifications
You must be signed in to change notification settings - Fork 593
PHP 8.2 Release page #675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
PHP 8.2 Release page #675
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
be98d3d
Start PHP 8.2 Release page
saundefined be58b53
Update Deprecate dynamic properties message
saundefined aa9db74
Apply suggestions from code review
saundefined 2b60f87
Apply suggestions from code review,
saundefined ee48ca4
Add Doc links
saundefined 88b3e01
Apply suggestions from code review
saundefined c640cae
Put messages in lang-files
saundefined b26652d
Fixes, add Russian language
saundefined 6972894
Apply suggestions from code review
saundefined 14fdf4b
Apply suggestions from code review
saundefined e3b49c7
Apply suggestions from code review
saundefined 0b566e2
Update releases/8.2/release.inc
saundefined ec0f808
Add links to doc
saundefined f5346db
Prepare for preview
saundefined 23131f3
Prepare for preview, part 2
saundefined 2ae7d4a
Update index.php
saundefined File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace releases\php82; | ||
|
||
include_once __DIR__ . '/../../include/prepend.inc'; | ||
|
||
function language_redirect(string $currentLang): void { | ||
// We don't use the general language selection of php.net, | ||
// so soldier on with this one. | ||
return; | ||
} | ||
|
||
function common_header(string $description): void { | ||
global $MYSITE; | ||
|
||
$meta_image_path = \htmlspecialchars( | ||
\filter_var($MYSITE . 'images/php8/php_8_2_released.png', \FILTER_VALIDATE_URL)); | ||
$meta_description = \htmlspecialchars($description); | ||
|
||
\site_header("PHP 8.2.0 Release Announcement", [ | ||
'current' => 'php8', | ||
'css' => ['php8.css'], | ||
'meta_tags' => <<<META | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
<meta name="twitter:site" content="@official_php" /> | ||
<meta name="twitter:title" content="PHP 8.2 Released" /> | ||
<meta name="twitter:description" content="{$meta_description}" /> | ||
<meta name="twitter:creator" content="@official_php" /> | ||
<meta name="twitter:image:src" content="{$meta_image_path}" /> | ||
|
||
<meta itemprop="name" content="PHP 8.2 Released" /> | ||
<meta itemprop="description" content="{$meta_description}" /> | ||
<meta itemprop="image" content="{$meta_image_path}" /> | ||
|
||
<meta property="og:image" content="{$meta_image_path}" /> | ||
<meta property="og:description" content="{$meta_description}" /> | ||
META | ||
]); | ||
} | ||
|
||
function language_chooser(string $currentLang): void { | ||
$LANGUAGES = [ | ||
'en' => 'English', | ||
'ru' => 'Russian', | ||
]; | ||
|
||
// Print out the form with all the options | ||
echo ' | ||
<form action="" method="get" id="changelang" name="changelang"> | ||
<fieldset> | ||
<label for="changelang-langs">Change language:</label> | ||
<select onchange="location = this.value + \'.php\'" name="lang" id="changelang-langs"> | ||
'; | ||
|
||
$tab = ' '; | ||
foreach ($LANGUAGES as $lang => $text) { | ||
$selected = ($lang === $currentLang) ? ' selected="selected"' : ''; | ||
echo $tab, "<option value='$lang'$selected>$text</option>\n"; | ||
} | ||
|
||
echo ' </select> | ||
</fieldset> | ||
</form> | ||
'; | ||
} | ||
|
||
function message($code, $language = 'en') | ||
{ | ||
$original = require __DIR__ . '/languages/en.php'; | ||
if (($language !== 'en') && file_exists(__DIR__ . '/languages/' . $language . '.php')) { | ||
$translation = require __DIR__ . '/languages/' . $language . '.php'; | ||
} | ||
|
||
return $translation[$code] ?? $original[$code] ?? $code; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
$lang = 'en'; | ||
|
||
include_once __DIR__ . '/release.inc'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
$_SERVER['BASE_PAGE'] = 'releases/8.2/index.php'; | ||
include (__DIR__ . '/../../include/site.inc'); | ||
|
||
mirror_redirect('/releases/8.2/en.php'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
return [ | ||
'common_header' => 'PHP 8.2 is a major update of the PHP language. Readonly classes, null, false, and true as stand-alone types, deprecated dynamic properties, performance improvements and more', | ||
'documentation' => 'Doc', | ||
'main_title' => 'Released!', | ||
'main_subtitle' => 'PHP 8.2 is a major update of the PHP language.<br class="display-none-md">It contains many new features, including readonly classes, null, false, and true as stand-alone types, deprecated dynamic properties, performance improvements and more.', | ||
'upgrade_now' => 'Upgrade to PHP 8.2 now!', | ||
'readonly_classes_title' => 'Readonly classes', | ||
'dnf_types_title' => 'Disjunctive Normal Form (DNF) Types', | ||
'dnf_types_description' => 'DNF types allow us to combine <a href="/manual/en/language.types.declarations.php#language.types.declarations.composite.union">union</a> and <a href="/manual/en/language.types.declarations.php#language.types.declarations.composite.intersection">intersection</a> types, following a strict rule: when combining union and intersection types, intersection types must be grouped with brackets.', | ||
'null_false_true_types_title' => 'Allow <code>null</code>, <code>false</code>, and <code>true</code> as stand-alone types', | ||
'random_title' => 'New "Random" extension', | ||
'random_description' => '<p>The "random" extension provides a new object-oriented API to random number generation. Instead of relying on a globally seeded random number generator (RNG) using the Mersenne Twister algorithm the object-oriented API provides several classes ("Engine"s) providing access to modern algorithms that store their state within objects to allow for multiple independent seedable sequences.</p> | ||
<p>The <code>\Random\Randomizer</code> class provides a high level interface to use the engine\'s randomness to generate a random integer, to shuffle an array or string, to select random array keys and more.</p>', | ||
'constants_in_traits_title' => 'Constants in traits', | ||
'constants_in_traits_description' => 'You cannot access the constant through the name of the trait, but, you can access the constant through the class that uses the trait.', | ||
'deprecate_dynamic_properties_title' => 'Deprecate dynamic properties', | ||
'deprecate_dynamic_properties_description' => '<p>The creation of dynamic properties is deprecated to help avoid mistakes and typos, unless the class opts in by using the <code>#[\AllowDynamicProperties]</code> attribute. <code>stdClass</code> allows dynamic properties.</p> | ||
<p>Usage of the <code>__get</code>/<code>__set</code> magic methods is not affected by this change.</p>', | ||
'new_classes_title' => 'New Classes, Interfaces, and Functions', | ||
'new_mysqli' => 'New <code>mysqli_execute_query</code> function and <code>mysqli::execute_query</code> method.', | ||
'new_attributes' => 'New <code>#[\AllowDynamicProperties]</code> and <code>#[\SensitiveParameter]</code> attributes.', | ||
'new_zip' => 'New <code>ZipArchive::getStreamIndex</code>, <code>ZipArchive::getStreamName</code>, and <code>ZipArchive::clearError</code> methods.', | ||
'new_reflection' => 'New <code>ReflectionFunction::isAnonymous</code> and <code>ReflectionMethod::hasPrototype</code> methods.', | ||
'new_functions' => 'New <code>curl_upkeep</code>, <code>memory_reset_peak_usage</code>, <code>ini_parse_quantity</code>, <code>libxml_get_external_entity_loader</code>, <code>sodium_crypto_stream_xchacha20_xor_ic</code>, <code>openssl_cipher_key_length</code> functions.', | ||
'bc_title' => 'Deprecations and backward compatibility breaks', | ||
'bc_string_interpolation' => 'Deprecated <code>${}</code> string interpolation.', | ||
'bc_utf8' => 'Deprecated <code>utf8_encode</code> and <code>utf8_decode</code> functions.', | ||
'bc_datetime' => 'Methods <code>DateTime::createFromImmutable</code> and <code>DateTimeImmutable::createFromMutable</code> has a tentative return type of <code>static</code>.', | ||
'bc_odbc' => 'Extensions <code>ODBC</code> and <code>PDO_ODBC</code> escapes the username and password.', | ||
'bc_str_locale_sensitive' => 'Functions <code>strtolower</code> and <code>strtoupper</code> are no longer locale-sensitive.', | ||
'bc_spl_enforces_signature' => 'Methods <code>SplFileObject::getCsvControl</code>, <code>SplFileObject::fflush</code>, <code>SplFileObject::ftell</code>, <code>SplFileObject::fgetc</code>, and <code>SplFileObject::fpassthru</code> enforces their signature.', | ||
'bc_spl_false' => 'Method <code>SplFileObject::hasChildren</code> has a tentative return type of <code>false</code>.', | ||
'bc_spl_null' => 'Method <code>SplFileObject::getChildren</code> has a tentative return type of <code>null</code>.', | ||
'bc_spl_deprecated' => 'The internal method <code>SplFileInfo::_bad_state_ex</code> has been deprecated.', | ||
'footer_title' => 'Better performance, better syntax, improved type safety.', | ||
'footer_description' => '<p>For source downloads of PHP 8.2 please visit the <a href="https://www.php.net/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="https://www.php.net/ChangeLog-8.php#PHP_8_2">ChangeLog</a>.</p> | ||
<p>The <a href="/manual/en/migration82.php">migration guide</a> is available in the PHP Manual. Please consult it for a detailed list of new features and backward-incompatible changes.</p>', | ||
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
return [ | ||
'common_header' => 'PHP 8.2 — большое обновление языка PHP. Readonly-классы, самостоятельные типы null, false и true, устаревшие динамические свойства, улучшение производительности и многое другое.', | ||
'documentation' => 'Документация', | ||
'main_title' => 'выпущен!', | ||
'main_subtitle' => 'PHP 8.2 — большое обновление языка PHP.<br class="display-none-md">Оно содержит множество новых возможностей, включая readonly-классы, самостоятельные типы null, false и true, устаревшие динамические свойства, улучшение производительности и многое другое.', | ||
'upgrade_now' => 'Переходите на PHP 8.2!', | ||
'readonly_classes_title' => 'Readonly-классы', | ||
'dnf_types_title' => 'Типы в виде дизъюнктивной нормальной формы (ДНФ)', | ||
'dnf_types_description' => 'ДНФ позволяет совместить <a href="/manual/ru/language.types.declarations.php#language.types.declarations.composite.union">объединение</a> и <a href="/manual/ru/language.types.declarations.php#language.types.declarations.composite.intersection">пересечение</a> типов, при этом обязательно типы пересечения следует сгруппировать скобками.', | ||
'null_false_true_types_title' => 'Самостоятельные типы <code>null</code>, <code>false</code> и <code>true</code>', | ||
'random_title' => 'Новый модуль "Random"', | ||
'random_description' => '<p>Модуль "random" предлагает новый объектно-ориентированный API для генерации случайных чисел. Вместо использования глобального генератора случайных чисел (ГСЧ) на базе алгоритма вихря Мерсенна, в объектно-ориентированном API доступно несколько ГСЧ, представленных отдельными классами (как реализации интерфейса Engine), которые хранят внутреннее состояние, позволяя создавать несколько независимых последовательностей случайных чисел.</p> | ||
<p>Класс <code>\Random\Randomizer</code> представляет высокоуровневый интерфейс по использованию движков для генерации случайного целого числа, перемешивания массива или строки, выбора случайных ключей массива и многое другое.</p>', | ||
'constants_in_traits_title' => 'Константы в трейтах', | ||
'constants_in_traits_description' => 'Нельзя получить доступ к константе через имя трейта, но можно через класс, который использует этот трейт.', | ||
'deprecate_dynamic_properties_title' => 'Динамические свойства объявлены устаревшими', | ||
'deprecate_dynamic_properties_description' => '<p>Чтобы помочь избежать ошибок и опечаток, больше не рекомендуется определять динамические свойства, только если сам класс явно не разрешит это при помощи атрибута <code>#[\AllowDynamicProperties]</code>. В экземплярах <code>stdClass</code> по-прежнему можно использовать динамические свойства.</p> | ||
<p>Это изменение не влияет на использование магических методов <code>__get</code>/<code>__set</code>.</p>', | ||
'new_classes_title' => 'Новые классы, интерфейсы и функции', | ||
'new_mysqli' => 'Новая функция <code>mysqli_execute_query</code> и метод <code>mysqli::execute_query</code>.', | ||
'new_attributes' => 'Новые атрибуты <code>#[\AllowDynamicProperties]</code> и <code>#[\SensitiveParameter]</code>.', | ||
'new_zip' => 'Новые методы <code>ZipArchive::getStreamIndex</code>, <code>ZipArchive::getStreamName</code> и <code>ZipArchive::clearError</code>.', | ||
'new_reflection' => 'Новые методы <code>ReflectionFunction::isAnonymous</code> и <code>ReflectionMethod::hasPrototype</code>.', | ||
'new_functions' => 'Новые функции <code>curl_upkeep</code>, <code>memory_reset_peak_usage</code>, <code>ini_parse_quantity</code>, <code>libxml_get_external_entity_loader</code>, <code>sodium_crypto_stream_xchacha20_xor_ic</code>, <code>openssl_cipher_key_length</code>.', | ||
'bc_title' => 'Устаревшая функциональность и изменения в обратной совместимости', | ||
'bc_string_interpolation' => 'Интерполяции строк вида <code>${}</code> следует избегать.', | ||
'bc_utf8' => 'Не рекомендуется использовать функции <code>utf8_encode</code> и <code>utf8_decode</code>.', | ||
'bc_datetime' => 'У методов <code>DateTime::createFromImmutable</code> и <code>DateTimeImmutable::createFromMutable</code> задан предварительный тип возвращаемого значения <code>static</code>.', | ||
'bc_odbc' => 'Модули <code>ODBC</code> и <code>PDO_ODBC</code> экранирует имя пользователя и пароль.', | ||
'bc_str_locale_sensitive' => 'При работе функции <code>strtolower</code> и <code>strtoupper</code> теперь не учитывают локаль.', | ||
'bc_spl_enforces_signature' => 'Методы <code>SplFileObject::getCsvControl</code>, <code>SplFileObject::fflush</code>, <code>SplFileObject::ftell</code>, <code>SplFileObject::fgetc</code> и <code>SplFileObject::fpassthru</code> усиливают свою сигнатуру.', | ||
'bc_spl_false' => 'У метода <code>SplFileObject::hasChildren</code> предварительный тип возвращаемого значения задан как <code>false</code>.', | ||
'bc_spl_null' => 'У метода <code>SplFileObject::getChildren</code> предварительный тип возвращаемого значения задан как <code>null</code>.', | ||
'bc_spl_deprecated' => 'Внутренний метод <code>SplFileInfo::_bad_state_ex</code> объявлен устаревшим.', | ||
'footer_title' => 'Выше производительность, лучше синтаксис, надёжнее система типов.', | ||
'footer_description' => '<p>Для загрузки исходного кода PHP 8.2 посетите страницу <a href="https://www.php.net/downloads">Downloads</a>. Бинарные файлы Windows находятся на сайте <a href="https://windows.php.net/download">PHP for Windows</a>. Список изменений перечислен на странице <a href="https://www.php.net/ChangeLog-8.php#PHP_8_2">ChangeLog</a>.</p> | ||
<p><a href="/manual/ru/migration82.php">Руководство по миграции</a> доступно в разделе документации. Ознакомьтесь с ним, чтобы узнать обо всех новых возможностях и изменениях, затрагивающих обратную совместимость.</p>', | ||
]; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.