PHP 8.6 Is Out, and Here's What Changes for Your Code
Help Net Security, Thursday, November 19th, 2026
PHP 8.6 adds partial function application, a Duration class and clamp(), while tightening session defaults and deprecating older functions.
PHP 8.6 has been released with partial function application, a Time\Duration class, an Io\Poll API for event loops and a clamp() function, plus a SortDirection enum, default values for readonly properties, post-quantum key encapsulation in Sodium and TLS 1.3 early data.
Defaults change in ways that can trip existing apps: sessions now enable strict mode and httponly cookies with SameSite set to Lax, so login flows should be tested before upgrading.
fclose(), file_put_contents() and copy() now return false when flushing or closing fails, and many functions throw ValueError on invalid input.
Deprecations include the mbstring regex functions, is_double(), is_long(), is_integer(), doubleval(), spl_object_hash() and return inside finally.