# PHP 8.6 brings partial function application and a new Duration class

Original title: What's New in PHP 8.6

> Hacker News story 50557870 · language: en · submitted 2026-11-19
> Web version: https://zeli.app/story/50557870
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 293 · by [netol](<https://news.ycombinator.com/user?id=netol>) · 💬 144
[original](<https://www.php.net/releases/8.6/en.php>) · [HN discussion](<https://news.ycombinator.com/item?id=50557870>)

## Summary

PHP 8.6, due November 19, 2026, adds partial function application with `?` and `...` placeholders, a `\Time\Duration` class for nanosecond-precision elapsed time, a scalable `Io\Poll` API for event loops like ReactPHP and AMPHP, and a `clamp()` function. It also introduces a `SortDirection` enum, readonly property defaults, structured stream errors, and deprecations including `return` in `finally` and mbstring regex functions.

## Key quote

> Using `return` inside a `finally` block is now deprecated, as it silently discards exceptions and overrides values returned from the `try` or `catch` block.

## HN discussion (144 comments)

### [yabones](<https://news.ycombinator.com/item?id=50560596>)

> Appears the big scary vulnerability that was announced recently is in 8.5+, so definitely upgrade your stuff if you're on a new version... For the rest of us in "debian land" running 8.3-8.4, looks like there's nothing to worry about for now.
>
> https://github.com/php/php-src/security/advisories/GHSA-8mjj...
>
> https://github.com/php/php-src/security/advisories/GHSA-2fjv...
>
> The other Critical CVE looks very very difficult to actually exploit, since it has to do with a very specific configuration during startup.
>
> https://github.com/php/php-src/security/advisories/GHSA-gr4f...

### [beberlei](<https://news.ycombinator.com/item?id=50558004>)

> Most excited about the ZTS overhead reduction. If you are unfamiliar PHP can run either with or without thread safety (think using pthreads in PHP requests).
>
> If the overhead can be further reduced (and people have ideas) then it could be that we only need ZTS mode anymore in the future and that can open up one avenue for PHP to get native async support similar to the existing parallel extension: https://github.com/krakjoe/parallel
>
> More "hands-on" is the stream error handling improvements. This greatly improves the old file stream APIs to now allow throwing exceptions instead of returning false on errors:
>
> $context = stream_context_create([
>
> 'stream' => [
>
> 'error_mode' => StreamErrorMode::Exception,
>
> ],
>
> ]);
>
> try {
>
> $config = file_get_contents('/etc/app/config.json', context: $context);
>
> } catch (StreamException $e) {
>
> // handle error
>
> }

### [p4bl0](<https://news.ycombinator.com/item?id=50560259>)

> I'm a bit sad that there's still no way to limit the number of arguments of a user-defined function in the type system. The internal functions have that.
>
> I know that introducing such a behavior by default could break existing code, but it seems relatively easy to introduce this feature in a backward compatible way by using the void type. For example :
>
> function foo (void) {}
>
> foo(42); // fatal error: foo() expects exactly 0 arguments, 1 given
>
> function bar ($a, $b, void) {}
>
> bar(1, 2, 3); // fatal error: bar() expects exactly 2 arguments, 3 given
>
> function baz ($a, $b=null, void) {}
>
> baz(1, 2, 3); // fatal error: baz() expects at most 2 arguments, 3 given

### [nticompass](<https://news.ycombinator.com/item?id=50559440>)

> I /finally/ just upgraded our PHP app from 7.4 to 8.3 (totally not just because of the PHP vulnerabilities).  I can't wait to jump to 8.5, so I can use the pipe (`|>`) operator.
>
> I'd love to upgrade to 8.6 so I can use function partials!

### [petecooper](<https://news.ycombinator.com/item?id=50560483>)

> Source tagged:
>
> https://github.com/php/php-src/releases/tag/php-8.6.0

### [williamdclt](<https://news.ycombinator.com/item?id=50560160>)

> I can't make up my mind on FPA. On the one hand it's very elegant and I always feel like I need it when writing code, on the other hand it makes a function declaration look reaaaaally close to a function invocation, which is super confusing

### [kijin](<https://news.ycombinator.com/item?id=50558123>)

> Before you all get excited about the new version, patch the old version you're running now!
>
> The PHP team announced that they're going to release a critical fix between 14:00 and 14:30 UTC today. Doesn't say whether 8.6 is affected too, but the vulnerability is probably at the top of their mind right now -- even more so than the 8.6 release.

### [m4rtink](<https://news.ycombinator.com/item?id=50559488>)

> CVEs!

---

## Cite

- Page: https://zeli.app/story/50557870
- Date: 2026-11-19
- Source: php.net (https://www.php.net/releases/8.6/en.php)
- Hacker News: https://news.ycombinator.com/item?id=50557870

## Other languages

- zh: https://zeli.app/zh/story/50557870 · markdown: https://zeli.app/zh/story/50557870.md
- ja: https://zeli.app/ja/story/50557870 · markdown: https://zeli.app/ja/story/50557870.md
- ko: https://zeli.app/ko/story/50557870 · markdown: https://zeli.app/ko/story/50557870.md
- de: https://zeli.app/de/story/50557870 · markdown: https://zeli.app/de/story/50557870.md
- es: https://zeli.app/es/story/50557870 · markdown: https://zeli.app/es/story/50557870.md
- ru: https://zeli.app/ru/story/50557870 · markdown: https://zeli.app/ru/story/50557870.md
