PHP 8.6 Released: Simplified Code, Concurrency Upgrade, Security Hardening
IT之家 reported on November 20 that the PHP development team released PHP 8.6 yesterday (November 19), focusing on simplifying code, optimizing concurrent processing and default security settings, and improving the performance of common operations such as JSON encoding.

The most closely watched new feature in PHP 8.6 is "partial function application": developers can fill in some of a function's arguments first and leave the rest to be supplied later, producing a reusable new function. For example, by presetting the rule "replace spaces with hyphens," different text can then be passed in, reducing the need to repeatedly write wrapper code.

Another highlight is the new Io\Poll polling interface, which can monitor large numbers of data streams such as network connections at the same time and call each operating system's native mechanisms, breaking through the scalability limits of the old interface and providing low-level support for asynchronous frameworks handling high-concurrency tasks.

PHP 8.6 also updates its supporting tools: Time\Duration is dedicated to representing elapsed durations, supports nanosecond precision, and makes it easier to manage timeouts and retry intervals; clamp () constrains values within a specified range; and readonly properties now allow default values to be set directly.


On security, the new version enables strict session mode and HttpOnly session cookies by default, and sets the SameSite policy to Lax. Performance optimizations cover JSON encoding, formatted output and some array processing operations, but the announcement did not provide an overall speedup figure.
- PHP 8.6 changelog
Advertising statement: External redirect links contained in the article (including but not limited to hyperlinks, QR codes, passwords and other forms) are used to convey more information and save selection time; the results are for reference only, and all articles on IT之家 that contain external links include this statement.