From 26141911a34f3d65a89d43d67679a157b6b39663 Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Thu, 25 Sep 2025 19:18:38 +0300 Subject: [PATCH 01/15] Add PHP 8.5 release page --- images/php8/logo_php8_5.svg | 9 ++ releases/8.5/common.php | 70 ++++++++++++++++ releases/8.5/en.php | 5 ++ releases/8.5/index.php | 13 +++ releases/8.5/languages/en.php | 23 +++++ releases/8.5/release.inc | 154 ++++++++++++++++++++++++++++++++++ 6 files changed, 274 insertions(+) create mode 100644 images/php8/logo_php8_5.svg create mode 100644 releases/8.5/common.php create mode 100644 releases/8.5/en.php create mode 100644 releases/8.5/index.php create mode 100644 releases/8.5/languages/en.php create mode 100644 releases/8.5/release.inc 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 @@ + + + + + + + + + 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 @@ + '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 + ]); +} + +function language_chooser(string $currentLang): void { + // Print out the form with all the options + echo ' +
+
+ + +
+
+'; +} + +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 @@ +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 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.
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' => 'Uri\UriException, Uri\InvalidUriException, Uri\UriComparisonMode, + Uri\Rfc3986\Uri, Uri\WhatWg\InvalidUrlException, Uri\WhatWg\UrlValidationErrorType, Uri\WhatWg\UrlValidationError, and Uri\WhatWg\Url are now available.', + + 'new_classes_title' => 'New Classes, Interfaces, and Functions', + 'new_core_attributes' => '#[\NoDiscard] and #[\DelayedTargetValidation] attributes', + + 'bc_title' => 'Deprecations and backward compatibility breaks', + + 'footer_title' => 'Better performance, better syntax, improved type safety.', + 'footer_description' => '

For source downloads of PHP 8.5 please visit the downloads page. Windows binaries can be found on the PHP for Windows site. The list of changes is recorded in the ChangeLog.

+

The migration guide is available in the PHP Manual. Please consult it for a detailed list of new features and backward-incompatible changes.

', +]; 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 @@ + +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+

+ + RFC +

+
+
+
PHP < 8.5
+
+ +
+
+
+
+
PHP 8.5
+
+ trim(...) + |> fn (string $string) => str_replace(' ', '-', $string) + |> fn (string $string) => str_replace(['.', '/', '…'], '', $string) + |> strtolower(...); +PHP + ); ?> +
+
+
+
+ +
+

+ + RFC +

+
+
+
PHP < 8.5
+
+ +
+
+
+
+
PHP 8.5
+
+ getHost()); // string(7) "php.net" +PHP + ); ?> +
+
+
+
+ +
+
+
+ +
+
+

+
+
    + +
+
+
+ +
+

+
+
    + +
+
+
+
+ + + + Date: Wed, 1 Oct 2025 13:10:35 +0300 Subject: [PATCH 02/15] wip --- releases/8.5/languages/en.php | 11 +- releases/8.5/release.inc | 418 +++++++++++++++++++++++++++++++++- 2 files changed, 416 insertions(+), 13 deletions(-) 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' => 'Uri\UriException, Uri\InvalidUriException, Uri\UriComparisonMode, Uri\Rfc3986\Uri, Uri\WhatWg\InvalidUrlException, Uri\WhatWg\UrlValidationErrorType, Uri\WhatWg\UrlValidationError, and Uri\WhatWg\Url are now available.', + 'clone_with_title' => 'Clone with v2', + 'no_discard_title' => 'New #[\NoDiscard] 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 array_first() and array_last() functions', + 'final_promotion_title' => 'Final Property Promotion', + 'attributes_on_constants_title' => 'Attributes on Constants', + 'override_properties_title' => 'Attribute #[\Override] extended to target properties', + 'static_aviz_title' => 'Asymmetric Visibility for Static Properties', + 'deprecated_traits_title' => 'Attribute #[\Deprecated] available for traits', 'new_classes_title' => 'New Classes, Interfaces, and Functions', - 'new_core_attributes' => '#[\NoDiscard] and #[\DelayedTargetValidation] 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));
-

+

+ + RFC +

+
+
+
PHP < 8.5
+
+ +
+
+
+
+
PHP 8.5
+
+ getHost()); // string(7) "php.net" +PHP + ); ?> +
+
+
+
+ +
+
+ +
+

+ + RFC +

+
+
+
PHP < 8.5
+
+ +
+
+
+
+
PHP 8.5
+
+ +
+
+
+
+ +
+

RFC

@@ -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
-

- - RFC +

+ + RFC

@@ -91,9 +160,38 @@ PHP
+
+
+
+
+
PHP 8.5
+
+ +
+
+
+
+ +
+

+ + RFC +

+
+
+
PHP < 8.5
+
+ @@ -105,16 +203,306 @@ PHP
+
+
+
+
-var_dump($uri->getHost()); // string(7) "php.net" +
+

+ + RFC + RFC +

+
+
+
PHP < 8.5
+
+ +
+
+
+
+
PHP 8.5
+
+
- + New CurlSharePersistentHandle class, curl_multi_get_handles(), curl_share_init_persistent() functions are available. +
+
+ +
+

+ + RFC +

+
+
+
PHP < 8.5
+
+ +
+
+
+
+
PHP 8.5
+
+ +
+
+
+
+ +
+

+ + RFC +

