Author: Sergey Panteleev (saundefined) Date: 2025-09-25T19:18:38+03:00 Commit: https://github.com/php/web-php/commit/26141911a34f3d65a89d43d67679a157b6b39663 Raw diff: https://github.com/php/web-php/commit/26141911a34f3d65a89d43d67679a157b6b39663.diff
Add PHP 8.5 release page Changed paths: A images/php8/logo_php8_5.svg A releases/8.5/common.php A releases/8.5/en.php A releases/8.5/index.php A releases/8.5/languages/en.php A releases/8.5/release.inc Diff: diff --git a/images/php8/logo_php8_5.svg b/images/php8/logo_php8_5.svg new file mode 100644 index 0000000000..befa8d9efe --- /dev/null +++ b/images/php8/logo_php8_5.svg @@ -0,0 +1,9 @@ +<svg width="467" height="133" viewBox="0 0 467 133" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path fill-rule="evenodd" clip-rule="evenodd" d="M21.7998 125.799H0.799805L19.4998 29.6992H59.7998C71.8998 29.6992 80.7998 32.8992 86.2998 39.1992C91.8998 45.5992 93.4998 54.3992 91.2998 65.8992C90.3998 70.5992 88.7998 74.8992 86.6998 78.7992C84.4998 82.6992 81.6998 86.2992 78.1998 89.4992C73.9998 93.3992 69.3998 96.1992 64.2998 97.8992C59.1998 99.5992 52.6998 100.399 44.6998 100.399H26.6998L21.7998 125.799ZM67.6998 49.1992C64.9998 46.2992 59.6998 44.7992 51.7998 44.7992H37.4998L29.6998 85.0992H42.3998C50.7998 85.0992 57.0998 83.4992 61.2998 80.2992C65.3998 77.0992 68.1998 71.7992 69.6998 64.3992C70.9998 57.1992 70.2998 52.1992 67.6998 49.1992Z" fill="white"/> +<path d="M106.6 4.09961H127.4L122.4 29.6996H140.9C152.6 29.6996 160.6 31.6996 165 35.7996C169.4 39.8996 170.8 46.4996 169 55.5996L160.3 100.4H139.2L147.5 57.7996C148.4 52.9996 148.1 49.6996 146.5 47.8996C144.9 46.0996 141.4 45.2996 136.1 45.2996H119.5L108.8 100.4H87.9004L106.6 4.09961Z" fill="white"/> +<path fill-rule="evenodd" clip-rule="evenodd" d="M185.2 125.799H164.2L182.9 29.6992H223.3C235.4 29.6992 244.3 32.8992 249.8 39.1992C255.4 45.5992 257 54.3992 254.8 65.8992C253.9 70.5992 252.3 74.8992 250.2 78.7992C248 82.6992 245.2 86.2992 241.7 89.4992C237.5 93.3992 232.9 96.1992 227.8 97.8992C222.7 99.5992 216.2 100.399 208.2 100.399H190.2L185.2 125.799ZM231.2 49.1992C228.5 46.2992 223.2 44.7992 215.3 44.7992H200.9L193.1 85.0992H205.8C214.2 85.0992 220.5 83.4992 224.7 80.2992C228.8 77.0992 231.6 71.7992 233.1 64.3992C234.4 57.1992 233.8 52.1992 231.2 49.1992Z" fill="white"/> +<path d="M317.5 48.5C311.8 34.9 307 23.1 311.7 14.9C313.5 12.4 315.5 11.1 317.7 11.1C322.2 11.1 326.3 16 326.3 16L332 22.9L328.4 14.7C328.2 14.4 322.1 0.5 311.2 0.5C307.4 0.5 303.4 2.2 299.5 5.6L299.4 5.7C289.9 16.7 299.2 37.5 307.5 55.8L313.6 70C316.4 77.3 319.2 86 317.5 92.4C314.9 102.4 306 109.2 305.9 109.3L300.2 113.7L307.1 111.5C307.8 111.3 323.1 106.3 326.8 93C329.1 82.1 326.2 71.2 323.3 62.8C323.7 62.5 322.9 63.1 323.3 62.8L318 49.1" fill="white"/> +<path d="M334.4 9.89961L327.3 2.09961L332.4 11.3996C332.5 11.4996 338.7 23.0996 330.8 36.5996C327.9 40.7996 323.4 44.9996 317.7 49.1996L307.4 55.8996C307.3 55.7996 307.3 55.6996 307.4 55.8996L307 56.1996C295.5 62.7996 284.8 66.7996 284.6 66.8996C268.7 73.9996 258.7 84.9996 257.3 97.1996C256.2 106.4 260.5 115.4 268.9 121.7L269 121.8C274.3 125 280 126.6 286 126.6C301.7 126.6 314 115.7 314.5 115.2L322.2 108.3L313.1 113.1C313 113.1 305.4 117.1 297.5 117.1C290.4 117.1 285.4 114 282.4 107.7C278.6 94.2996 291.9 85.0996 307.2 74.4996C309.2 73.0996 311.3 71.5996 313.4 70.1996L313.5 70.0996L322.6 63.2996C322.7 63.0996 323 62.8996 323 62.8996C330.5 56.6996 340.4 46.9996 342.7 33.3996C344.5 21.0996 334.8 10.3996 334.4 9.89961Z" fill="#0F0F0F"/> +<path d="M345.4 83H364.9L361.4 100.7H341.9L345.4 83Z" fill="white"/> +<path d="M375.68 86.24H417.44C419.28 86.32 421.04 86.2 422.72 85.88C424.4 85.48 425.96 84.92 427.4 84.2C428.76 83.48 429.96 82.4 431 80.96C432.04 79.52 432.84 77.72 433.4 75.56C434.04 73.4 434.2 71.6 433.88 70.16C433.64 68.72 433.04 67.64 432.08 66.92C431.04 66.2 429.76 65.68 428.24 65.36C426.8 64.96 425.12 64.76 423.2 64.76L381.56 64.64L394.88 14.84H466.52L462.56 29.6H410L404.6 49.88H435.44C439.44 49.96 442.88 50.56 445.76 51.68C448.64 52.8 450.96 54.44 452.72 56.6C454.48 58.76 455.52 61.44 455.84 64.64C456.16 67.76 455.76 71.4 454.64 75.56C453.36 80.36 451.52 84.44 449.12 87.8C446.8 91.08 444 93.64 440.72 95.48C437.36 97.32 433.76 98.72 429.92 99.68C426.08 100.56 422 101 417.68 101H371.84L375.68 86.24Z" fill="white"/> +</svg> diff --git a/releases/8.5/common.php b/releases/8.5/common.php new file mode 100644 index 0000000000..ef05a2a1fb --- /dev/null +++ b/releases/8.5/common.php @@ -0,0 +1,70 @@ +<?php + +declare(strict_types=1); + +namespace releases\php85; + +include_once __DIR__ . '/../../include/prepend.inc'; + +const LANGUAGES = [ + 'en' => 'English', +]; + +function common_header(string $description): void { + global $MYSITE; + + $meta_image_path = \htmlspecialchars( + \filter_var($MYSITE . 'images/php8/php_8_5_released.png', \FILTER_VALIDATE_URL)); + $meta_description = \htmlspecialchars($description); + + \site_header("PHP 8.5 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.5 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.5 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 { + // 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; +} diff --git a/releases/8.5/en.php b/releases/8.5/en.php new file mode 100644 index 0000000000..7ff380e63b --- /dev/null +++ b/releases/8.5/en.php @@ -0,0 +1,5 @@ +<?php + +$lang = 'en'; + +include_once __DIR__ . '/release.inc'; diff --git a/releases/8.5/index.php b/releases/8.5/index.php new file mode 100644 index 0000000000..6ff070ee85 --- /dev/null +++ b/releases/8.5/index.php @@ -0,0 +1,13 @@ +<?php + +use phpweb\LangChooser; +use const releases\php85\LANGUAGES; + +$_SERVER['BASE_PAGE'] = 'releases/8.5/index.php'; +require_once __DIR__ . '/common.php'; +require_once __DIR__ . '/../../src/autoload.php'; + +$langChooser = new LangChooser(LANGUAGES, [], "", ""); +[$lang,] = $langChooser->chooseCode("", "", $_SERVER['HTTP_ACCEPT_LANGUAGE']); + +mirror_redirect("/releases/8.5/$lang.php"); diff --git a/releases/8.5/languages/en.php b/releases/8.5/languages/en.php new file mode 100644 index 0000000000..bb9fa77208 --- /dev/null +++ b/releases/8.5/languages/en.php @@ -0,0 +1,23 @@ +<?php + +return [ + 'common_header' => 'PHP 8.5 is a major update of the PHP language. It contains many new features, such as Pipe operator, Final Property Promotion, Attributes on Constants, performance improvements, bug fixes, and general cleanup.', + 'documentation' => 'Doc', + 'main_title' => 'Released!', + 'main_subtitle' => 'PHP 8.5 is a major update of the PHP language.<br class="display-none-md"> It contains many new features, such as Pipe operator, Final Property Promotion, Attributes on Constants, performance improvements, bug fixes, and general cleanup.', + 'upgrade_now' => 'Upgrade to PHP 8.5 now!', + + 'pipe_operator_title' => 'Pipe operator', + 'url_parsing_api_title' => 'Add RFC 3986 and WHATWG URL compliant API', + 'url_parsing_api_description' => '<code>Uri\UriException</code>, <code>Uri\InvalidUriException</code>, <code>Uri\UriComparisonMode</code>, + <code>Uri\Rfc3986\Uri</code>, <code>Uri\WhatWg\InvalidUrlException</code>, <code>Uri\WhatWg\UrlValidationErrorType</code>, <code>Uri\WhatWg\UrlValidationError</code>, and <code>Uri\WhatWg\Url</code> are now available.', + + 'new_classes_title' => 'New Classes, Interfaces, and Functions', + 'new_core_attributes' => '<code>#[\NoDiscard]</code> and <code>#[\DelayedTargetValidation]</code> attributes', + + 'bc_title' => 'Deprecations and backward compatibility breaks', + + 'footer_title' => 'Better performance, better syntax, improved type safety.', + 'footer_description' => '<p>For source downloads of PHP 8.5 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_5">ChangeLog</a>.</p> + <p>The <a href="/manual/en/migration85.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>', +]; diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc new file mode 100644 index 0000000000..4afcc2449a --- /dev/null +++ b/releases/8.5/release.inc @@ -0,0 +1,154 @@ +<?php + +use function releases\php85\common_header;use function releases\php85\language_chooser;use function releases\php85\message; + +if (!isset($lang)) { + $lang = 'en'; +} +if (!isset($documentation)) { + $documentation = $lang; +} + +$_SERVER['BASE_PAGE'] = 'releases/8.5/' . $lang . '.php'; + +include_once __DIR__ . '/common.php'; + +common_header(message('common_header', $lang)); + +?> + <section class="php8-section php8-section_dark php8-section_header center"> + <div class="page-tools"> + <div class="change-language"> + <?php language_chooser($lang); ?> + </div> + </div> + <div class="php8-section__content"> + <div class="php8-logo"> + <img src="/images/php8/logo_php8_5.svg" alt="PHP 8.5" height="126" width="343"> + </div> + <div class="php8-title"><?= message('main_title', $lang) ?></div> + <div class="php8-subtitle"><?= message('main_subtitle', $lang) ?></div> + <div class="php8-button-wrapper center"> + <a class="php8-button php8-button_light" href="/downloads"><?= message('upgrade_now', $lang) ?></a> + </div> + </div> + </section> + + <section class="php8-section center"> + <div class="php8-compare"> + <h2 class="php8-h2" id="property_hooks"> + <?= message('pipe_operator_title', $lang) ?> + <a class="php8-rfc" href="https://wiki.php.net/rfc/pipe-operator-v3">RFC</a> + </h2> + <div class="php8-compare__main"> + <div class="php8-compare__block example-contents"> + <div class="php8-compare__label">PHP < 8.5</div> + <div class="php8-code phpcode"> + <?php highlight_php_trimmed( + <<<'PHP' +$input = ' Some kind of string. '; + +$output = strtolower( + str_replace(['.', '/', '…'], '', + str_replace(' ', '-', + trim($input) + ) + ) +); +PHP + + ); ?> + </div> + </div> + <div class="php8-compare__arrow"></div> + <div class="php8-compare__block example-contents" style="display: table;"> + <div class="php8-compare__label php8-compare__label_new">PHP 8.5</div> + <div class="php8-code phpcode" style="display: table-cell;"> + <?php highlight_php_trimmed( + <<<'PHP' +$input = ' Some kind of string. '; + +$output = $input + |> trim(...) + |> fn (string $string) => str_replace(' ', '-', $string) + |> fn (string $string) => str_replace(['.', '/', '…'], '', $string) + |> strtolower(...); +PHP + ); ?> + </div> + </div> + </div> + </div> + + <div class="php8-compare"> + <h2 class="php8-h2" id="property_hooks"> + <?= message('url_parsing_api_title', $lang) ?> + <a class="php8-rfc" href="https://wiki.php.net/rfc/url_parsing_api">RFC</a> + </h2> + <div class="php8-compare__main"> + <div class="php8-compare__block example-contents"> + <div class="php8-compare__label">PHP < 8.5</div> + <div class="php8-code phpcode"> + <?php highlight_php_trimmed( + <<<'PHP' +$components = parse_url("https://php.net/releases/8.5/en.php"); + +var_dump($components['host']); // string(7) "php.net" +PHP + + ); ?> + </div> + </div> + <div class="php8-compare__arrow"></div> + <div class="php8-compare__block example-contents" style="display: table;"> + <div class="php8-compare__label php8-compare__label_new">PHP 8.5</div> + <div class="php8-code phpcode" style="display: table-cell;"> + <?php highlight_php_trimmed( + <<<'PHP' +$uri = new Uri\Rfc3986\Uri("https://php.net/releases/8.5/en.php"); + +var_dump($uri->getHost()); // string(7) "php.net" +PHP + ); ?> + </div> + </div> + </div> + <div class="php8-compare__content"> + <?= message('url_parsing_api_description', $lang) ?> + </div> + </div> + </section> + + <section class="php8-section center php8-section_light php8-columns"> + <div class="php8-column"> + <h2 class="php8-h2" id="other_new_things"><?= message('new_classes_title', $lang) ?></h2> + <div class="php8-compare__content php8-compare__content--block"> + <ul> + + </ul> + </div> + </div> + + <div class="php8-column"> + <h2 class="php8-h2" id="deprecations_and_bc_breaks"><?= message('bc_title', $lang) ?></h2> + <div class="php8-compare__content"> + <ul> + + </ul> + </div> + </div> + </section> + + <section class="php8-section php8-section_dark php8-section_footer php8-footer"> + <div class="php8-section__content"> + <h2 class="php8-h2 center"><?= message('footer_title', $lang) ?></h2> + <div class="php8-button-wrapper center"> + <a class="php8-button php8-button_light" href="/downloads"><?= message('upgrade_now', $lang) ?></a> + </div> + <div class="php8-footer__content"><?= message('footer_description', $lang) ?></div> + </div> + </section> + +<?php + +site_footer();
