[PHP-WEBMASTER] [web-php] php-85-focus: wip

Author: Sergey Panteleev (saundefined)
Date: 2025-10-01T13:10:35+03:00

Commit: wip · php/web-php@ec7b3ef · GitHub
Raw diff: https://github.com/php/web-php/commit/ec7b3efb5188537d784dd173a20edc9beb562c8c.diff

wip

Changed paths:
  M releases/8.5/languages/en.php
  M releases/8.5/release.inc

Diff:

diff --git a/releases/8.5/languages/en.php b/releases/8.5/languages/en.php
index bb9fa77208..5d0dca4f36 100644
--- a/releases/8.5/languages/en.php
+++ b/releases/8.5/languages/en.php
@@ -11,9 +11,18 @@
     '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.',
+ 'clone_with_title' => 'Clone with v2',
+ 'no_discard_title' => 'New <code>#[\NoDiscard]</code> Attribute',
+ 'fcc_in_const_expr_title' => 'First Class Callables in constant expressions',
+ 'curl_share_persistence_improvement_title' => 'Persistent cURL share handle improvement',
+ 'array_first_last_title' => 'New <code>array_first()</code> and <code>array_last()</code> functions',
+ 'final_promotion_title' => 'Final Property Promotion',
+ 'attributes_on_constants_title' => 'Attributes on Constants',
+ 'override_properties_title' => 'Attribute <code>#[\Override]</code> extended to target properties',
+ 'static_aviz_title' => 'Asymmetric Visibility for Static Properties',
+ 'deprecated_traits_title' => 'Attribute <code>#[\Deprecated]</code> available for traits',

     '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',

diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc
index 4afcc2449a..94f0f9cedc 100644
--- a/releases/8.5/release.inc
+++ b/releases/8.5/release.inc
@@ -36,7 +36,76 @@ common_header(message('common_header', $lang));

     <section class="php8-section center">
         <div class="php8-compare">