+
+
+
PHP < 8.5
+
+ version); // Fatal error: Cannot use the final modifier on a parameter +PHP + + ); ?> +
+
+
+
+
PHP 8.5
+
+ version); // string(7) "PHP 8.5" +PHP + ); ?> +
+
+
+
+ +
+

+ + RFC +

+
+
+
PHP < 8.5
+
+ +
+
+
+
+
PHP 8.5
+
+ +
+
+
+
+ +
+

+ + RFC +

+
+
+
PHP < 8.5
+
+ +
+
+
+
+
PHP 8.5
+
+ +
+
+
+
+ +
+

+ + RFC +

+
+
+
PHP < 8.5
+
+ +
+
+
+
+
PHP 8.5
+
+ +
+
+
+
+ +
+

+ + RFC +

+
+
+
PHP < 8.5
+
+ +
+
+
+
+
PHP 8.5
+
+ +
+
@@ -124,7 +512,13 @@ PHP

From 5fc81d68e403d23e6af0972351364497fe6da718 Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Wed, 1 Oct 2025 15:55:28 +0300 Subject: [PATCH 03/15] wip --- releases/8.5/release.inc | 65 ++++++++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index 94f0f9cedc..f697a54394 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -48,7 +48,8 @@ common_header(message('common_header', $lang)); <<<'PHP' $components = parse_url("https://php.net/releases/8.5/en.php"); -var_dump($components['host']); // string(7) "php.net" +var_dump($components['host']); +// string(7) "php.net" PHP ); ?> @@ -62,7 +63,8 @@ PHP <<<'PHP' $uri = new Uri\Rfc3986\Uri("https://php.net/releases/8.5/en.php"); -var_dump($uri->getHost()); // string(7) "php.net" +var_dump($uri->getHost()); +// string(7) "php.net" PHP ); ?> @@ -84,7 +86,20 @@ PHP
version = $version; + + return $newObject; + } +} + +var_dump(new PhpVersion()->withVersion('PHP 8.5')); PHP ); ?> @@ -96,7 +111,17 @@ PHP
$version]); + } +} + +var_dump(new PhpVersion()->withVersion('PHP 8.5')); PHP ); ?>
@@ -160,7 +185,11 @@ PHP
@@ -172,7 +201,13 @@ PHP
@@ -259,7 +294,8 @@ PHP <<<'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" +var_dump($versions[array_key_first($versions)]); +// string(7) "PHP 8.1" PHP ); ?> @@ -273,7 +309,8 @@ PHP <<<'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" +var_dump(array_first($versions)); +// string(7) "PHP 8.1" PHP ); ?>
@@ -300,7 +337,8 @@ class PhpVersion { } } -var_dump(new PhpVersion()->version); // Fatal error: Cannot use the final modifier on a parameter +var_dump(new PhpVersion()->version); +// Fatal error: Cannot use the final modifier on a parameter PHP ); ?> @@ -320,7 +358,8 @@ class PhpVersion { } } -var_dump(new PhpVersion()->version); // string(7) "PHP 8.5" +var_dump(new PhpVersion()->version); +// string(7) "PHP 8.5" PHP ); ?>
@@ -344,7 +383,8 @@ PHP #[NewFeatures] const VERSION = '8.4'; -var_dump(VERSION); // Parse error: syntax error, unexpected token "const" +var_dump(VERSION); +// Parse error: syntax error, unexpected token "const" PHP ); ?> @@ -361,7 +401,8 @@ PHP #[NewFeatures] const VERSION = '8.5'; -var_dump(VERSION); // string(3) "8.5" +var_dump(VERSION); +// string(3) "8.5" PHP ); ?> From 10270016e46f74e79f59210c6ea8e84204f834ba Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Fri, 3 Oct 2025 20:59:54 +0300 Subject: [PATCH 04/15] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tim Düsterhus --- releases/8.5/languages/en.php | 8 +- releases/8.5/release.inc | 237 +++++++--------------------------- 2 files changed, 52 insertions(+), 193 deletions(-) diff --git a/releases/8.5/languages/en.php b/releases/8.5/languages/en.php index 5d0dca4f36..fd084ded5c 100644 --- a/releases/8.5/languages/en.php +++ b/releases/8.5/languages/en.php @@ -1,10 +1,10 @@ '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.', + '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.', 'documentation' => 'Doc', 'main_title' => 'Released!', - 'main_subtitle' => '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.', + 'main_subtitle' => '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.', 'upgrade_now' => 'Upgrade to PHP 8.5 now!', 'pipe_operator_title' => 'Pipe operator', @@ -16,10 +16,6 @@ '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 array_first() and array_last() functions', - 'final_promotion_title' => 'Final Property Promotion', - 'attributes_on_constants_title' => 'Attributes on Constants', - 'override_properties_title' => 'Attribute #[\Override] extended to target properties', - 'static_aviz_title' => 'Asymmetric Visibility for Static Properties', 'deprecated_traits_title' => 'Attribute #[\Deprecated] available for traits', 'new_classes_title' => 'New Classes, Interfaces, and Functions', diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index f697a54394..eb0bfa3711 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -61,7 +61,9 @@ PHP
getHost()); // string(7) "php.net" @@ -86,9 +88,9 @@ PHP
withVersion('PHP 8.5')); +// Fatal error: Uncaught Error: Cannot modify readonly property PhpVersion::$version PHP ); ?> @@ -111,9 +114,9 @@ PHP
withVersion('PHP 8.5')); +$version = new PhpVersion(); + +var_dump( + $version->withVersion('PHP 8.5'), + $version->version, +); PHP ); ?>
@@ -219,6 +227,7 @@ PHP

