PHP 8.6 Released: New Features and Upgrade Notes

You are currently viewing PHP 8.6 Released: New Features and Upgrade Notes
Image created with Claude AI

PHP 8.6 was released on 19 November 2026. It is a major update that adds Partial Function Application, a \Time\Duration class, a native Polling API and a clamp() function. It also changes session defaults and deprecates a long list of old functions, so test your code before you switch production servers.

What is new in PHP 8.6

The official release announcement lists these headline features:

  • Partial Function Application: pass some arguments now and use ? or ... placeholders for the rest. You get a Closure, e.g. version_compare(?, '8.6', '>=') as an array_filter() callback.
  • \Time\Duration: elapsed time with nanosecond precision, independent of timezones. Useful for timeouts, retries and benchmarks.
  • Polling API (Io\Poll): monitors many streams with epoll, kqueue, event ports or WSAPoll, without the limits of stream_select(). Event loop libraries such as ReactPHP and AMPHP can build on it.
  • clamp(): keeps a value inside a range, replacing the max(0, min($x, 100)) idiom.
  • SortDirection enum with Ascending and Descending cases, for type-safe sort parameters.
  • Readonly property defaults and structured stream errors (StreamException, StreamErrorCode) instead of warnings.

Smaller additions include mysqli::quote_string(), post-quantum key encapsulation in Sodium (X-Wing, ML-KEM-768), TLS 1.3 session resumption and early data, and JSON error messages that show where the error is.

PHP 8.6 upgrade notes: what may break

For sysadmins and WordPress site owners these changes matter most:

  • Session defaults: session.use_strict_mode and session.cookie_httponly are now enabled, and session.cookie_samesite is Lax. Check login flows that rely on cross-site cookies.
  • Deprecations: return inside finally, the mb_ereg() family, the aliases is_integer(), is_long(), is_double(), doubleval(), and spl_object_hash(), among others. Expect new notices in your logs.
  • Behaviour changes: trim() also strips form feed characters, and fclose(), file_put_contents() and copy() now return false when a flush fails.

Read the migration guide before you upgrade, and try the new version on a staging copy first. Older themes and plugins are the usual source of trouble.

Support timeline

According to php.net supported versions:

  • PHP 8.6: active support until 31 December 2028, security fixes until 31 December 2030.
  • PHP 8.2: security support ends on 31 December 2026.
  • PHP 8.4: active support ends on 31 December 2026 (security fixes until 31 December 2028).

If you still run PHP 8.2, plan the move now. On the same day the PHP team also shipped 8.5.13, 8.4.28, 8.3.37 and 8.2.36. For a practical walkthrough, see How to Upgrade PHP on WordPress Step by Step.

Sources