- <h2 class="php8-h2" id="property_hooks">
+ <h2 class="php8-h2" id="url_parsing_api">
+ <?= message('url_parsing_api_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:url_parsing_api;
+ </h2>
+ <div class="php8-compare__main">
+ <div class="php8-compare__block example-contents">
+ <div class="php8-compare__label">PHP &lt; 8.5</div>
+ <div class="php8-code phpcode">
+ <?php highlight_php_trimmed(
+ <<<'PHP'
+$components = parse_url("https://php.net/releases/8.5/en.php&quot;\);
+
+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&quot;\);
+
+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>
+
+ <div class="php8-compare">
+ <h2 class="php8-h2" id="clone_with">
+ <?= message('clone_with_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:clone_with_v2;
+ </h2>
+ <div class="php8-compare__main">
+ <div class="php8-compare__block example-contents">
+ <div class="php8-compare__label">PHP &lt; 8.5</div>
+ <div class="php8-code phpcode">
+ <?php highlight_php_trimmed(
+ <<<'PHP'
+// TODO
+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'
+// TODO
+PHP
+ ); ?>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="php8-compare">
+ <h2 class="php8-h2" id="pipe_operator">
                 <?= message('pipe_operator_title', $lang) ?>
                 <a class="php8-rfc" href="PHP: rfc:pipe-operator-v3;
             </h2>
@@ -70,8 +139,8 @@ $input = ' Some kind of string. ';

$output = $input
     |> trim(...)
- |> fn (string $string) => str_replace(' ', '-', $string)
- |> fn (string $string) => str_replace(['.', '/', '…'], '', $string)
+ |> (fn (string $string) => str_replace(' ', '-', $string))
+ |> (fn (string $string) => str_replace(['.', '/', '…'], '', $string))
     |> strtolower(...);
PHP
                         ); ?>
@@ -81,9 +150,9 @@ PHP
         </div>

         <div class="php8-compare">
- <h2 class="php8-h2" id="property_hooks">
- <?= message('url_parsing_api_title', $lang) ?>
- <a class="php8-rfc" href="PHP: rfc:url_parsing_api;
+ <h2 class="php8-h2" id="no_discard">
+ <?= message('no_discard_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:marking_return_value_as_important;
             </h2>
             <div class="php8-compare__main">
                 <div class="php8-compare__block example-contents">
@@ -91,9 +160,38 @@ PHP
                     <div class="php8-code phpcode">
                         <?php highlight_php_trimmed(
                                 <<<'PHP'
-$components = parse_url("https://php.net/releases/8.5/en.php&quot;\);
+// TODO
+PHP

-var_dump($components['host']); // string(7) "php.net"
+ ); ?>
+ </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'
+// TODO
+PHP
+ ); ?>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="php8-compare">
+ <h2 class="php8-h2" id="fcc_in_const_expr">
+ <?= message('fcc_in_const_expr_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:fcc_in_const_expr;
+ </h2>
+ <div class="php8-compare__main">
+ <div class="php8-compare__block example-contents">
+ <div class="php8-compare__label">PHP &lt; 8.5</div>
+ <div class="php8-code phpcode">
+ <?php highlight_php_trimmed(
+ <<<'PHP'
+// TODO
PHP

                         ); ?>
@@ -105,16 +203,306 @@ PHP
                     <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&quot;\);
+// TODO
+PHP
+ ); ?>
+ </div>
+ </div>
+ </div>
+ </div>

-var_dump($uri->getHost()); // string(7) "php.net"
+ <div class="php8-compare">
+ <h2 class="php8-h2" id="curl_share_persistence_improvement">
+ <?= message('curl_share_persistence_improvement_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:curl_share_persistence;
+ <a class="php8-rfc" href="PHP: rfc:curl_share_persistence_improvement;
+ </h2>
+ <div class="php8-compare__main">
+ <div class="php8-compare__block example-contents">
+ <div class="php8-compare__label">PHP &lt; 8.5</div>
+ <div class="php8-code phpcode">
+ <?php highlight_php_trimmed(
+ <<<'PHP'
+// TODO
+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'
+// TODO
PHP
                         ); ?>
                     </div>
                 </div>
             </div>
             <div class="php8-compare__content">
- <?= message('url_parsing_api_description', $lang) ?>
+ New <code>CurlSharePersistentHandle</code> class, <code>curl_multi_get_handles()</code>, <code>curl_share_init_persistent()</code> functions are available.
+ </div>
+ </div>
+
+ <div class="php8-compare">
+ <h2 class="php8-h2" id="array_first_last">
+ <?= message('array_first_last_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:array_first_last;
+ </h2>
+ <div class="php8-compare__main">
+ <div class="php8-compare__block example-contents">
+ <div class="php8-compare__label">PHP &lt; 8.5</div>
+ <div class="php8-code phpcode">
+ <?php highlight_php_trimmed(
+ <<<'PHP'
+$versions = ['PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5'];
+
+var_dump($versions[array_key_first($versions)]); // string(7) "PHP 8.1"
+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'
+$versions = ['PHP 8.1', 'PHP 8.2', 'PHP 8.3', 'PHP 8.4', 'PHP 8.5'];
+
+var_dump(array_first($versions)); // string(7) "PHP 8.1"
+PHP
+ ); ?>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="php8-compare">
+ <h2 class="php8-h2" id="final_promotion">
+ <?= message('final_promotion_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:final_promotion;
+ </h2>
+ <div class="php8-compare__main">
+ <div class="php8-compare__block example-contents">
+ <div class="php8-compare__label">PHP &lt; 8.5</div>
+ <div class="php8-code phpcode">
+ <?php highlight_php_trimmed(
+ <<<'PHP'
+class PhpVersion {
+ public function __construct(
+ final public string $version = 'PHP 8.4'
+ ) {
+
+ }
+}
+
+var_dump(new PhpVersion()->version); // Fatal error: Cannot use the final modifier on a parameter
+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'
+class PhpVersion {
+ public function __construct(
+ final public string $version = 'PHP 8.5'
+ ) {
+
+ }
+}
+
+var_dump(new PhpVersion()->version); // string(7) "PHP 8.5"
+PHP
+ ); ?>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="php8-compare">
+ <h2 class="php8-h2" id="attributes_on_constants">
+ <?= message('attributes_on_constants_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:attributes-on-constants;
+ </h2>
+ <div class="php8-compare__main">
+ <div class="php8-compare__block example-contents">
+ <div class="php8-compare__label">PHP &lt; 8.5</div>
+ <div class="php8-code phpcode">
+ <?php highlight_php_trimmed(
+ <<<'PHP'
+<?php
+
+#[NewFeatures]
+const VERSION = '8.4';
+
+var_dump(VERSION); // Parse error: syntax error, unexpected token "const"
+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'
+<?php
+
+#[NewFeatures]
+const VERSION = '8.5';
+
+var_dump(VERSION); // string(3) "8.5"
+PHP
+ ); ?>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="php8-compare">
+ <h2 class="php8-h2" id="override_properties">
+ <?= message('override_properties_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:override_properties;
+ </h2>
+ <div class="php8-compare__main">
+ <div class="php8-compare__block example-contents">
+ <div class="php8-compare__label">PHP &lt; 8.5</div>
+ <div class="php8-code phpcode">
+ <?php highlight_php_trimmed(
+ <<<'PHP'
+// TODO
+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'
+// TODO
+PHP
+ ); ?>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="php8-compare">
+ <h2 class="php8-h2" id="static_aviz">
+ <?= message('static_aviz_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:static-aviz;
+ </h2>
+ <div class="php8-compare__main">
+ <div class="php8-compare__block example-contents">
+ <div class="php8-compare__label">PHP &lt; 8.5</div>
+ <div class="php8-code phpcode">
+ <?php highlight_php_trimmed(
+ <<<'PHP'
+class PhpVersion
+{
+ private static string $version = '8.4';
+
+ public function getVersion(): string
+ {
+ return self::$version;
+ }
+
+ public function increment(): void
+ {
+ [$major, $minor] = explode('.', self::$version);
+ $minor++;
+ self::$version = "{$major}.{$minor}";
+ }
+}
+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'
+class PhpVersion
+{
+ public static private(set) string $version = '8.5';
+
+ public function increment(): void
+ {
+ [$major, $minor] = explode('.', self::$version);
+ $minor++;
+ self::$version = "{$major}.{$minor}";
+ }
+}
+PHP
+ ); ?>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="php8-compare">
+ <h2 class="php8-h2" id="deprecated_traits">
+ <?= message('deprecated_traits_title', $lang) ?>
+ <a class="php8-rfc" href="PHP: rfc:deprecated_traits;
+ </h2>
+ <div class="php8-compare__main">
+ <div class="php8-compare__block example-contents">
+ <div class="php8-compare__label">PHP &lt; 8.5</div>
+ <div class="php8-code phpcode">
+ <?php highlight_php_trimmed(
+ <<<'PHP'
+/**
+* @deprecated 8.4 use UsePhpVersion instead
+*/
+trait UseVersion
+{
+ public function getVersion(): string
+ {
+ return '8.4';
+ }
+}
+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'
+#[\Deprecated(
+ message: "use UsePhpVersion instead",
+ since: "8.5",
+)]
+trait UseVersion
+{
+ public function getVersion(): string
+ {
+ return '8.5';
+ }
+}
+PHP
+ ); ?>
+ </div>
+ </div>
             </div>
         </div>
     </section>
@@ -124,7 +512,13 @@ PHP
             <h2 class="php8-h2" id="other_new_things"><?= message('new_classes_title', $lang) ?></h2>
             <div class="php8-compare__content php8-compare__content--block">
                 <ul>
-
+ <li>New <code>#[\DelayedTargetValidation]</code> attribute is available</li>
+ <li>New <code>get_error_handler()</code>, <code>get_exception_handler()</code> functions, and <code>Closure::getCurrent</code> method are available.</li>
+ <li>New <code>Dom\Element::getElementsByClassName()</code> and <code>Dom\Element::insertAdjacentHTML()</code> methods are available.</li>
+ <li>New <code>enchant_dict_remove_from_session()</code> and <code>enchant_dict_remove()</code> functions are available.</li>
+ <li>New <code>grapheme_levenshtein()</code> function is available.</li>
+ <li>New <code>opcache_is_script_cached_in_file_cache()</code> function is available.</li>
+ <li>New <code>ReflectionConstant::getFileName()</code>, <code>ReflectionConstant::getExtension()</code>, <code>ReflectionConstant::getExtensionName()</code>, <code>ReflectionConstant::getAttributes()</code>, and <code>ReflectionProperty::getMangledName()</code> methods are available.</li>
                 </ul>
             </div>
         </div>