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/include/header.inc b/include/header.inc index cce62a85ed..f6568ad1fd 100644 --- a/include/header.inc +++ b/include/header.inc @@ -105,8 +105,8 @@ if (!isset($config["languages"])) {
  • ">Get Involved
  • ">Help
  • "> - - php8.1 + + php8.2
  • diff --git a/index.php b/index.php index 6248628818..1c21ad5382 100644 --- a/index.php +++ b/index.php @@ -95,7 +95,7 @@

    A popular general-purpose scripting language that is especially suited to web development.
    Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

    - What's new in 8.1 + What's new in 8.2 Download
    EOF; diff --git a/releases/8.2/common.php b/releases/8.2/common.php new file mode 100644 index 0000000000..0c4e8bd99b --- /dev/null +++ b/releases/8.2/common.php @@ -0,0 +1,74 @@ + 'php8', + 'css' => ['php8.css'], + 'meta_tags' => << + + + + + + + + + + + + +META + ]); +} + +function language_chooser(string $currentLang): void { + $LANGUAGES = [ + 'en' => 'English', + ]; + + // 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', +]; diff --git a/releases/8.2/release.inc b/releases/8.2/release.inc new file mode 100644 index 0000000000..2391ac36f6 --- /dev/null +++ b/releases/8.2/release.inc @@ -0,0 +1,460 @@ + +
    +
    +
    + +
    +
    +
    + +
    Released!
    +
    + 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 +
    + +
    +
    + +
    +
    +

    + Readonly classes + RFC +

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

    + Allow null, false, and true as stand-alone types + RFC + RFC +

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

    + Disjunctive Normal Form Types + RFC +

    +
    +
    +
    PHP < 8.2
    +
    + +
    +
    +
    +
    +
    PHP 8.2
    +
    + +
    +
    +
    +
    +
    + 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. +
    + +
    +

    + Deprecate dynamic properties + RFC +

    +
    +
    +
    PHP < 8.2
    +
    + last_name = 'Doe'; +PHP + + ); ?> +
    +
    +
    +
    +
    PHP 8.2
    +
    + last_name = 'Doe'; // Deprecated notice +PHP + ); ?> +
    +
    +
    +
    +
    + You can use the #[AllowDynamicProperties] attribute on classes that should still allow those + properties. +
    + +
    +

    + Constants in traits + RFC +

    +
    +
    +
    PHP < 8.2
    +
    + +
    +
    +
    +
    +
    PHP 8.2
    +
    + +
    +
    +
    +
    +
    + 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 ${} string interpolation + RFC +

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

    + New Random extension + RFC + RFC +

    +
    +
    +
    PHP < 8.2
    +
    + +
    +
    +
    +
    +
    PHP 8.2
    +
    + pickArrayKeys($array, 1)[0]; // (int) 0 + // or: [$single] = $randomizer->pickArrayKeys($array, 1); +$multiple = $randomizer->pickArrayKeys($array, 2); // (array) [1, 2] +PHP + ); ?> +
    +
    +
    +
    +
    + +
    +
    +

    Performance Improvements

    + +
    + +
    +

    New Classes, Interfaces, and Functions

    +
    +
      +
    • New mysqli_execute_query function and mysqli::execute_query method. +
    • +
    • New #[AllowDynamicProperties] and #[\SensitiveParameter] attributes. +
    • +
    • New curl_upkeep function.
    • +
    • New ZipArchive::getStreamIndex, ZipArchive::getStreamName, and ZipArchive::clearError + methods. +
    • +
    • New memory_reset_peak_usage function.
    • +
    • New sodium_crypto_stream_xchacha20_xor_ic function.
    • +
    +
    +

    + Deprecations and backward compatibility breaks +

    +
    +
      +
    • Deprecated utf8_encode and utf8_decode functions.
    • +
    • Methods DateTime::createFromImmutable and DateTimeImmutable::createFromMutable + has a tentative return type of static. +
    • +
    • Extensions ODBC and PDO_ODBC escapes the username and password.
    • +
    • Functions strtolower and strtoupper are locale-sensitive.
    • +
    • Methods SplFileInfo::_bad_state_ex, SplFileObject::getCsvControl, + SplFileObject::fflush, + SplFileObject::ftell, SplFileObject::fgetc,and SplFileObject::fpassthru + enforces their signature. +
    • +
    • Method SplFileObject::hasChildren has a tentative return type of false. +
    • +
    • Method SplFileObject::getChildren has a tentative return type of null. +
    • +
    +
    +
    +
    + + + +