What's New in PHP 8.6

(php.net)

35 points | by netol an hour ago ago

12 comments

  • beberlei 32 minutes 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
      }
  • zsoltkacsandi 12 minutes 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.

  • kijin 16 minutes 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 10 minutes ago

    Can we not have animations that slow down my scroll on these kinds of pages? It's so pointless.

  • majestic5762 5 minutes ago

    What's New in PHP 8.6?

    - no RCE

  • skeledrew 23 minutes ago

    Don't forget the new vulnerabilities that AI will find :).

    • beberlei a minute 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.