RFC + RFC

@@ -226,7 +235,23 @@ PHP
assertSame($result, Calculator::subtract($minuend, $subtrahend)); + } + + public static function subtractionProvider(): iterable + { + for ($i = -10; $i <= 10; $i++) { + yield [$i, $i, 0]; + yield [$i, 0, $i]; + yield [0, $i, -$i]; + } + } +} PHP ); ?> @@ -238,7 +263,20 @@ PHP
@@ -318,185 +356,6 @@ PHP
-
-

- - RFC -

-
-
-
PHP < 8.5
-
- version); -// Fatal error: Cannot use the final modifier on a parameter -PHP - - ); ?> -
-
-
-
-
PHP 8.5
-
- version); -// string(7) "PHP 8.5" -PHP - ); ?> -
-
-
-
- -
-

- - RFC -

-
-
-
PHP < 8.5
-
- -
-
-
-
-
PHP 8.5
-
- -
-
-
-
- -
-

- - RFC -

-
-
-
PHP < 8.5
-
- -
-
-
-
-
PHP 8.5
-
- -
-
-
-
- -
-

- - RFC -

-
-
-
PHP < 8.5
-
- -
-
-
-
-
PHP 8.5
-
- -
-
-
-
-

@@ -553,6 +412,10 @@ PHP

    +
  • Property Promotion is now available for final
  • +
  • Attributes are now available for constants
  • +
  • Attribute #[\Override] now works on properties
  • +
  • Asymmetric Visibility for Static Properties
  • New #[\DelayedTargetValidation] attribute is available
  • New get_error_handler(), get_exception_handler() functions, and Closure::getCurrent method are available.
  • New Dom\Element::getElementsByClassName() and Dom\Element::insertAdjacentHTML() methods are available.
  • From 4c0fe2b3b2694fcb758f80aa9f89a435a2a4c88c Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Fri, 3 Oct 2025 21:06:25 +0300 Subject: [PATCH 05/15] wip --- releases/8.5/languages/en.php | 2 +- releases/8.5/release.inc | 72 +++++++++-------------------------- 2 files changed, 19 insertions(+), 55 deletions(-) diff --git a/releases/8.5/languages/en.php b/releases/8.5/languages/en.php index fd084ded5c..bc46e46c6c 100644 --- a/releases/8.5/languages/en.php +++ b/releases/8.5/languages/en.php @@ -16,7 +16,7 @@ '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 array_first() and array_last() functions', - 'deprecated_traits_title' => 'Attribute #[\Deprecated] available for traits', + 'deprecated_traits_title' => '', 'new_classes_title' => 'New Classes, Interfaces, and Functions', diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index eb0bfa3711..5bcd54a186 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -238,9 +238,16 @@ PHP final class CalculatorTest extends \PHPUnit\Framework\TestCase { #[DataProvider('subtractionProvider')] - public function testSubtraction(int $minuend, int $subtrahend, int $result): void + public function testSubtraction( + int $minuend, + int $subtrahend, + int $result + ): void { - $this->assertSame($result, Calculator::subtract($minuend, $subtrahend)); + $this->assertSame( + $result, + Calculator::subtract($minuend, $subtrahend) + ); } public static function subtractionProvider(): iterable @@ -272,9 +279,15 @@ final class CalculatorTest yield [0, $i, ($i * -1)]; } })] - public function testSubtraction(int $minuend, int $subtrahend, int $result) + public function testSubtraction( + int $minuend, + int $subtrahend, + int $result + ) { - \assert(Calculator::subtract($minuend, $subtrahend) === $result); + \assert( + Calculator::subtract($minuend, $subtrahend) === $result + ); } } PHP @@ -349,56 +362,6 @@ $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 - ); ?> -
-
-
-
- -
-

- - RFC -

-
-
-
PHP < 8.5
-
- -
-
-
-
-
PHP 8.5
-
-
@@ -415,6 +378,7 @@ PHP
  • Property Promotion is now available for final
  • Attributes are now available for constants
  • Attribute #[\Override] now works on properties
  • +
  • Attribute #[\Deprecated] available for traits
  • Asymmetric Visibility for Static Properties
  • New #[\DelayedTargetValidation] attribute is available
  • New get_error_handler(), get_exception_handler() functions, and Closure::getCurrent method are available.
  • From 6e7045fb76c71407b31f728f0cd4be45f271329f Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Fri, 3 Oct 2025 23:21:54 +0300 Subject: [PATCH 06/15] wip --- releases/8.5/release.inc | 68 +++++++++++++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 8 deletions(-) diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index 5bcd54a186..6ea3dac395 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -309,7 +309,22 @@ PHP
    @@ -321,7 +336,21 @@ PHP
    @@ -343,10 +372,22 @@ PHP
    ['state' => 'security', 'branch' => 'PHP-8.2'], + 'php-83' => ['state' => 'active', 'branch' => 'PHP-8.3'], + 'php-84' => ['state' => 'active', 'branch' => 'PHP-8.4'], + 'php-85' => ['state' => 'upcoming', 'branch' => 'PHP-8.5'], +]; + +$upcomingRelease = null; +foreach ($php as $key => $version) { + if ($version['state'] === 'upcoming') { + $upcomingRelease = $version; + break; + } +} -var_dump($versions[array_key_first($versions)]); -// string(7) "PHP 8.1" +var_dump($upcomingRelease); PHP ); ?> @@ -358,10 +399,21 @@ PHP
    ['state' => 'security', 'branch' => 'PHP-8.2'], + 'php-83' => ['state' => 'active', 'branch' => 'PHP-8.3'], + 'php-84' => ['state' => 'active', 'branch' => 'PHP-8.4'], + 'php-85' => ['state' => 'upcoming', 'branch' => 'PHP-8.5'], +]; + +$upcomingRelease = array_first( + array_filter( + $php, + static fn($version) => $version['state'] === 'upcoming' + ) +); -var_dump(array_first($versions)); -// string(7) "PHP 8.1" +var_dump($upcomingRelease); PHP ); ?>
    From b65585643dd0d75709755b7c9f4f0454591450c1 Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Sun, 5 Oct 2025 19:54:09 +0300 Subject: [PATCH 07/15] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tim Düsterhus --- releases/8.5/release.inc | 52 +++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index 6ea3dac395..3a833189ba 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -101,7 +101,12 @@ final readonly class PhpVersion { } } -var_dump(new PhpVersion()->withVersion('PHP 8.5')); +$version = new PhpVersion(); + +var_dump($version->version); +// string(7) "PHP 8.4" + +var_dump($version->withVersion('PHP 8.5')->version); // Fatal error: Uncaught Error: Cannot modify readonly property PhpVersion::$version PHP @@ -120,16 +125,22 @@ final readonly class PhpVersion { ) {} public function withVersion(string $version) { - return clone($this, ['version' => $version]); + return clone($this, [ + 'version' => $version, + ]); } } $version = new PhpVersion(); -var_dump( - $version->withVersion('PHP 8.5'), - $version->version, -); +var_dump($version->version); +// string(7) "PHP 8.4" + +var_dump($version->withVersion('PHP 8.5')->version); +// string(7) "PHP 8.5" + +var_dump($version->version); +// string(7) "PHP 8.4" PHP ); ?>
    @@ -157,6 +168,9 @@ $output = strtolower( ) ) ); + +var_dump($output); +// string(19) "some-kind-of-string" PHP ); ?> @@ -175,6 +189,9 @@ $output = $input |> (fn (string $string) => str_replace(' ', '-', $string)) |> (fn (string $string) => str_replace(['.', '/', '…'], '', $string)) |> strtolower(...); + +var_dump($output); +// string(19) "some-kind-of-string" PHP ); ?>
    @@ -193,7 +210,8 @@ PHP
    @@ -348,9 +364,6 @@ curl_exec($ch1); $ch2 = curl_init('https://thephp.foundation/'); curl_setopt($ch2, CURLOPT_SHARE, $sh); curl_exec($ch2); - -curl_close($ch1); -curl_close($ch2); PHP ); ?>
    @@ -429,11 +442,12 @@ PHP
    • Property Promotion is now available for final
    • Attributes are now available for constants
    • -
    • Attribute #[\Override] now works on properties
    • -
    • Attribute #[\Deprecated] available for traits
    • +
    • Attribute #[\Override] now works on properties
    • +
    • Attribute #[\Deprecated] available for traits
    • Asymmetric Visibility for Static Properties
    • New #[\DelayedTargetValidation] attribute is available
    • -
    • New get_error_handler(), get_exception_handler() functions, and Closure::getCurrent method are available.
    • +
    • New get_error_handler(), get_exception_handler() functions are available.
    • +
    • New Closure::getCurrent method is available.
    • New Dom\Element::getElementsByClassName() and Dom\Element::insertAdjacentHTML() methods are available.
    • New enchant_dict_remove_from_session() and enchant_dict_remove() functions are available.
    • New grapheme_levenshtein() function is available.
    • From 7301dd8f1a29e04374f3bcf5e6f5f41530c950a5 Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Sun, 5 Oct 2025 21:15:27 +0300 Subject: [PATCH 08/15] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tim Düsterhus --- releases/8.5/languages/en.php | 1 - releases/8.5/release.inc | 18 ++++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/releases/8.5/languages/en.php b/releases/8.5/languages/en.php index bc46e46c6c..a0c2f2e947 100644 --- a/releases/8.5/languages/en.php +++ b/releases/8.5/languages/en.php @@ -16,7 +16,6 @@ '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 array_first() and array_last() functions', - 'deprecated_traits_title' => '', 'new_classes_title' => 'New Classes, Interfaces, and Functions', diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index 3a833189ba..00545de762 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -88,12 +88,14 @@ PHP
      version = $version; @@ -119,12 +121,14 @@ PHP
      $version, ]); @@ -186,8 +190,8 @@ $input = ' Some kind of string. '; $output = $input |> trim(...) - |> (fn (string $string) => str_replace(' ', '-', $string)) - |> (fn (string $string) => str_replace(['.', '/', '…'], '', $string)) + |> (fn($string) => str_replace(' ', '-', $string)) + |> (fn($string) => str_replace(['.', '/', '…'], '', $string)) |> strtolower(...); var_dump($output); @@ -339,8 +343,6 @@ curl_exec($ch1); $ch2 = curl_init('https://thephp.foundation/'); curl_setopt($ch2, CURLOPT_SHARE, $sh); curl_exec($ch2); - -curl_share_close($sh); PHP ); ?> From d5253792cb66a3e1517eba9c59a8b45742b800e3 Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Sun, 5 Oct 2025 21:19:00 +0300 Subject: [PATCH 09/15] cs --- releases/8.5/release.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index 00545de762..e491fa612a 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -295,7 +295,8 @@ PHP <<<'PHP' final class CalculatorTest { - #[Test\CaseGenerator(static function (): iterable { + #[Test\CaseGenerator(static function (): iterable + { for ($i = -10; $i <= 10; $i++) { yield [$i, $i, 0]; yield [$i, 0, $i]; From 9d16f51ebc137e03acc4789ee4f13e37e97a54b7 Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Sun, 12 Oct 2025 20:48:04 +0300 Subject: [PATCH 10/15] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tim Düsterhus --- releases/8.5/languages/en.php | 17 +++++++++-------- releases/8.5/release.inc | 6 ++++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/releases/8.5/languages/en.php b/releases/8.5/languages/en.php index a0c2f2e947..8f6e9b747e 100644 --- a/releases/8.5/languages/en.php +++ b/releases/8.5/languages/en.php @@ -7,14 +7,15 @@ 'main_subtitle' => '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.', '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' => 'Uri\UriException, Uri\InvalidUriException, Uri\UriComparisonMode, - Uri\Rfc3986\Uri, Uri\WhatWg\InvalidUrlException, Uri\WhatWg\UrlValidationErrorType, Uri\WhatWg\UrlValidationError, and Uri\WhatWg\Url are now available.', - 'clone_with_title' => 'Clone with v2', - 'no_discard_title' => 'New #[\NoDiscard] Attribute', - 'fcc_in_const_expr_title' => 'First Class Callables in constant expressions', - 'curl_share_persistence_improvement_title' => 'Persistent cURL share handle improvement', + 'pipe_operator_title' => 'Pipe Operator', + 'url_parsing_api_title' => 'New URI Extension', + 'url_parsing_api_description' => '

      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.

      The secure and standards-compliant URI parsing is powered by the uriparser (RFC 3986) and Lexbor (WHATWG URL) libraries.

      ', + 'clone_with_title' => 'Clone With', + 'clone_with_description' => 'It is not possible to update properties during object cloning by passing an associative array with the updated to the clone() function. This enables straight-forward support of the "with-er" pattern for readonly classes.', + 'no_discard_title' => '#[\NoDiscard] Attribute', + 'no_discard_description' => '

      By adding the #[\NoDiscard] 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.

      The associated (void) cast can be used to indicate that a value is intentionally unused.

      ', + 'fcc_in_const_expr_title' => 'Closures and First Class Callables in Constant Expressions', + 'curl_share_persistence_improvement_title' => 'Persistent cURL Share Handles', 'array_first_last_title' => 'New array_first() and array_last() functions', 'new_classes_title' => 'New Classes, Interfaces, and Functions', diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index e491fa612a..f9bf446651 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -150,6 +150,9 @@ PHP
    +
    + +
    @@ -244,6 +247,9 @@ PHP
    +
    + +
    From 256298387efceaf2c4c7be0e35253bce4f922a88 Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Sun, 12 Oct 2025 21:02:13 +0300 Subject: [PATCH 11/15] Update releases/8.5/languages/en.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tim Düsterhus --- releases/8.5/languages/en.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releases/8.5/languages/en.php b/releases/8.5/languages/en.php index 8f6e9b747e..07b5182efd 100644 --- a/releases/8.5/languages/en.php +++ b/releases/8.5/languages/en.php @@ -11,7 +11,7 @@ 'url_parsing_api_title' => 'New URI Extension', 'url_parsing_api_description' => '

    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.

    The secure and standards-compliant URI parsing is powered by the uriparser (RFC 3986) and Lexbor (WHATWG URL) libraries.

    ', 'clone_with_title' => 'Clone With', - 'clone_with_description' => 'It is not possible to update properties during object cloning by passing an associative array with the updated to the clone() function. This enables straight-forward support of the "with-er" pattern for readonly classes.', + 'clone_with_description' => 'It is now possible to update properties during object cloning by passing an associative array with the updated to the clone() function. This enables straight-forward support of the "with-er" pattern for readonly classes.', 'no_discard_title' => '#[\NoDiscard] Attribute', 'no_discard_description' => '

    By adding the #[\NoDiscard] 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.

    The associated (void) cast can be used to indicate that a value is intentionally unused.

    ', 'fcc_in_const_expr_title' => 'Closures and First Class Callables in Constant Expressions', From 4ddd043566b9bbffb45f57bd0abcb707e53d3ecc Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Mon, 20 Oct 2025 13:19:19 +0300 Subject: [PATCH 12/15] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tim Düsterhus --- releases/8.5/languages/en.php | 3 ++- releases/8.5/release.inc | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/releases/8.5/languages/en.php b/releases/8.5/languages/en.php index 07b5182efd..3ac7f87c20 100644 --- a/releases/8.5/languages/en.php +++ b/releases/8.5/languages/en.php @@ -8,8 +8,9 @@ 'upgrade_now' => 'Upgrade to PHP 8.5 now!', 'pipe_operator_title' => 'Pipe Operator', + 'pipe_operator_description' => '

    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.

    Learn more about the backstory of this feature in The PHP Foundation’s blog.

    ', 'url_parsing_api_title' => 'New URI Extension', - 'url_parsing_api_description' => '

    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.

    The secure and standards-compliant URI parsing is powered by the uriparser (RFC 3986) and Lexbor (WHATWG URL) libraries.

    ', + 'url_parsing_api_description' => '

    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.

    The secure and standards-compliant URI parsing is powered by the uriparser (RFC 3986) and Lexbor (WHATWG URL) libraries.

    Learn more about the backstory of this feature in The PHP Foundation’s blog.

    ', 'clone_with_title' => 'Clone With', 'clone_with_description' => 'It is now possible to update properties during object cloning by passing an associative array with the updated to the clone() function. This enables straight-forward support of the "with-er" pattern for readonly classes.', 'no_discard_title' => '#[\NoDiscard] Attribute', diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index f9bf446651..ca643b445f 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -204,6 +204,9 @@ PHP
    +
    + +
    From e337daec8ecbe0f676f5f2e205b2911029e1288a Mon Sep 17 00:00:00 2001 From: Sergey Panteleev Date: Wed, 22 Oct 2025 10:42:52 +0300 Subject: [PATCH 13/15] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Tim Düsterhus Co-authored-by: Borislav Kosun --- releases/8.5/release.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index ca643b445f..48a2f1abbc 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -46,7 +46,7 @@ common_header(message('common_header', $lang));
    getHost()); // string(7) "php.net" From eac11c7036feca7aa00090b51e027aead89bec41 Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Tue, 4 Nov 2025 14:36:34 -0600 Subject: [PATCH 14/15] 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). --- releases/8.5/languages/en.php | 32 +-- releases/8.5/release.inc | 394 ++++++++++++++++------------------ 2 files changed, 197 insertions(+), 229 deletions(-) diff --git a/releases/8.5/languages/en.php b/releases/8.5/languages/en.php index 3ac7f87c20..7f3011b05c 100644 --- a/releases/8.5/languages/en.php +++ b/releases/8.5/languages/en.php @@ -1,29 +1,31 @@ '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.', + '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.', 'documentation' => 'Doc', 'main_title' => 'Released!', - 'main_subtitle' => '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.', - 'upgrade_now' => 'Upgrade to PHP 8.5 now!', + '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' => '

    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.

    Learn more about the backstory of this feature in The PHP Foundation’s blog.

    ', - 'url_parsing_api_title' => 'New URI Extension', - 'url_parsing_api_description' => '

    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.

    The secure and standards-compliant URI parsing is powered by the uriparser (RFC 3986) and Lexbor (WHATWG URL) libraries.

    Learn more about the backstory of this feature in The PHP Foundation’s blog.

    ', + 'pipe_operator_description' => '

    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.

    Learn more about the backstory of this feature in The PHP Foundation’s blog.

    ', + 'uri_extension_title' => 'URI Extension', + 'uri_extension_description' => '

    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.

    Powered by the uriparser (RFC 3986) and Lexbor (WHATWG URL) libraries.

    Learn more about the backstory of this feature in The PHP Foundation’s blog.

    ', 'clone_with_title' => 'Clone With', - 'clone_with_description' => 'It is now possible to update properties during object cloning by passing an associative array with the updated to the clone() function. This enables straight-forward support of the "with-er" pattern for readonly classes.', + 'clone_with_description' => 'It is now possible to update properties during object cloning by passing an associative array to the clone() function. This enables straightforward support of the "with-er" pattern for readonly classes.', 'no_discard_title' => '#[\NoDiscard] Attribute', - 'no_discard_description' => '

    By adding the #[\NoDiscard] 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.

    The associated (void) cast can be used to indicate that a value is intentionally unused.

    ', - 'fcc_in_const_expr_title' => 'Closures and First Class Callables in Constant Expressions', - 'curl_share_persistence_improvement_title' => 'Persistent cURL Share Handles', - 'array_first_last_title' => 'New array_first() and array_last() functions', + 'no_discard_description' => '

    By adding the #[\NoDiscard] 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.

    The associated (void) cast can be used to indicate that a value is intentionally unused.

    ', + 'array_first_last_title' => 'array_first() and array_last() 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 curl_share_init(), handles created by curl_share_init_persistent() 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' => 'New Classes, Interfaces, and Functions', + 'new_classes_title' => 'Additional features and improvements', 'bc_title' => 'Deprecations and backward compatibility breaks', - 'footer_title' => 'Better performance, better syntax, improved type safety.', - 'footer_description' => '

    For source downloads of PHP 8.5 please visit the downloads page. Windows binaries can be found on the PHP for Windows site. The list of changes is recorded in the ChangeLog.

    -

    The migration guide is available in the PHP Manual. Please consult it for a detailed list of new features and backward-incompatible changes.

    ', + 'footer_title' => 'Better syntax, improved performance and type safety.', + 'footer_description' => '

    The full list of changes is recorded in the ChangeLog.

    +

    Please consult the Migration Guide for a detailed list of new features and backward-incompatible changes.

    ', ]; diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index 48a2f1abbc..46cb88c4d5 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -36,9 +36,9 @@ common_header(message('common_header', $lang));
    -

    - - RFC +

    + + RFC

    @@ -46,41 +46,51 @@ common_header(message('common_header', $lang));
    -
    +
    PHP 8.5
    -
    +
    trim(...) + |> (fn($str) => str_replace(' ', '-', $str)) + |> (fn($str) => str_replace('.', '', $str)) + |> strtolower(...); -var_dump($uri->getHost()); -// string(7) "php.net" +var_dump($output); // string(13) "my-test-value" PHP ); ?>
    - +
    -

    - - RFC +

    + + RFC

    @@ -88,124 +98,102 @@ PHP
    version = $version; - - return $newObject; - } -} - -$version = new PhpVersion(); - -var_dump($version->version); -// string(7) "PHP 8.4" +$components = parse_url('https://php.net/releases/8.4/en.php'); -var_dump($version->withVersion('PHP 8.5')->version); -// Fatal error: Uncaught Error: Cannot modify readonly property PhpVersion::$version +var_dump($components['host']); +// string(7) "php.net" PHP ); ?>
    -
    +
    PHP 8.5
    -
    +
    $version, - ]); - } -} - -$version = new PhpVersion(); - -var_dump($version->version); -// string(7) "PHP 8.4" +use Uri\Rfc3986\Uri; -var_dump($version->withVersion('PHP 8.5')->version); -// string(7) "PHP 8.5" +$uri = new Uri('https://php.net/releases/8.5/en.php'); -var_dump($version->version); -// string(7) "PHP 8.4" +var_dump($uri->getHost()); +// string(7) "php.net" PHP ); ?>
    - +
    -

    - - RFC +

    + + RFC

    PHP < 8.5
    withAlpha(128); PHP ); ?>
    -
    +
    PHP 8.5
    -
    +
    trim(...) - |> (fn($string) => str_replace(' ', '-', $string)) - |> (fn($string) => str_replace(['.', '/', '…'], '', $string)) - |> strtolower(...); + public function withAlpha(int $alpha): self + { + return clone($this, ['alpha' => $alpha]); + } +} -var_dump($output); -// string(19) "some-kind-of-string" +$blue = new Color(79, 91, 147); +$transparentBlue = $blue->withAlpha(128); PHP ); ?>
    - +
    @@ -225,16 +213,16 @@ function getPhpVersion(): string return 'PHP 8.4'; } -getPhpVersion(); // No Errors +getPhpVersion(); // No warning PHP ); ?>
    -
    +
    PHP 8.5
    -
    +
    -

    - - RFC - RFC +

    + + RFC

    @@ -267,62 +254,40 @@ PHP
    assertSame( - $result, - Calculator::subtract($minuend, $subtrahend) - ); - } +$releases = [ + '8.5' => '2025-11-20', + '8.4' => '2024-11-21', + '8.3' => '2023-11-23', + '8.2' => '2022-12-08', +]; - public static function subtractionProvider(): iterable - { - for ($i = -10; $i <= 10; $i++) { - yield [$i, $i, 0]; - yield [$i, 0, $i]; - yield [0, $i, -$i]; - } - } -} +$firstKey = array_key_first($releases); +$newestDate = $releases[$firstKey]; + +var_dump($newestDate); +// string(10) "2025-11-20" PHP ); ?>
    -
    +
    PHP 8.5
    -
    +
    '2025-11-20', + '8.4' => '2024-11-21', + '8.3' => '2023-11-23', + '8.2' => '2022-12-08', +]; + +$newestDate = array_first($releases); + +var_dump($newestDate); +// string(10) "2025-11-20" PHP ); ?>
    @@ -331,10 +296,10 @@ PHP
    -

    - - RFC - RFC +

    + + RFC + RFC

    @@ -342,54 +307,58 @@ PHP
    -
    +
    PHP 8.5
    -
    +
    - New CurlSharePersistentHandle class, curl_multi_get_handles(), curl_share_init_persistent() functions are available. +
    -

    - - RFC +

    + + RFC + RFC

    @@ -397,53 +366,42 @@ PHP
    ['state' => 'security', 'branch' => 'PHP-8.2'], - 'php-83' => ['state' => 'active', 'branch' => 'PHP-8.3'], - 'php-84' => ['state' => 'active', 'branch' => 'PHP-8.4'], - 'php-85' => ['state' => 'upcoming', 'branch' => 'PHP-8.5'], -]; +$sh = curl_share_init(); +curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS); +curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT); -$upcomingRelease = null; -foreach ($php as $key => $version) { - if ($version['state'] === 'upcoming') { - $upcomingRelease = $version; - break; - } -} +$ch1 = curl_init('https://php.net/'); +curl_setopt($ch1, CURLOPT_SHARE, $sh); -var_dump($upcomingRelease); +curl_exec($ch1); PHP - ); ?>
    -
    +
    PHP 8.5
    -
    +
    ['state' => 'security', 'branch' => 'PHP-8.2'], - 'php-83' => ['state' => 'active', 'branch' => 'PHP-8.3'], - 'php-84' => ['state' => 'active', 'branch' => 'PHP-8.4'], - 'php-85' => ['state' => 'upcoming', 'branch' => 'PHP-8.5'], -]; +$sh = curl_share_init_persistent([ + CURL_LOCK_DATA_DNS, + CURL_LOCK_DATA_CONNECT +]); -$upcomingRelease = array_first( - array_filter( - $php, - static fn($version) => $version['state'] === 'upcoming' - ) -); +$ch1 = curl_init('https://php.net/'); +curl_setopt($ch1, CURLOPT_SHARE, $sh); -var_dump($upcomingRelease); +// This may now reuse the connection from an earlier SAPI request +curl_exec($ch1); PHP ); ?>
    +
    + +
    @@ -452,19 +410,18 @@ PHP

      -
    • Property Promotion is now available for final
    • -
    • Attributes are now available for constants
    • -
    • Attribute #[\Override] now works on properties
    • -
    • Attribute #[\Deprecated] available for traits
    • -
    • Asymmetric Visibility for Static Properties
    • -
    • New #[\DelayedTargetValidation] attribute is available
    • -
    • New get_error_handler(), get_exception_handler() functions are available.
    • -
    • New Closure::getCurrent method is available.
    • +
    • Fatal Errors (such as an exceeded maximum execution time) now include a backtrace.
    • +
    • Attributes can now target constants.
    • +
    • #[\Override] attribute can now be applied to properties.
    • +
    • #[\Deprecated] attribute can be used on traits and constants.
    • +
    • Static properties now support asymmetric visibility.
    • +
    • Properties can be marked as final using constructor property promotion.
    • +
    • Added Closure::getCurrent() method to simplify recursion in anonymous functions.
    • +
    • setcookie() and setrawcookie() now support the "partitioned" key.
    • +
    • New get_error_handler() and get_exception_handler() functions are available.
    • New Dom\Element::getElementsByClassName() and Dom\Element::insertAdjacentHTML() methods are available.
    • -
    • New enchant_dict_remove_from_session() and enchant_dict_remove() functions are available.
    • -
    • New grapheme_levenshtein() function is available.
    • -
    • New opcache_is_script_cached_in_file_cache() function is available.
    • -
    • New ReflectionConstant::getFileName(), ReflectionConstant::getExtension(), ReflectionConstant::getExtensionName(), ReflectionConstant::getAttributes(), and ReflectionProperty::getMangledName() methods are available.
    • +
    • Added grapheme_levenshtein() function.
    • +
    • New #[\DelayedTargetValidation] attribute can be used to suppress compile-time errors from core and extension attributes that are used on invalid targets.
    @@ -473,7 +430,16 @@ PHP

      - +
    • The backtick operator as an alias for shell_exec() has been deprecated.
    • +
    • Non-canonical cast names (boolean), (integer), (double), and (binary) have been deprecated. Use (bool), (int), (float), and (string) instead, respectively.
    • +
    • The disable_classes INI setting has been removed as it causes various engine assumptions to be broken.
    • +
    • Returning a non-string from a user output handler is deprecated.
    • +
    • Terminating case statements with a semicolon instead of a colon has been deprecated.
    • +
    • Using null as an array offset or when calling array_key_exists() is now deprecated. Use an empty string instead.
    • +
    • It is no longer possible to use "array" and "callable" as class alias names in class_alias().
    • +
    • The __sleep() and __wakeup() magic methods have been soft-deprecated. The __serialize() and __unserialize() magic methods should be used instead.
    • +
    • A warning is now emitted when casting NAN to other types.
    • +
    • A warning is now emitted when casting floats (or strings that look like floats) to int if they cannot be represented as one.
    From 0f13eb7f9f033e8575e1f017746f8729500d0a74 Mon Sep 17 00:00:00 2001 From: Theodore Brown Date: Thu, 6 Nov 2025 01:33:27 -0600 Subject: [PATCH 15/15] Move Pipe Operator after URI Extension and use more realistic `array_last()` example (#32) * Move Pipe Operator after URI Extension This is per feedback - without PFA the pipe operator is somewhat clunky, so it may be better to feature it first next year with partial function application. * Use more realistic example for array_last --- releases/8.5/release.inc | 91 ++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 55 deletions(-) diff --git a/releases/8.5/release.inc b/releases/8.5/release.inc index 46cb88c4d5..460b26399a 100644 --- a/releases/8.5/release.inc +++ b/releases/8.5/release.inc @@ -36,9 +36,9 @@ common_header(message('common_header', $lang));
    -

    - - RFC +

    + + RFC

    @@ -46,17 +46,10 @@ common_header(message('common_header', $lang));
    @@ -68,29 +61,26 @@ PHP
    trim(...) - |> (fn($str) => str_replace(' ', '-', $str)) - |> (fn($str) => str_replace('.', '', $str)) - |> strtolower(...); +$uri = new Uri('https://php.net/releases/8.5/en.php'); -var_dump($output); // string(13) "my-test-value" +var_dump($uri->getHost()); +// string(7) "php.net" PHP ); ?>
    - +
    -

    - - RFC +

    + + RFC

    @@ -98,10 +88,17 @@ PHP
    @@ -113,19 +110,22 @@ PHP
    trim(...) + |> (fn($str) => str_replace(' ', '-', $str)) + |> (fn($str) => str_replace('.', '', $str)) + |> strtolower(...); -var_dump($uri->getHost()); -// string(7) "php.net" +var_dump($output); // string(13) "my-test-value" PHP ); ?>
    - +
    @@ -254,18 +254,9 @@ PHP
    '2025-11-20', - '8.4' => '2024-11-21', - '8.3' => '2023-11-23', - '8.2' => '2022-12-08', -]; - -$firstKey = array_key_first($releases); -$newestDate = $releases[$firstKey]; - -var_dump($newestDate); -// string(10) "2025-11-20" +$lastEvent = $events === [] + ? null + : $events[array_key_last($events)]; PHP ); ?> @@ -277,17 +268,7 @@ PHP
    '2025-11-20', - '8.4' => '2024-11-21', - '8.3' => '2023-11-23', - '8.2' => '2022-12-08', -]; - -$newestDate = array_first($releases); - -var_dump($newestDate); -// string(10) "2025-11-20" +$lastEvent = array_last($events); PHP ); ?>