diff --git a/images/php8/logo_php8_2.svg b/images/php8/logo_php8_2.svg new file mode 100644 index 0000000000..5bfb8df725 --- /dev/null +++ b/images/php8/logo_php8_2.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + diff --git a/images/php8/php_8_2_released.png b/images/php8/php_8_2_released.png new file mode 100644 index 0000000000..357e322cb8 Binary files /dev/null and b/images/php8/php_8_2_released.png differ diff --git a/releases/8.2/common.php b/releases/8.2/common.php new file mode 100644 index 0000000000..966ca97d04 --- /dev/null +++ b/releases/8.2/common.php @@ -0,0 +1,75 @@ + 'php8', + 'css' => ['php8.css'], + 'meta_tags' => << + + + + + + + + + + + + +META + ]); +} + +function language_chooser(string $currentLang): void { + $LANGUAGES = [ + 'en' => 'English', + 'ru' => 'Russian', + ]; + + // Print out the form with all the options + echo ' +
+
+ + +
+
+'; +} + +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; +} diff --git a/releases/8.2/en.php b/releases/8.2/en.php new file mode 100644 index 0000000000..aa9133cd7a --- /dev/null +++ b/releases/8.2/en.php @@ -0,0 +1,5 @@ + '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' => 'To be released tomorrow!', + 'main_subtitle' => 'PHP 8.2 is a major update of the PHP language.
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 union and intersection types, following a strict rule: when combining union and intersection types, intersection types must be grouped with brackets.', + 'null_false_true_types_title' => 'Allow null, false, and true as stand-alone types', + 'random_title' => 'New "Random" extension', + 'random_description' => '

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.

+

The \Random\Randomizer 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.

', + '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' => '

The creation of dynamic properties is deprecated to help avoid mistakes and typos, unless the class opts in by using the #[\AllowDynamicProperties] attribute. stdClass allows dynamic properties.

+

Usage of the __get/__set magic methods is not affected by this change.

', + 'new_classes_title' => 'New Classes, Interfaces, and Functions', + 'new_mysqli' => 'New mysqli_execute_query function and mysqli::execute_query method.', + 'new_attributes' => 'New #[\AllowDynamicProperties] and #[\SensitiveParameter] attributes.', + 'new_zip' => 'New ZipArchive::getStreamIndex, ZipArchive::getStreamName, and ZipArchive::clearError methods.', + 'new_reflection' => 'New ReflectionFunction::isAnonymous and ReflectionMethod::hasPrototype methods.', + 'new_functions' => 'New curl_upkeep, memory_reset_peak_usage, ini_parse_quantity, libxml_get_external_entity_loader, sodium_crypto_stream_xchacha20_xor_ic, openssl_cipher_key_length functions.', + 'bc_title' => 'Deprecations and backward compatibility breaks', + 'bc_string_interpolation' => 'Deprecated ${} string interpolation.', + 'bc_utf8' => 'Deprecated utf8_encode and utf8_decode functions.', + 'bc_datetime' => 'Methods DateTime::createFromImmutable and DateTimeImmutable::createFromMutable has a tentative return type of static.', + 'bc_odbc' => 'Extensions ODBC and PDO_ODBC escapes the username and password.', + 'bc_str_locale_sensitive' => 'Functions strtolower and strtoupper are no longer locale-sensitive.', + 'bc_spl_enforces_signature' => 'Methods SplFileObject::getCsvControl, SplFileObject::fflush, SplFileObject::ftell, SplFileObject::fgetc, and SplFileObject::fpassthru enforces their signature.', + 'bc_spl_false' => 'Method SplFileObject::hasChildren has a tentative return type of false.', + 'bc_spl_null' => 'Method SplFileObject::getChildren has a tentative return type of null.', + 'bc_spl_deprecated' => 'The internal method SplFileInfo::_bad_state_ex has been deprecated.', + 'footer_title' => 'Better performance, better syntax, improved type safety.', + 'footer_description' => '

For source downloads of PHP 8.2 please visit the downloads page. Windows binaries can be found on the PHP for Windows site. The list of changes is recorded in the ChangeLog.

+

The migration guide is available in the PHP Manual. Please consult it for a detailed list of new features and backward-incompatible changes.

', +]; diff --git a/releases/8.2/languages/ru.php b/releases/8.2/languages/ru.php new file mode 100644 index 0000000000..6cbb51d636 --- /dev/null +++ b/releases/8.2/languages/ru.php @@ -0,0 +1,40 @@ + 'PHP 8.2 — большое обновление языка PHP. Readonly-классы, самостоятельные типы null, false и true, устаревшие динамические свойства, улучшение производительности и многое другое.', + 'documentation' => 'Документация', + 'main_title' => 'будет выпущен завтра!', + 'main_subtitle' => 'PHP 8.2 — большое обновление языка PHP.
Оно содержит множество новых возможностей, включая readonly-классы, самостоятельные типы null, false и true, устаревшие динамические свойства, улучшение производительности и многое другое.', + 'upgrade_now' => 'Переходите на PHP 8.2!', + 'readonly_classes_title' => 'Readonly-классы', + 'dnf_types_title' => 'Типы в виде дизъюнктивной нормальной формы (ДНФ)', + 'dnf_types_description' => 'ДНФ позволяет совместить объединение и пересечение типов, при этом обязательно типы пересечения следует сгруппировать скобками.', + 'null_false_true_types_title' => 'Самостоятельные типы null, false и true', + 'random_title' => 'Новый модуль "Random"', + 'random_description' => '

Модуль "random" предлагает новый объектно-ориентированный API для генерации случайных чисел. Вместо использования глобального генератора случайных чисел (ГСЧ) на базе алгоритма вихря Мерсенна, в объектно-ориентированном API доступно несколько ГСЧ, представленных отдельными классами (как реализации интерфейса Engine), которые хранят внутреннее состояние, позволяя создавать несколько независимых последовательностей случайных чисел.

+

Класс \Random\Randomizer представляет высокоуровневый интерфейс по использованию движков для генерации случайного целого числа, перемешивания массива или строки, выбора случайных ключей массива и многое другое.

', + 'constants_in_traits_title' => 'Константы в трейтах', + 'constants_in_traits_description' => 'Нельзя получить доступ к константе через имя трейта, но можно через класс, который использует этот трейт.', + 'deprecate_dynamic_properties_title' => 'Динамические свойства объявлены устаревшими', + 'deprecate_dynamic_properties_description' => '

Чтобы помочь избежать ошибок и опечаток, больше не рекомендуется определять динамические свойства, только если сам класс явно не разрешит это при помощи атрибута #[\AllowDynamicProperties]. В экземплярах stdClass по-прежнему можно использовать динамические свойства.

+

Это изменение не влияет на использование магических методов __get/__set.

', + 'new_classes_title' => 'Новые классы, интерфейсы и функции', + 'new_mysqli' => 'Новая функция mysqli_execute_query и метод mysqli::execute_query.', + 'new_attributes' => 'Новые атрибуты #[\AllowDynamicProperties] и #[\SensitiveParameter].', + 'new_zip' => 'Новые методы ZipArchive::getStreamIndex, ZipArchive::getStreamName и ZipArchive::clearError.', + 'new_reflection' => 'Новые методы ReflectionFunction::isAnonymous и ReflectionMethod::hasPrototype.', + 'new_functions' => 'Новые функции curl_upkeep, memory_reset_peak_usage, ini_parse_quantity, libxml_get_external_entity_loader, sodium_crypto_stream_xchacha20_xor_ic, openssl_cipher_key_length.', + 'bc_title' => 'Устаревшая функциональность и изменения в обратной совместимости', + 'bc_string_interpolation' => 'Интерполяции строк вида ${} следует избегать.', + 'bc_utf8' => 'Не рекомендуется использовать функции utf8_encode и utf8_decode.', + 'bc_datetime' => 'У методов DateTime::createFromImmutable и DateTimeImmutable::createFromMutable задан предварительный тип возвращаемого значения static.', + 'bc_odbc' => 'Модули ODBC и PDO_ODBC экранирует имя пользователя и пароль.', + 'bc_str_locale_sensitive' => 'При работе функции strtolower и strtoupper теперь не учитывают локаль.', + 'bc_spl_enforces_signature' => 'Методы SplFileObject::getCsvControl, SplFileObject::fflush, SplFileObject::ftell, SplFileObject::fgetc и SplFileObject::fpassthru усиливают свою сигнатуру.', + 'bc_spl_false' => 'У метода SplFileObject::hasChildren предварительный тип возвращаемого значения задан как false.', + 'bc_spl_null' => 'У метода SplFileObject::getChildren предварительный тип возвращаемого значения задан как null.', + 'bc_spl_deprecated' => 'Внутренний метод SplFileInfo::_bad_state_ex объявлен устаревшим.', + 'footer_title' => 'Выше производительность, лучше синтаксис, надёжнее система типов.', + 'footer_description' => '

Для загрузки исходного кода PHP 8.2 посетите страницу Downloads. Бинарные файлы Windows находятся на сайте PHP for Windows. Список изменений перечислен на странице ChangeLog.

+

Руководство по миграции доступно в разделе документации. Ознакомьтесь с ним, чтобы узнать обо всех новых возможностях и изменениях, затрагивающих обратную совместимость.

', +]; diff --git a/releases/8.2/release.inc b/releases/8.2/release.inc new file mode 100644 index 0000000000..dcab6314fb --- /dev/null +++ b/releases/8.2/release.inc @@ -0,0 +1,426 @@ + +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+

+ + RFC + +

+
+
+
PHP < 8.2
+
+ title = $title; + $this->status = $status; + } +} +PHP + + ); ?> +
+
+
+
+
PHP 8.2
+
+ title = $title; + $this->status = $status; + } +} +PHP + ); ?> +
+
+
+
+ +
+

