Announcement

Collapse
No announcement yet.

PHP 8.1 Benchmarks - Continuing The Nice Performance Trajectory

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by uid313 View Post
    PHP seems to have evolved greatly and become a nice, modern, good programming language!
    I know it has faced some criticism before, but I think it has evolved good and deserves a second chance and I think much of the previous criticism no longer apply.

    The only thing PHP now lacks is generics, generic attributes, and async/await.
    Although I do find "traits" in PHP to be rather weird, they are completely different from what is known as traits in Rust. Also I think traits in PHP was a bad idea, because it introduces "glue", and I think it would be much better solved with horizontal composition through dependency inversion principle where you have a constructor that takes in the dependency.
    Nah, it's getting faster - but it's still an extremely flawed language. There's few reasons why you'd pick it over the plethora of better languages. Other than just because it's what you know.

    Comment


    • #12
      Imo, the biggest flaw at the moment is attempt on sugaring the language for those who could not switch their mindset over years.
      Static types do not fit into PHP no how you look at it. Although, granted it's purely optional and the overhead induced only affects those who use it, why not?
      The more freedom there is in the language, the better, so adding that way of doing things without sacrificing the language idea is not bad per se.
      Yes, this indeed reduces language 'consistency' a bit more, but freedom comes at a price.

      From my PoV there are only 3 big things PHP lacks for years at the moment:
      - Horizontal class extension (multiple inheritance, traits are not powerful enough to compensate)
      - Operator overloading - there is RFC already posted on it for next versions as long as I know, so it will be fixed soon)
      - Native threads support, although with coming of Fiber adding such would be the next logical step to take

      Everything else is minor enough.
      Last edited by Alex/AT; 29 November 2021, 02:10 AM.

      Comment


      • #13
        Originally posted by Turbine View Post
        Nah, it's getting faster - but it's still an extremely flawed language. There's few reasons why you'd pick it over the plethora of better languages. Other than just because it's what you know.
        I don't see any proper alternatives in the realm of languges that do not require an actual compilation process for testing code. Python is now on par with PHP in every regard (and better in many ways) but it's so damn slow that would you actually want to use it in production?

        it's also not just the language but the tools as well. PHP has some really advanced frameworks to work with. But I do not have any experience with Python's web frameworks, so I am not able to comment on that. All I know is that with PHP the frameworks are of really high quality.
        Last edited by curfew; 29 November 2021, 02:18 AM.

        Comment


        • #14
          Originally posted by curfew View Post
          I don't see any proper alternatives in the realm of languges that do not require an actual compilation process for testing code. Python is now on par with PHP in every regard (and better in many ways) but it's so damn slow that would you actually want to use it in production?

          it's also not just the language but the tools as well. PHP has some really advanced frameworks to work with. But I do not have any experience with Python's web frameworks, so I am not able to comment on that. All I know is that with PHP the frameworks are of really high quality.
          Are there benchmarks that corroborate this statement? Properly tuned python can be incredibly fast.

          Speaking of web frameworks, it doesn't get any higher quality than python's flask

          Comment


          • #15
            it doesn't get any higher quality than python's flask
            That's everything you need to know about python and its ecosystem quality, basically.

            Comment


            • #16
              Originally posted by uid313 View Post
              The only thing PHP now lacks is generics, generic attributes, and async/await.
              PHP already knows (generic) attributes and with 8.1 fibers and concepts similar to async/await were introduced.

              Comment


              • #17
                Originally posted by Gass View Post

                this https://www.jesuisundev.com/en/why-developers-hate-php/ helped to understand the problem.
                So ... it started with a bad design ... and evoluted from there.
                Oh my. Yes, PHP is just as bad as JavaScript which will die soon. I mean how on earth can languages so flawed sustain the onslaught of oh so superior alternatives...
                Anyway, do a fair share in ColdFusion programming and then come back and complain about PHP. You have seen nothing yet, if you have never delved into CFML.

                Comment


                • #18
                  Originally posted by Tuxee View Post

                  PHP already knows (generic) attributes and with 8.1 fibers and concepts similar to async/await were introduced.
                  I think using fibers is more unfamiliar to developers who are used to using async/await keywords from other programming languages.
                  I think PHP 8.1 only supports attributes, not generic attributes.

                  Comment


                  • #19
                    Originally posted by grigi View Post
                    How bad can PHP really be?
                    This is what I told myself when I took the new job.

                    Turns out, way worse than I thought.
                    What's wrong with it?
                    Maybe it is their code base, I think PHP seems to be a decent language that you can write modern code in and write good stuff.

                    Originally posted by ResponseWriter View Post
                    Glad I gave up on PHP years ago but these advancements look good. It might've made it almost bearable building Magento sites without their many layers of caching.
                    I also gave up PHP years ago, more than a decade actually. But I think the development has progressed good and the language have become much better since.

                    Originally posted by caligula View Post
                    Like the article mentions, it was around 20 times slower just few years ago. Hosting sites were still installing php5 or even older distros. Some cms sites also didn't support the later versions. For example I tried to set up dokuwiki. Turns out some of the plugins didn't work with php7. So back to 5.6. You might have different priorities, but a language that's 20x slower than it needs to be just sucks. PHP has only managed to get this far thanks to excessive caching.

                    Not only that, they have been cleaning up the absolute shit PHP 1-4 was for the last 15 years. Please try php 2 or 3 to see how absolutely horrible it used to be.
                    Sounds like your problems is with certain applications such as dokuwiki, not with the language itself.

                    With today's eyes, PHP 1-4 was pretty shitty, but back then it was great compared to writing CGI scripts in C or Perl.
                    If you look with today's eyes at Java 1-4 or .NET Framework 1-3.5, or early versions of other old languages, then those were pretty shitty too.

                    Comment


                    • #20
                      Originally posted by Turbine View Post

                      Nah, it's getting faster - but it's still an extremely flawed language. There's few reasons why you'd pick it over the plethora of better languages. Other than just because it's what you know.
                      It have had a lot of more flaws if you look back in time, but PHP has evolved nicely and got rid of much of the complaints and flaws. I think that today it seems like a fairly good language. It seems like a good language to keep using if you're already using it.

                      As for someone not knowing it and learning it, then there are other languages that make more sense to learn because PHP is very domain-specific to the web, while other languages can be used for mobile apps, desktop applications, AI/ML, robotics, etc.

                      Originally posted by Alex/AT View Post
                      Imo, the biggest flaw at the moment is attempt on sugaring the language for those who could not switch their mindset over years.
                      Static types do not fit into PHP no how you look at it. Although, granted it's purely optional and the overhead induced only affects those who use it, why not?
                      The more freedom there is in the language, the better, so adding that way of doing things without sacrificing the language idea is not bad per se.
                      Yes, this indeed reduces language 'consistency' a bit more, but freedom comes at a price.

                      From my PoV there are only 3 big things PHP lacks for years at the moment:
                      - Horizontal class extension (multiple inheritance, traits are not powerful enough to compensate)
                      - Operator overloading - there is RFC already posted on it for next versions as long as I know, so it will be fixed soon)
                      - Native threads support, although with coming of Fiber adding such would be the next logical step to take

                      Everything else is minor enough.
                      I don't like traits in PHP either, I think they are not so useful, and it leads to glue, like "new is glue", I think it would be better with inject the dependency through the constructor. Multiple inheritance is probably not a good idea though.

                      I agree that operator overloading would be a nice addition to PHP.

                      As for fibers, maybe the next logical step is async/await keywords, since it seems most other languages seem to support that.

                      Originally posted by curfew View Post
                      I don't see any proper alternatives in the realm of languges that do not require an actual compilation process for testing code.
                      Maybe Python, Node.js (JavaScript), and Ruby? If one really wanted to push it, then maybe Perl and Tcl.

                      Comment

                      Working...
                      X