Latest in branch 8.2
8.2.31
Released 07 May 2026
(1 month ago)
SoftwarePHP
Version8.2
Status
Supported
Initial release8.2.0
08 Dec 2022
(3 years ago)
Latest release8.2.31
07 May 2026
(1 month ago)
End of bug fixes31 Dec 2024
(Ended 1 year, 5 months ago)
End of security fixes31 Dec 2026
(Ends in 6 months)
Release noteshttps://www.php.net/ChangeLog-8.php#8.2.31
Source codehttps://github.com/php/php-src/tree/php-8.2.31
Documentationhttps://www.php.net/manual/en/
Downloadhttps://www.php.net/releases/8.2.31
PHP 8.2 ReleasesView 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

VersionRelease date
8.2.3107 May 2026
(1 month ago)
8.2.3018 Dec 2025
(5 months ago)
8.2.2903 Jul 2025
(11 months ago)
8.2.2813 Mar 2025
(1 year ago)
8.2.2719 Dec 2024
(1 year ago)
8.2.2621 Nov 2024
(1 year ago)
8.2.2524 Oct 2024
(1 year ago)
8.2.2426 Sep 2024
(1 year ago)
8.2.2329 Aug 2024
(1 year ago)
8.2.2201 Aug 2024
(1 year ago)
8.2.2104 Jul 2024
(1 year ago)
8.2.2006 Jun 2024
(2 years ago)
8.2.1909 May 2024
(2 years ago)
8.2.1811 Apr 2024
(2 years ago)
8.2.1714 Mar 2024
(2 years ago)
8.2.1615 Feb 2024
(2 years ago)
8.2.1518 Jan 2024
(2 years ago)
8.2.1421 Dec 2023
(2 years ago)
8.2.1323 Nov 2023
(2 years ago)
8.2.1226 Oct 2023
(2 years ago)
8.2.1128 Sep 2023
(2 years ago)
8.2.1031 Aug 2023
(2 years ago)
8.2.903 Aug 2023
(2 years ago)
8.2.806 Jul 2023
(2 years ago)
8.2.708 Jun 2023
(3 years ago)
8.2.611 May 2023
(3 years ago)
8.2.513 Apr 2023
(3 years ago)
8.2.416 Mar 2023
(3 years ago)
8.2.314 Feb 2023
(3 years ago)
8.2.202 Feb 2023
(3 years ago)
8.2.105 Jan 2023
(3 years ago)
8.2.008 Dec 2022
(3 years ago)