Hacker News new | past | comments | ask | show | jobs | submit

What's New in PHP 8.6

https://www.php.net/releases/8.6/en.php
loading story #50560596
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
  }
loading story #50561955
Spawning threads in PHP is a mistake. The beauty of PHP is that a given request is single-threaded. Any IO/network bound calls allow off-thread code within that same async-await model. If you want to spawn threads, put it in an extension.
That's certainly a use case but I worry async opens the door for all the non PHP to come on in
loading story #50560259
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!

`|>` without PFA frequently ends up with longer code and isn't pretty because of the need to handle the first arg not been the one you want via closures which works but isn't really any better than just nesting them, so if I where you upgrading I'd get to 8.6 first and then start using pipes since you get both parts in that release.

It was a smart decision to roll it out incrementally but it did create a weird gap there for a little bit but they did do it so kudos to the team.

a lot of stuff will require changes when jumping from 8.3 to 8.4 and above. Don't forget to use Rector[0] if you haven't already. Helped me tremendously when going 7.4 > 8.4

0 - https://getrector.com

loading story #50560412
loading story #50563771
loading story #50560483
loading story #50560160
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.

The PHP 8.6.0 stable release will include the fixes for all applicable vulnerabilities.
And add a few more unknown CVE, as perpetual Beta and DevOps culture does by design.

The old approach of out-pacing adversaries though mutation rates is over, given an entire FOSS code-audit looking/fuzzing for 0-days can now be done in under a day. In retrospect, over 700 reported LPE and 280 kernel CVE were dropped in the past 3 months from "LLM". This is not going to stop anytime soon.

To be honest, its very nostalgic as kids would clown each others servers in the early days. Ultimately leading to a more robust OS for everyone. =3

There are two separate teams handling both, the Release Managers and website team do PHP 8.6 and the Security team works on the vulnerability. :)
”These releases are part of PHP’s regular four-week release cycle and will address security“

So I’m not sure what you mean by “before you get excited”? This is their normal release cycle, not some new emergency patch release. Although based on recent events, I see how this could be confused.

The notes say "The highest severity is CRITICAL.... Users are strongly encouraged to prepare to upgrade promptly once the releases become available. Technical details and fixed version numbers will be published alongside the releases."

I'd say this sounds pretty serious.

loading story #50561270
we run serverpilot, it auto patches our php server.
loading story #50560182
CVEs!
{"deleted":true,"id":50559691,"parent":50559488,"time":1795094160,"type":"comment"}
Can we not have animations that slow down my scroll on these kinds of pages? It's so pointless.

Edit: Thank you for pointing out the `prefers-reduced-motion` media feature, I did not have that enabled.

I didn't notice any animations?
The page respects the `prefers-reduced-motion` media feature [1]. You might have enabled that preference.

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/A...

Designers should not design things that users want to disable
The vast majority of people prefer animations. If everything got left out that anyone wants to disable, we'd be left with `return 0`, if even that.
The vast majority of designers prefer animations. Without animations, there would be less jobs for designers. But I haven't seen any evidence that ordinary people prefer animations. Most ordinary people aren't even aware that it's possible to turn animations off, because the designers make this difficult.
> But I haven't seen any evidence that ordinary people prefer animations.

There are mountains of evidence supporting the idea that people prefer animated UIs over static UIs going back decades. This is true even in the world of TUIs, again, going back decades. I genuinely don't understand how you can make this statement so confidently.

loading story #50560168
loading story #50559996
i despise most animations. Its only something that "product people" want
{"deleted":true,"id":50560062,"parent":50559205,"time":1795096062,"type":"comment"}
I thought PHP died long back
It powers more than half of the Internet's known websites (mostly thanks to Wordpress)
I know there were many "PHP is dead" posts in the past, but I think PHP now is really is declining.

I started my career as a PHP developer, it was a popular language especially in web development and at web agencies, and the main reason was that it was relatively cheap to employ PHP devs.

Now with LLMs it is similarly cheap (if not cheaper) to write code in Go, Rust, or any performant languages that are much more sophisticated than PHP and have many other benefits. I don't see any reason anymore to start any new project in PHP.

Other than that this "borrow every single feature from other languages and add it to PHP" strategy is not really a good direction IMO.

