Skip to content

Commit eac11c7

Browse files
authored
Revamp PHP 8.5 examples and content (#31)
* Simplified header and footer text. * Moved Pipe Operator example to the top and simplified the code and description slightly. * Made the URI Extension description less wordy. * Replaced the *Clone With* example to have a realistic before/after class (rather than a fatal error in the before example). * Greatly simplified the `array_first()` example and moved it to after the `#[\NoDiscard]` attribute. * Replaced the *Closures and First Class Callables in Constant Expressions* example with a couple self-contained functions highlighting the new syntax (rather than a complex test which isn't even supported in PHPUnit). Also added a description. * Shortened and clarified the *Persistent cURL Share Handles* example and added a more helpful description. * Filled out the *Deprecations and backward compatibility breaks* section. * Replaced *New Classes, Interfaces, and Functions* section with a more relevant *Additional features and improvements* section (mentioning that fatal errors now include a backtrace, that `setcookie()` and `setrawcookie()` now support the "partitioned" key, and clarifying some of the other new functions/features).
1 parent e337dae commit eac11c7

File tree

2 files changed

+197
-229
lines changed

2 files changed

+197
-229
lines changed

releases/8.5/languages/en.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
<?php
22

33
return [
4-
'common_header' => 'PHP 8.5 is a major update of the PHP language. It contains many new features, such as the new URI extension, support for modifying properties while cloning, the Pipe operator, performance improvements, bug fixes, and general cleanup.',
4+
'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.',
55
'documentation' => 'Doc',
66
'main_title' => 'Released!',
7-
'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 the new URI extension, support for modifying properties while cloning, the Pipe operator, performance improvements, bug fixes, and general cleanup.',
8-
'upgrade_now' => 'Upgrade to PHP 8.5 now!',
7+
'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.',
8+
'upgrade_now' => 'Upgrade to PHP 8.5',
99

1010
'pipe_operator_title' => 'Pipe Operator',
11-
'pipe_operator_description' => '<p>The pipe operator allows chaining function calls together without dealing with intermediary variables. That can be especially helpful when 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>',
12-
'url_parsing_api_title' => 'New URI Extension',
13-
'url_parsing_api_description' => '<p>As an always-available part of PHP\'s standard library the new URI extension provides APIs to parse and modify URIs and URLs according to the RFC 3986 and the WHATWG URL standards.</p><p>The secure and standards-compliant URI parsing is 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>',
11+
'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>',
12+
'uri_extension_title' => 'URI Extension',
13+
'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>',
1414
'clone_with_title' => 'Clone With',
15-
'clone_with_description' => 'It is now possible to update properties during object cloning by passing an associative array with the updated to the <code>clone()</code> function. This enables straight-forward support of the "with-er" pattern for <code>readonly</code> classes.',
15+
'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.',
1616
'no_discard_title' => '<code>#[\NoDiscard]</code> Attribute',
17-
'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 to improve the safety of APIs where the returned value is important, but where it is 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>',
18-
'fcc_in_const_expr_title' => 'Closures and First Class Callables in Constant Expressions',
19-
'curl_share_persistence_improvement_title' => 'Persistent cURL Share Handles',
20-
'array_first_last_title' => 'New <code>array_first()</code> and <code>array_last()</code> functions',
17+
'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>',
18+
'array_first_last_title' => '<code>array_first()</code> and <code>array_last()</code> functions',
19+
'fcc_in_const_expr_title' => 'Closures and First-Class Callables in Constant Expressions',
20+
'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.',
21+
'persistent_curl_share_handles_title' => 'Persistent cURL Share Handles',
22+
'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.',
2123

22-
'new_classes_title' => 'New Classes, Interfaces, and Functions',
24+
'new_classes_title' => 'Additional features and improvements',
2325

2426
'bc_title' => 'Deprecations and backward compatibility breaks',
2527

26-
'footer_title' => 'Better performance, better syntax, improved type safety.',
27-
'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>
28-
<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>',
28+
'footer_title' => 'Better syntax, improved performance and type safety.',
29+
'footer_description' => '<p>The full list of changes is recorded in the <a href="/ChangeLog-8.php#PHP_8_5">ChangeLog</a>.</p>
30+
<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>',
2931
];

0 commit comments

Comments
 (0)