PHP 8.4 Released With Property Hooks, Lazy Objects & Other New Features

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • phoronix
    Administrator
    • Jan 2007
    • 67070

    PHP 8.4 Released With Property Hooks, Lazy Objects & Other New Features

    Phoronix: PHP 8.4 Released With Property Hooks, Lazy Objects & Other New Features

    PHP 8.4 is out today as the newest annual major feature release to this widely-used scripting language...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite
  • Ferrum Master
    Phoronix Member
    • Feb 2024
    • 88

    #2
    Common got more fat, the only thing that needs altering my install scrips so far. For my pedestrian needs it works...

    Comment

    • GraysonPeddie
      Senior Member
      • Jan 2014
      • 713

      #3
      Interesting. Not that I'll ever use it for a blogging site, but hey, it's cool.

      Comment

      • samuelec
        Junior Member
        • Feb 2022
        • 33

        #4
        PHP improved so much it has long history and graduate from template language to programming language many years ago however some people are still unhappy.
        I believe it is mostly due to the bad management of its accidental creator Rasmus Lerdorf which until a couple or so years ago was still referring at it as a joke, in a way that somehow would boost his ego of "real programmer" (see his youtube rants).
        He, especially during version 4 and 5, didn't understand or care that the language he created needed more serious work, needed to improve because it was spreading and that was the direction it was going.
        Instead many years passed by without any development.
        Eventually many other skilled devs came along to work at the PHP core and they built what it's shining now, those are the people I say thank you.

        Comment

        • uid313
          Senior Member
          • Dec 2011
          • 6909

          #5
          A very good update with lots of new great improvements. Personally I think the new asymmetric visibility thing is confusing.

          I think that the syntax for property hooks is a bit verbose since you have to repeat the data type and the variable name, this is much cleaner in C#.

          I would like to see PHP support for expression-bodied functions like they have in C# so that you can write a function on one line with => arrow and skip the return keyword.

          I think PHP have some problems:
          • JSON support is very poor, you can only serialize to stdClass or an associated array, not to your own classes so you don't have type safety, and you cant override property names if you want to serialize a kebab-case JSON into a camelCase property.
          • There is no support for UUID (I know there are third-party libraries available, but I think it should be in the standard library).
          • HTTP support is very poor, you have to use the very awkward libcurl, I would like to see a modern HTTP request support in the standard library, like the Fetch API in JavaScript, the HttpClient class in .NET, or the requests/httpx library in Python.

          Comment

          • all3f0r1
            Junior Member
            • Sep 2019
            • 37

            #6
            Genuinely curious, I have a bad memory of how it felt to develop in PHP 5, years ago. Is it any better now? I know perfs have been a major focus, but apart from that, does it still feel like an opinionated "lego" language with no active enforcement of things like MVC?

            Comment

            • tuaris
              Junior Member
              • Feb 2021
              • 20

              #7
              PHP itself is still great. Few people understand that it's the most strictly typed scripting language with real built in threading. In my opinion, PHP is as close you can get to a real object oriented language like C++ that's not Java, without having to be deep in the low level intricacies of memory management and systems programming.

              Sadly the tooling/ecosystem around it is concerning. It's becoming too much like Node/Ruby (ie. Composer). There have also been some recent additions to the language that are being imported from NodeJS (arrow functions). Rather than trying to turn PHP into NodeJS, why not add something useful like native big INT support.
              Last edited by tuaris; 21 November 2024, 12:16 PM.

              Comment

              • Jonjolt
                Phoronix Member
                • Aug 2013
                • 76

                #8
                Originally posted by tuaris View Post
                PHP itself is still great. Few people understand that it's the most strictly typed scripting language with real built in threading.

                Sadly the tooling/ecosystem around it is concerning. It's becoming too much like Node/Ruby (ie. Composer). There have also been some recent additions to the language that are being imported from NodeJS (arrow functions). Rather than trying to turn PHP into NodeJS, why not add something useful like native big INT support.
                The big thing I've noticed with PHP is the increase memory usage and external services for some of these projects, so much so I think the JVM would be a better option.

                Comment

                • tuaris
                  Junior Member
                  • Feb 2021
                  • 20

                  #9
                  Originally posted by all3f0r1 View Post
                  Genuinely curious, I have a bad memory of how it felt to develop in PHP 5, years ago. Is it any better now? I know perfs have been a major focus, but apart from that, does it still feel like an opinionated "lego" language with no active enforcement of things like MVC?
                  PHP is a lot like C/C++. Nothing stops you from writing bad code. Not forcing you into a certain style is it's biggest strength in my opinion.

                  Laravel is probably what you are looking for. It's a very good MVC. I won't say it's PHP's "Rails" (as in Ruby on Rails) since that would be an insult to Laravel .
                  Last edited by tuaris; 21 November 2024, 01:27 PM.

                  Comment

                  • royce
                    Senior Member
                    • Aug 2018
                    • 642

                    #10
                    Originally posted by samuelec View Post
                    PHP improved so much it has long history and graduate from template language to programming language many years ago however some people are still unhappy.
                    I believe it is mostly due to the bad management of its accidental creator Rasmus Lerdorf which until a couple or so years ago was still referring at it as a joke, in a way that somehow would boost his ego of "real programmer" (see his youtube rants).
                    He, especially during version 4 and 5, didn't understand or care that the language he created needed more serious work, needed to improve because it was spreading and that was the direction it was going.
                    Instead many years passed by without any development.
                    Eventually many other skilled devs came along to work at the PHP core and they built what it's shining now, those are the people I say thank you.
                    Rasmus famously ranted against use of frameworks as well. Nobody should take seriously anything he says these days.

                    Comment

                    Working...
                    X