8.2.30

Latest release in branch 8.2
Released 25 days ago (December 18, 2025)

Software PHP
Branch 8.2
Status
Supported
End of bug fixes December 31, 2024
End of security fixes December 31, 2026
First official release version 8.2.0
First official release date 3 years ago (December 08, 2022)
Release notes https://www.php.net/ChangeLog-8.php#8.2.30
Documentation https://www.php.net/manual/en/
Download https://www.php.net/releases/8.2.30
PHP 8.2 Releases View full list

What is New in PHP 8.2

PHP 8.2 delivers many modern features and performance improvements. The highlight of this release is the introduction of readonly classes, the new Random extension, standalone types, and several quality-of-life enhancements that make code cleaner and safer.

Key New Features

Readonly Classes

A class can now be marked as readonly. When a class is readonly, all its properties automatically become readonly as well.

readonly class User
{
    public function __construct(
        public string $name,
        public string $email
    ) {}
}

// $user->name = 'new name'; // Fatal error
Disjunctive Normal Form (DNF) Types

PHP now supports complex union and intersection types using DNF syntax.

function process((A&B)|(C&D) $param): (X&Y)|(Z) { ... }
New Standalone Types: true, null, false

true, null, and false can now be used as standalone types.

function alwaysTrue(): true { return true; }

function redirect(): never { exit; }
New Random Extension

A completely new Random extension provides a modern, object-oriented, and cryptographically secure way to generate random values.

$rng = new \Random\Engine\Secure();
$randomizer = new \Random\Randomizer($rng);

echo $randomizer->getInt(1, 100);
Allow constants in Traits

Traits can now declare constants.

trait ApiSettings {
    public const API_VERSION = 'v2';
}
Deprecate Dynamic Properties

Creating dynamic properties on objects (except stdClass) is now deprecated and will become an ErrorException in PHP 9.0.

$obj = new stdClass;
$obj->dynamic = 'value'; // Still allowed

class User {}
$user = new User;
$user->name = 'John'; // Deprecated in 8.2
New curl_upkeep() Function

Perform upkeep tasks on a cURL connection handle (useful for long-lived connections.

New memory_reset_peak_usage() Function

Resets the peak memory usage counter back to the current value.

New Functions and Classes

Area New Items
Random Extension Random\Randomizer, Random\Engine\Secure, Random\Engine\Mt19937, random_int(), random_bytes() improvements
cURL curl_upkeep()
Memory memory_reset_peak_usage()
Intl ini_get_all() now supports details parameter for extensions
Password Hash password_needs_rehash() supports $options argument
SPL SplFileObject::getSize()

Notable Deprecations

  • Creating dynamic properties on classes (except stdClass) is deprecated.
  • ${} string interpolation syntax is deprecated.
  • utf8_encode() and utf8_decode() are deprecated - use mb_convert_encoding() or iconv instead.
  • Calling get_class() and get_parent_class() without arguments is deprecated.
  • mbstring.func_overload is fully removed.
  • create_function() has been completely removed.

Performance Improvements

PHP 8.2 brings many internal optimizations:

  • Faster property access and method calls.
  • Improved handling of readonly classes and properties.
  • Better JIT performance and memory usage.
  • Reduced overhead for heredoc/nowdoc and flexible heredoc indentation.
  • Overall lower memory footprint for many common operations.

Other Changes

  • localeconv() now returns decimal and thousands separators as strings or null.
  • fopen() with "w+" mode on non-existent directories no longer triggers a warning.
  • array_is_list() function added to check if an array has sequential numeric keys starting from 0.
  • New sensitive parameter attribute to hide values in stack traces.

Releases In Branch 8.2

Version Release date
8.2.30 25 days ago
(December 18, 2025)
8.2.29 6 months ago
(July 03, 2025)
8.2.28 9 months ago
(March 13, 2025)
8.2.27 1 year ago
(December 19, 2024)
8.2.26 1 year ago
(November 21, 2024)
8.2.25 1 year ago
(October 24, 2024)
8.2.24 1 year ago
(September 26, 2024)
8.2.23 1 year ago
(August 29, 2024)
8.2.22 1 year ago
(August 01, 2024)
8.2.21 1 year ago
(July 04, 2024)
8.2.20 1 year ago
(June 06, 2024)
8.2.19 1 year ago
(May 09, 2024)
8.2.18 1 year ago
(April 11, 2024)
8.2.17 1 year ago
(March 14, 2024)
8.2.16 1 year ago
(February 15, 2024)
8.2.15 1 year ago
(January 18, 2024)
8.2.14 2 years ago
(December 21, 2023)
8.2.13 2 years ago
(November 23, 2023)
8.2.12 2 years ago
(October 26, 2023)
8.2.11 2 years ago
(September 28, 2023)
8.2.10 2 years ago
(August 31, 2023)
8.2.9 2 years ago
(August 03, 2023)
8.2.8 2 years ago
(July 06, 2023)
8.2.7 2 years ago
(June 08, 2023)
8.2.6 2 years ago
(May 11, 2023)
8.2.5 2 years ago
(April 13, 2023)
8.2.4 2 years ago
(March 16, 2023)
8.2.3 2 years ago
(February 14, 2023)
8.2.2 2 years ago
(February 02, 2023)
8.2.1 3 years ago
(January 05, 2023)
8.2.0 3 years ago
(December 08, 2022)