None of those languages allow me to edit files directly via (S)FTP and see the changes go live within 2 seconds.
sure they do, i’ve implemented script-based handlers in go, rust, etc!
Flashback to the 90s!
The real PHP way is actually ssh'ing to the server and editing with nano
I have a small saas for construction companies. I run it on shared hosting with Cpanel. I have logged into namecheap, opened cpanel, gone to file browser, opened a php file via the file browser text editor, and fixed bugs in front of customers live. Only once did I forget to implement that same change on my actual official copy on my office computer.

There’s different skill levels out there. But if you can sell, you can still make a living with unsophisticated code and practices.

Yeah, because we all realized that's a cause of trouble and pain and is not a feature to laud.
Until another language reproduces the whole WordPress, Drupal, Magento, Moodle etc ecosystems PHP isn't going away.
Are those ecosystems so important these days? They're mostly for human developer re-usability and ergonomics, right?

When I asked Claude to create a simple online shop the other day, I suggested it use an open source shop framework. Claude explained that Stripe does most of the heavy lifting, and implementing the shop site would be simpler if bespoke. So I let it do that and the result was fantastic. And also highly customisable (with Claude).

Times are a-changing.

There are a LOT of PHP shops and they aren't going to rewrite working sites tomorrow. Even when they do, there's a good chance they'll guide their agent to keep using PHP because that's what they know. It's simple tech for simple use cases, human knowledge is still an important factor if you still value understanding what you're putting out.
> Even when they do, there's a good chance they'll guide their agent to keep using PHP because that's what they know.

Claude knows more about php than a random php shop. Or Go, Python etc.

I never use it but my php hosting provider has this wall of icons for one click install. No developer needed on that layer. LLM has the same disadvantages as writing it yourself or the hosting provider writing something themselves. It might have more features, make a better fit and be more flexible, it isn't [say] wordpress.
It has some historical warts but it's still a perfectly decent language with lots of modern features too. I quite like the semi-typed style, strong types for function arguments and returns, and duck typed within. Keeps things concise and well-checked enough. I just finished porting a 120kLoC project into php, and I'm quite happy with it. Using Slim as a micro framework, with a custom layer on top.
I see where you're coming from and I agree to some extent, but having a language (or standard library) rich in features also means we don't have to rely on third party solutions that much. I think this is a pretty good thing/approach - as long as it's well tested of course.
Obviously Go and Rust are more modern and performant languages, but they simply can't compete with the versatility of PHP and its ecosystem for a lot of use cases. Many web applications need a large part of the built-in functionality of PHP and one of its frameworks (Laravel or Symfony) in a tightly integrated application. Implementing one part at a time in Go or Rust is a viable option now for some, but far from all use cases. Time is better spent using that same LLM to use Laravel to its fullest.

Your career having moved on from CMS stuff in PHP is not really a good measure for what people actually need : )

To be honest, the PHP "ecosystem" is on par, or even worse than npm (javascript) is. I rarely see as low quality code as i have seen in php, 90-95% of composer packages are just horrible, and most would never pass our QA.

There is a handfull of "ok i guess we can use this" packages, but they also tend to be slow and java-esque horrible class based needles abstarctions all the way down.

I don't think the availability of low quality packages is an argument against either ecosystem. What counts is the availability of high quality packages like the PHP-FIG ones as well as Symfony components and the Laravel framework.
im not very familiar with web dev, but from what ive seen, most web dev packages are total poo.

i feel like this is due to being a get (rich) web scheme. promising quick development so that the business can startup quickly.

anyone else feel the same?

also thoughts on a minimal php subset just for basic interactivity, so that ur not running such a complex environment with so many security avenues

Laravel? Is that the pinnacle of PHP? Its abstractions upon abstractions with LOTS of lipstick. Thats why a vanilla Laravel hello world app gives you something ridiculous like 600 req/seq thruput. How is this even on the table?
I've been maintaining (/suffering) a PHP project for ~25 years, which started with PHP because it was the most universally deployable runtime available on bargain-basement web hosts, where a novice user can upload a file over FTP and immediately have a running webapp. Has any other language even attempted to fill that niche yet? D:

(Has the world bifurcated into "point & click configuration of proprietary web hosting like squarespace" for simple sites and "full kubernetes deployments" for more technical things, and nobody cares about entry-level deployment any more?)

I think the static site generators with static hosting have become that. When there's interactivity needed, for most purposes, you can today defer to client side logic, so there's no real need for a backend in 90% of the cases.
What is a better direction in your opinion?
You're getting downvoted to oblivion but honestly I agree, I think the only reason anyone has for starting a new project in PHP in 2026 is familiarity. You cannot claim to be picking the best language for the job.
I agree with you for the most part; I think PHP went into decline several years ago already.