+ + RFC + +

+
+
+
PHP < 8.2
+
+ +
+
+
+
+
PHP 8.2
+
+ +
+
+
+
+
+ +
+ +
+

+ + RFC + RFC +

+
+
+
PHP < 8.2
+
+ +
+
+
+
+
PHP 8.2
+
+ +
+
+
+
+ +
+

+ + RFC + RFC + +

+
+
+
PHP 8.2
+
+ jump(); + + $fibers[] = new Fiber(function () use ($fiberRng, $i): void { + $randomizer = new Randomizer($fiberRng); + + echo "{$i}: " . $randomizer->getInt(0, 100), PHP_EOL; + }); +} + +// The randomizer will use a CSPRNG by default. +$randomizer = new Randomizer(); + +// Even though the fibers execute in a random order, they will print the same value +// each time, because each has its own unique instance of the RNG. +$fibers = $randomizer->shuffleArray($fibers); +foreach ($fibers as $fiber) { + $fiber->start(); +} +PHP + ); ?> +
+
+
+
+
+ +
+ +
+

+ + RFC + +

+
+
+
PHP < 8.2
+
+ +
+
+
+
+
PHP 8.2
+
+ +
+
+
+
+
+ +
+ +
+

+ + RFC + +

+
+
+
PHP < 8.2
+
+ last_name = 'Doe'; + +$user = new stdClass(); +$user->last_name = 'Doe'; +PHP + + ); ?> +
+
+
+
+
PHP 8.2
+
+ last_name = 'Doe'; // Deprecated notice + +$user = new stdClass(); +$user->last_name = 'Doe'; // Still allowed +PHP + ); ?> +
+
+
+
+
+ +
+ +
+ +
+
+

+
+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+ +
+

+
+
    +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
  • +
+
+
+
+ + + +