What's New in PHP 8.6

(php.net)

82 points | by netol 2 hours ago

13 comments

  • beberlei 2 hours ago
    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
      }
    • calvinmorrison 27 minutes ago
      That's certainly a use case but I worry async opens the door for all the non PHP to come on in
  • kijin 1 hour ago
    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.

  • vdanielpop 1 hour ago
    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.

  • trippsydrippsy 41 minutes ago
    [dead]
  • zsoltkacsandi 1 hour ago
    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.

    • ExtremelyFat 1 hour ago
      None of those languages allow me to edit files directly via (S)FTP and see the changes go live within 2 seconds.
      • phplovesong 41 minutes ago
        Flashback to the 90s!
      • slopinthebag 1 hour ago
        sure they do, i’ve implemented script-based handlers in go, rust, etc!
      • fabioborellini 47 minutes ago
        The real PHP way is actually ssh'ing to the server and editing with nano
    • cutler 39 minutes ago
      Until another language reproduces the whole WordPress, Drupal, Magento, Moodle etc ecosystems PHP isn't going away.
      • cbeach 21 minutes ago
        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.

        • speed_spread 3 minutes ago
          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.
    • Shish2k 1 hour ago
      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?)

      • mariusor 14 minutes ago
        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.
    • ulimn 1 hour ago
      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.
    • ahofmann 1 hour ago
      What is a better direction in your opinion?
    • shevy-java 1 hour ago
      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.

    • trippsydrippsy 40 minutes ago
      [dead]
    • abujazar 58 minutes ago
      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 : )

      • phplovesong 41 minutes ago
        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.

        • abujazar 25 minutes ago
          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.
  • shdon 0 minutes ago
    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
  • rarisma 7 minutes ago
    Perhaps it will contain something new that will come back to haunt us in six or so months.
  • HackerThemAll 32 minutes ago
    > What's New in PHP 8.6

    New CVEs/RCEs? https://www.php.net/archive/2026.php#2026-11-18-1

  • phplovesong 45 minutes ago
    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
  • origini 1 hour ago
    Ah yes the clamp() function good thats in
  • majestic5762 1 hour ago
    What's New in PHP 8.6?

    - no RCE

  • skeledrew 1 hour ago
    Don't forget the new vulnerabilities that AI will find :).
    • beberlei 1 hour ago
      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.
  • shevy-java 1 hour ago
    It would be nice if PHP would no longer have bugs that allow attackers to take over a webserver.
    • beberlei 1 hour ago
      Unsure how that is a useful comment where there is literally an nginx RCE out released yesterday that allows the same thing.
      • michh 1 hour ago
        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”.