TIOBE, while useless, has a trend (there it is somewhat useful; still overall useless, but not 100% useless):

https://www.tiobe.com/tiobe-index/php/

It shows two big hits, one in 2010, one in 2014. I myself switched to ruby in 2005. Ruby is now in a similar situation too. PHP is at rank #12, so that is still decent. I think it is declining only slowly though.

> Now with LLMs it is similarly cheap (if not cheaper) to write code in Go, Rust, or any performant languages that are much more sophisticated than PHP and have many other benefits. I don't see any reason anymore to start any new project in PHP.

Well, the problem with LLMs is that these users will become dependent on e. g. Anthropic, and Anthropic already showed it will censor at will, e. g. "you are not allowed to 3d print anything that looks like a gun" agenda.

I do not think LLMs are what killed PHP or will kill it. The language is simply poorly designed. Not all projects will become LLM though, this is the part I disagree with you. For instance wikipedia will not suddenly be rewritten in LLM-Rust.

loading story #50564643
Gotta love all the "PHP bad" comments that appear on any PHP post (regardless of what it's about). I, for one, am I excited about this release. Modern PHP (php8+) is pretty nice and a lot of the old "PHP bad" issues from back in the day are non-existent.

Though, I guess I've been a PHP developer for a long time now. Professionally, since 2012 and has a hobby years before that. I refuse to stop learning/using PHP!

Yes, there are other web server languages. Yes, PHP had its issues. Yes, legacy PHP can be pretty awful (ask me how I know). But, it's not going anywhere and all the "PHP bad" comments are not helpful.

Indeed, I started typing out a few replies only to delete them after remembering what you've articulated.

PHP (still!) rocks; I'm quite happy it's still relevant (and powers much of the internet.)

But I'm an old man who got into the language during the 3-4 migration around 2000.

loading story #50560408
Partial application in PHP? WOW.
I guess the clamp function really is needed, as even in their release notes, they did the clamping using min/max incorrectly.

Their PHP8.5 examples are written as:

  var_dump(max($value, min($lower_bound, $upper_bound)));
but that should be:

  var_dump(max($lower_bound, min($value, $upper_bound)));
/facepalm
> Their PHP8.5 examples are written as:

That is false. The bounds are [0, 100] in both examples and 0 is correctly put as the first parameter to max() in 8.5.

loading story #50560741
Ah yes the clamp() function good thats in
Why is this language still around?

I get the popularity and installed-base arguments, but I shudder when I see the code.

Perhaps it will contain something new that will come back to haunt us in six or so months.
Still no builtin unicode support? What the hell is this? A web language that does not default to unicode, thats pretty weak for a language in 2026
The php convention is that strings are bytes, but we store utf8 in them. Convert or validate at ingestion, transform using the mb_* family of functions, and be happy.
I have heard this exact answer for decades. The mb_slop_uppercase() is not, and should not be acceptable for any modern language.
It's a big world out there, it's not like you don't have a choice. I quite like the model.

Perl was famous for excellent native unicode support in its native string type, but the result was that you had to keep track of whether your variable was native unicode or octets, and many CPAN modules would try to transparently support both, in buggy ways. A richer system is not always an advantage.

The idea of UTF-16 strings in PHP 6 were a mistake. UTF-8 works in PHP just fine. New languages (e.g. Rust, Go, Swift) stick to UTF-8. UTF-16 is legacy that would be nice to get rid of where it's used (Java, C#, JS, WinAPI), but that is impossible because of backwards compatibility.
Hindsight is 20/20, it's easy now to say that if Unicode had been utf8 from the start, no 16-bit encoding would have been needed anywhere. But someone had to think of it first, and in the real world, 16-bit came first and became quite entrenched.
loading story #50561389
What's New in PHP 8.6?

- no RCE

Hopefully not another php2shell
Don't forget the new vulnerabilities that AI will find :).
You say this and there are nginx, Java and Ruby RCE vulnerabilities in the news this week, so I am unsure you are winning points with the 1990s trope that PHP is more insecure than other projects or languages.
[flagged]
Unsure how that is a useful comment where there is literally an nginx RCE out released yesterday that allows the same thing.
And a Ruby RCE today. There’s been plenty of Node and Django security vulnerabilities in the past too. And simply demanding everyone rewrites everything in Rust isn’t reasonable - even in “the agentic era”.