-
Notifications
You must be signed in to change notification settings - Fork 600
PHP 8.5 release page #1454
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.5 release page #1454
Changes from 15 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
2614191
Add PHP 8.5 release page
saundefined ec7b3ef
wip
saundefined 5fc81d6
wip
saundefined 1027001
Apply suggestions from code review
saundefined 4c0fe2b
wip
saundefined 6e7045f
wip
saundefined b655856
Apply suggestions from code review
saundefined 7301dd8
Apply suggestions from code review
saundefined d525379
cs
saundefined 9d16f51
Apply suggestions from code review
saundefined 2562983
Update releases/8.5/languages/en.php
saundefined 4ddd043
Apply suggestions from code review
saundefined e337dae
Apply suggestions from code review
saundefined eac11c7
Revamp PHP 8.5 examples and content (#31)
theodorejb 0f13eb7
Move Pipe Operator after URI Extension and use more realistic `array_…
theodorejb f3a3090
Apply suggestions from code review
saundefined ab0979a
Update deprecations and BC breaks and extract strings for translation…
theodorejb 021bc8d
Starting new design
saundefined f7a76ae
nits
saundefined f68b9f3
add language chooser
saundefined 33f87da
Fix wording
saundefined 84ad5d0
Apply suggestions from code review
saundefined 2c3e7d6
Add Russian
saundefined 00e5f99
Fix features grid
saundefined 50642ad
nits
saundefined 3a81462
Apply suggestions from code review
saundefined 9e1fe23
Add assets
saundefined 396af65
Fix css for headsup
saundefined 71aa8d4
replace footer with new design
saundefined 348a3fb
Fix language switcher
saundefined 5441837
Fix search
saundefined 7affbc1
Update highlight and examples
saundefined 5c070f5
Fix description align to left
saundefined 84908db
Apply suggestions from code review
saundefined d206e8f
Apply suggestions from code review
saundefined 810c742
Fix sort of features
saundefined 90324a2
Copy to clipboard removed in favor of Prism
saundefined 57587a3
Theme switcher moved to common.js
saundefined b74bf43
Wording
saundefined 615c5ad
nits
saundefined 87207d2
nits
saundefined e26adb1
nits
saundefined 363399a
nits
saundefined 58f0b35
nits
saundefined 2ece98a
nits
saundefined a78a496
Fix missing noise background (#34)
theodorejb b31ceba
nits
saundefined edd3f3d
Wording
saundefined 4003b14
Wording
saundefined 84ffb85
Fix theme switcher
saundefined 1536c3f
Add anchors to titles
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
Some comments aren't visible on the classic Files Changed page.
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.
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,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; | ||
| } |
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,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"); |
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,31 @@ | ||
| <?php | ||
|
|
||
| return [ | ||
| 'common_header' => 'PHP 8.5 is a major update of the PHP language, with new features including the Pipe Operator, URI extension, and support for modifying properties while cloning.', | ||
saundefined marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 'documentation' => 'Doc', | ||
| 'main_title' => 'Released!', | ||
| 'main_subtitle' => 'PHP 8.5 is a major update of the PHP language, with new features including the Pipe Operator, URI extension, and support for modifying properties while cloning.', | ||
| 'upgrade_now' => 'Upgrade to PHP 8.5', | ||
|
|
||
| 'pipe_operator_title' => 'Pipe Operator', | ||
| 'pipe_operator_description' => '<p>The pipe operator allows chaining function calls together without dealing with intermediary variables. This enables replacing many "nested calls" with a chain that can be read forwards, rather than inside-out.</p><p>Learn more about the backstory of this feature in <a href="https://thephp.foundation/blog/2025/07/11/php-85-adds-pipe-operator/" target="_blank" rel="noopener noreferrer">The PHP Foundation’s blog</a>.</p>', | ||
| 'uri_extension_title' => 'URI Extension', | ||
| 'uri_extension_description' => '<p>The new always-available URI extension provides APIs to securely parse and modify URIs and URLs according to the RFC 3986 and the WHATWG URL standards.</p><p>Powered by the <a href="https://uriparser.github.io/">uriparser</a> (RFC 3986) and <a href="https://lexbor.com/">Lexbor</a> (WHATWG URL) libraries.</p><p>Learn more about the backstory of this feature in <a href="https://thephp.foundation/blog/2025/10/10/php-85-uri-extension/" target="_blank" rel="noopener noreferrer">The PHP Foundation’s blog</a>.</p>', | ||
| 'clone_with_title' => 'Clone With', | ||
| 'clone_with_description' => 'It is now possible to update properties during object cloning by passing an associative array to the <code>clone()</code> function. This enables straightforward support of the "with-er" pattern for <code>readonly</code> classes.', | ||
| 'no_discard_title' => '<code>#[\NoDiscard]</code> Attribute', | ||
| 'no_discard_description' => '<p>By adding the <code>#[\NoDiscard]</code> attribute to a function, PHP will check whether the returned value is consumed and emit a warning if it is not. This allows improving the safety of APIs where the returned value is important, but it\'s easy to forget using the return value by accident.</p><p>The associated <code>(void)</code> cast can be used to indicate that a value is intentionally unused.</p>', | ||
| 'array_first_last_title' => '<code>array_first()</code> and <code>array_last()</code> functions', | ||
| 'fcc_in_const_expr_title' => 'Closures and First-Class Callables in Constant Expressions', | ||
| 'fcc_in_const_expr_description' => 'Static closures and first-class callables can now be used in constant expressions. This includes attribute parameters, default values of properties and parameters, and constants.', | ||
| 'persistent_curl_share_handles_title' => 'Persistent cURL Share Handles', | ||
| 'persistent_curl_share_handles_description' => 'Unlike <code>curl_share_init()</code>, handles created by <code>curl_share_init_persistent()</code> will not be destroyed at the end of the PHP request. If a persistent share handle with the same set of share options is found, it will be reused, avoiding the cost of initializing cURL handles each time.', | ||
|
|
||
| 'new_classes_title' => 'Additional features and improvements', | ||
|
|
||
| 'bc_title' => 'Deprecations and backward compatibility breaks', | ||
|
|
||
| 'footer_title' => 'Better syntax, improved performance and type safety.', | ||
| 'footer_description' => '<p>The full list of changes is recorded in the <a href="/ChangeLog-8.php#PHP_8_5">ChangeLog</a>.</p> | ||
| <p>Please consult the <a href="/manual/en/migration85.php">Migration Guide</a> for a detailed list of new features and backward-incompatible changes.</p>', | ||
| ]; | ||
Oops, something went wrong.
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.