Repository navigation
[WIP] PHP 8.6 release page #2030
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
base: master
Are you sure you want to change the base?
Changes from all commits
fc8d7ca
3bb614f
bed1b89
9048311
a5c1a6e
022802d
284f24a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace releases\php86; | ||
|
|
||
| require_once __DIR__ . '/../../../include/prepend.inc'; | ||
|
|
||
| const LANGUAGES = [ | ||
| 'en' => 'English', | ||
| ]; | ||
|
|
||
| function common_header(string $description): void { | ||
| global $MYSITE, $lang; | ||
|
|
||
| $meta_image_path = \htmlspecialchars( | ||
| \filter_var($MYSITE . 'images/php8/php_8_6_released.png', \FILTER_VALIDATE_URL)); | ||
| $meta_description = \htmlspecialchars($description); | ||
|
|
||
| $languages = []; | ||
| foreach (LANGUAGES as $code => $text) { | ||
| $languages[] = ['name' => $text, 'selected' => $lang === $code, 'url' => '/releases/8.6/' . $code . '.php']; | ||
| } | ||
|
|
||
| \site_header("PHP 8.6 Release Announcement", [ | ||
| 'current' => 'php85', | ||
| 'css' => ['php85.css'], | ||
| 'language_switcher' => $languages, | ||
| 'theme_switcher' => true, | ||
| '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.6 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.6 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 message($code, $language = 'en', array $interpolations = []): string | ||
|
Check failure on line 48 in public/releases/8.6/common.php
|
||
| { | ||
| $original = require __DIR__ . '/languages/en.php'; | ||
| if (($language !== 'en') && file_exists(__DIR__ . '/languages/' . $language . '.php')) { | ||
| $translation = require __DIR__ . '/languages/' . $language . '.php'; | ||
| } | ||
|
|
||
| $message = $translation[$code] ?? $original[$code] ?? $code; | ||
|
|
||
| foreach ($interpolations as $name => $value) { | ||
| $message = str_replace("{{$name}}", $value, $message); | ||
| } | ||
|
|
||
| return $message; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?php | ||
|
|
||
| $lang = 'en'; | ||
|
|
||
| require_once __DIR__ . '/release.inc'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <?php | ||
|
|
||
| use phpweb\LangChooser; | ||
| use const releases\php86\LANGUAGES; | ||
|
|
||
| $_SERVER['BASE_PAGE'] = 'releases/8.6/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.6/$lang.php"); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| <?php | ||
|
|
||
| return [ | ||
| 'common_header' => 'PHP 8.6 is a major update of the PHP language, with new features including Partial Function Application, a new Duration class, a Polling API, and a new clamp() function', | ||
| 'main_title' => 'Smarter, Faster, Built for Tomorrow.', | ||
| 'main_subtitle' => '<p xmlns="http://www.w3.org/1999/html"><strong>PHP 8.6 is a major update of the PHP language</strong>, with new features including <strong>Partial Function Application</strong>, a new <strong>Duration</strong> class, a <strong>Polling API</strong>, and a new <strong>clamp()</strong> function</p>', | ||
|
|
||
| 'whats_new' => 'What\'s new in 8.6', | ||
| 'upgrade_now' => 'Upgrade to PHP 8.6', | ||
| 'old_version' => 'PHP 8.5 and older', | ||
| 'badge_new' => 'NEW', | ||
| 'documentation' => 'Doc', | ||
| 'released' => 'Released Nov 19, 2026', | ||
| 'key_features' => 'Key Features in PHP 8.6', | ||
| 'key_features_description' => '<p><strong>Faster</strong>, <strong>cleaner</strong>, and <strong>built for developers</strong>.</p>', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we avoid putting the |
||
|
|
||
| 'features_pfa_description' => '<p>Allows functions to be called with only a subset of the required parameters, deferring the passing of the remaining ones to a later time.</p>', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this description is wrong - functions are not called with a subset of the required parameters, rather a subset of parameters is specified and the call is delayed until the remaining ones are provided |
||
| 'features_readonly_property_defaults_description' => '<p>Allows default values for instance readonly properties.</p>', | ||
| 'features_polling_api_description' => '<p>The new API is available at the user-code level, allowing low-level frameworks such as ReactPHP or Amp to utilize it.</p>', | ||
| 'features_clamp_description' => '<p>Ensures that a given value (numeric or otherwise) falls within a specified range.</p>', | ||
| 'features_duration_description' => '<p>Represents a duration of time.</p>', | ||
| 'features_sort_direction_description' => '<p>Represents possible sort directions.</p>', | ||
|
|
||
| 'pfa_title' => 'Partial Function Application', | ||
| 'pfa_description' => 'Allows functions to be called with only a subset of the required parameters, deferring the passing of the remaining ones to a later time.', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any expected difference between this and Not repeating my comments on the various
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’ve separated these into two different language keys, because the If the wording ends up being the same, we can always merge them. |
||
| 'readonly_property_defaults_title' => 'Readonly property defaults', | ||
| 'readonly_property_defaults_description' => 'Allows default values for instance readonly properties.', | ||
| 'polling_api_title' => 'Polling API', | ||
| 'polling_api_description' => 'The new API is available at the user-code level, allowing low-level frameworks such as ReactPHP or Amp to utilize it.', | ||
| 'clamp_title' => 'New <code>clamp()</code> function', | ||
| 'clamp_description' => 'Ensures that a given value (numeric or otherwise) falls within a specified range. Otherwise, the nearest boundary value is returned.', | ||
| 'duration_title' => 'New <code>\Time\Duration</code> class', | ||
| 'duration_description' => 'Represents a duration of time.', | ||
| 'sort_direction_title' => 'New <code>SortDirection</code> enum', | ||
| 'sort_direction_description' => 'Represents a sort directions.', | ||
| 'stream_error_handling_title' => 'Stream Error Handling', | ||
| 'stream_error_handling_description' => 'TODO.', | ||
| 'doc_comments_title' => 'DocComments For Function Parameters', | ||
| 'doc_comments_description' => 'TODO.', | ||
| 'isreadable_iswriteable_title' => 'New <code>ReflectionProperty::isReadable()</code> and <code>ReflectionProperty::isWritable()</code> methods', | ||
| 'isreadable_iswriteable_description' => 'TODO.', | ||
|
|
||
| 'new_classes_title' => 'Additional features and improvements', | ||
| 'new_uri' => 'New <code>Uri\Rfc3986\Uri::getUriType()</code>, <code>Uri\WhatWg\Url::isSpecialScheme()</code>, <code>Uri\Rfc3986\Uri::getHostType()</code>, and <code>Uri\WhatWg\Url::getHostType()</code> methods.', | ||
| 'new_gmp' => 'New <code>gmp_powm_sec()</code> and <code>gmp_prevprime()</code> functions.', | ||
| 'new_intl' => 'New <code>grapheme_strrev()</code> function, and <code>IntlDatePatternGenerator::getSkeleton()</code>, <code>IntlDatePatternGenerator::getBaseSkeleton()</code>, <code>Locale::getDisplayKeyword()</code>, <code>Locale::getDisplayKeywordValue()</code>, <code>SpoofChecker::areBidiConfusable()</code>, <code>SpoofChecker::getBidiSkeleton()</code>, <code>SpoofChecker::getSkeleton()</code> methods.', | ||
| 'new_mysqli' => 'New <code>mysqli::quote_string()</code> method and <code>mysqli_quote_string()</code> function.', | ||
| 'new_reflection' => 'New <code>ReflectionConstant::inNamespace()</code>, <code>ReflectionAttribute::inNamespace()</code>, <code>ReflectionAttribute::getNamespaceName()</code>, and <code>ReflectionAttribute::getShortName()</code> methods.', | ||
| 'new_zip' => 'New <code>ZipArchive::openString()</code> and <code>ZipArchive::closeString()</code> methods.', | ||
| 'new_stream' => 'New <code>stream_last_errors()</code> and <code>stream_clear_errors()</code> functions.', | ||
|
|
||
| 'bc_title' => 'Deprecations and backward compatibility breaks', | ||
| 'deprecated_mysqli' => 'The <code>mysqli_get_charset()</code> function and <code>mysqli::get_charset()</code> method are now deprecated.', | ||
| 'deprecated_spl' => 'The <code>spl_classes()</code>, <code>spl_object_hash()</code> functions, and various <code>ArrayIterator</code> and <code>SplFileObject</code> methods are now deprecated.', | ||
| 'deprecated_standard' => 'The <code>metaphone()</code>, <code>is_double()</code>, <code>is_long()</code>, <code>is_integer()</code>, <code>doubleval()</code>, and <code>strcoll()</code> functions are now deprecated.', | ||
| 'deprecated_date' => 'The <code>DateTime::createFromInterface()</code>, <code>DateTimeImmutable::__set_state()</code>, <code>DateTimeImmutable::modify()</code>, <code>DateTimeImmutable::add()</code>, <code>DateTimeImmutable::sub()</code>, <code>DateTimeImmutable::setTimezone()</code>, <code>DateTimeImmutable::setTime()</code>, <code>DateTimeImmutable::setDate()</code>, <code>DateTimeImmutable::setISODate()</code>, <code>DateTimeImmutable::setTimestamp()</code>, <code>DateTimeImmutable::createFromInterface()</code>, <code>DateTimeZone::__set_state()</code>, <code>DateInterval::__set_state()</code>, <code>DatePeriod::__set_state()</code> methods now have tentative static return types.', | ||
|
|
||
| 'footer_title' => 'Better syntax, improved performance and type safety.', | ||
| 'footer_description' => '<p class="first-paragraph">The full list of changes is recorded in the <a href="/ChangeLog-8.php#PHP_8_6" target="_blank">ChangeLog</a>.</p><p>Please consult the <a href="/manual/en/migration86.php" target="_blank">migration guide</a> for a detailed list of new features and backward-incompatible changes.</p>', | ||
| ]; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these meant to say 8.5 for
currentand for thecss?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
css— includes the necessary files,current— adds a css class to the current page