PHP 8.6 is a planned major PHP update, scheduled for November 19, 2026. Its central language addition, partial function application, lets developers pre-fill some function arguments and create a closure that accepts the remaining ones. A new Time\Duration class represents elapsed time independently of calendars and time zones, with nanosecond precision across a range of more than 250 years, making timeouts and benchmarks easier to express. The new Io\Poll API monitors many streams using native platform mechanisms such as epoll and kqueue, providing a scalable alternative to stream_select() for event-loop libraries. Stream operations can also be configured to throw exceptions or fail silently, with errors available as structured data.
Other additions aim to improve safety and consistency. clamp() bounds comparable values, including durations, while the built-in SortDirection enum gives libraries a shared, type-safe way to specify ascending or descending order. Parameters can carry their own DocComments, which reflection can retrieve. New ReflectionProperty methods report whether a property is readable or writable in a given scope, addressing complexity from readonly properties, asymmetric visibility, and property hooks. PHP 8.6 also allows readonly properties to declare default values, avoiding constructor assignments for fixed values. Together, the changes emphasize clearer APIs, stronger typing, and more scalable I/O, though the release has not yet shipped.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.