Announcement

Collapse
No announcement yet.

PHP 8.3 RC1 Released With json_validate, Anonymous Read-Only Classes

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

  • #11
    Originally posted by markg85 View Post
    As for composer, nope, never heard of it never used it. From a quick glance it looks... old too :P but i suppose it's better then PECL.
    Care to elaborate? Since composer has nothing to do with PECL whatsoever. It doesn't even compare. PECL are binary extensions for PHP and - yes - it's obsolete. Composer is just like your npm. It takes a composer.json which adheres to semantic versioning, checks for conflicts, pulls the packages from a central repository, installs them and provides a single autoload file for your convenience (plus a shitload of additional functionality). Naturally composer packages are just like any npm package maintained and are equally up to date - depending on the maintainer.

    Perhaps you should refrain from posting to topics you absolutely have no clue about.

    Comment


    • #12
      I have to support markg85's views here somewhat. PHP has definitely fallen behind.

      Is PHP better than it was.
      yes.

      Is PHP packaging terrible...
      Complicated, composer is fine for pure-php libraries and dependencies, but the moment you need to link with an external library you gotta use PECL, and that's just plain horrible.

      Is latest PHP good?
      Nope, still not.
      The Array type will mutate between lists and maps as you work on the data. This is a serious problem for unsuspecting bugs.
      Logging is still a crapshoot where for unknown reasons Monolog decides to send logs to the "wrong" stdout. (the FCGI one instead of the K8s console)
      PHP doesn't have fundamental set types, (just like it doesn't have distinct list/map types) which makes some things a lot harder to write than it really needs to.

      Is PHP stable?
      Decent, although less than it used to be, since PHP7 segfaults have become significantly more common.

      Is PHP easy to test your code in?
      Comparable to JS, but clearly inferior to something like Python

      Should you start a new project with PHP?
      Up to you, but if it's not a "typical" PHP project, probably not.

      Comment


      • #13
        Originally posted by markg85 View Post
        As for composer, nope, never heard of it never used it. From a quick glance it looks... old too :P but i suppose it's better then PECL.
        So u are a troll

        Comment


        • #14
          Overall I really like PHP and the way it has evolved over years. One thing I don't like about PHP though is that has no way to generate UUID values in the standard library.

          Originally posted by markg85 View Post
          PHP, a once favorite language of mine that sparked my programming interests. A language that also completely ruined itself by being so freaking stubborn with adopting new technologies. And a language that raises the bar very significantly if you want to install different modules.

          Before we had nodejs, PHP was just the king. The best thing there was.
          With nodejs it became so incredible easy to extend that language with other plugins that using PHP felt like back to the stone age.

          Don't get me wrong here, both languages have their pros and cons still to this very day. But nodejs and the rapid development of javascript along with the wealth of easy to install packages is just far far far superior to PHP with their very limited PECL repository.

          And yeah, i've had some personal deep frustrations with PHP. Like essentially being forced to write PHP 4.x compatible code at a moment when PHP 5 was out for years and 6 was about to be released. Many things compounded to this like companies not willing to update their codebases and webhosting providers offering either both (4.x and 5.x) or just 4.x. Which surely had an effect on my perception of PHP. The introduction of namespaces is what made it dead to me though, such a stupid decision on their part. (not the addition of it, but how they decided to add support for it is just alien compared to other languages)

          Or long story made short. PHP is a relic of the past that had it's high days. Now it's time for it to slowly fade away from existence.
          I used PHP back in the days too and was once my favorite language. I really love how the language have kept up with the times and evolved. I love the additions of classes, namespaces, type hints, etc. I love the simple one-line syntax of the namespace too, and it was a treat to see .NET 6 adopt a similar file-scoped namespaces.

          I don't think PECL is popular in the PHP community anymore, nowadays people use Composer. It is modern, and easy to use. It is quite similar in use to npm.
          As for Node.js, it sucks, you try to download one little package with npm and it downloads a million dependencies. I haven't tried Deno but it sounds interesting.

          I don't code much PHP these days, but I love how PHP has evolved with the times. It has grown scripting version of C for CGI programs into quite a nice programming language.

          Comment


          • #15
            Originally posted by Tuxee View Post

            Care to elaborate? Since composer has nothing to do with PECL whatsoever. It doesn't even compare. PECL are binary extensions for PHP and - yes - it's obsolete. Composer is just like your npm. It takes a composer.json which adheres to semantic versioning, checks for conflicts, pulls the packages from a central repository, installs them and provides a single autoload file for your convenience (plus a shitload of additional functionality). Naturally composer packages are just like any npm package maintained and are equally up to date - depending on the maintainer.

            Perhaps you should refrain from posting to topics you absolutely have no clue about.
            Perhaps a lot has happened in 15 years in terms of PHP development that I've only very sparsely been reading up on. In other terms, my experience is outdated to those times and therefore my conclusion are too.

            Let's take a couple examples.
            1. Say you want to write a site or application with MongoDB or any nosql database for that matter. Your options are: to install the pecl mongodb driver and then optionally the composer mongo db driver for some fancy extra classes. I don't know if the pecl part is solved by composer too. Fact remains, it's convoluted at best to get it installed.
            2. Another example, say you want to use bloom filters (quite a handy feature, specially in large data applications), composer has you well covered there.
            3. Now try adding in real-time communication, often done through websockets. You can't in PHP because it's not an event driven language. It doesn't stay running after processing your request. There are libraries to make this possible like the ev package on pecl. And there are libraries who provide complete solutions for this like Ratchet and ReactPHP. But it gets convoluted again, and fast too! A common solution is a different backend in another language (could be js,/node but could also be go/rust/c/c++/anything that provides events). It would just be another thing to take care of complicating PHP usage.
            I'm not at all claiming nodejs is a silver bullet here. It sucks enormously in it's own distinct ways too.
            But for responsive site purposes, that is the route to go in my opinion.
            If you just write a tool for something (no web requirement) then going for nodejs could be an option but other languages (perhaps even bash exclusively) are a better option.

            Originally posted by samuelec View Post

            So u are a troll
            That's a thing for trolls to say, not for me.

            Comment


            • #16
              Originally posted by uid313 View Post
              As for Node.js, it sucks, you try to download one little package with npm and it downloads a million dependencies. I haven't tried Deno but it sounds interesting.
              Got to look that one up, sounds interesting from a quick google. Thanx for mentioning that!

              Comment


              • #17
                Originally posted by markg85 View Post

                Perhaps a lot has happened in 15 years in terms of PHP development that I've only very sparsely been reading up on. In other terms, my experience is outdated to those times and therefore my conclusion are too.

                Let's take a couple examples.
                1. Say you want to write a site or application with MongoDB or any nosql database for that matter. Your options are: to install the pecl mongodb driver and then optionally the composer mongo db driver for some fancy extra classes. I don't know if the pecl part is solved by composer too. Fact remains, it's convoluted at best to get it installed.
                1. It is kinda solved by composer, since you can specify required binary extensions. They are installed by a simple (sudo) apt install php-mongodb. Then you would just work with it since it already provides all core stuff.


                  Now try adding in real-time communication, often done through websockets. You can't in PHP because it's not an event driven language.
                  Your point? You can't build desktop applications with PHP either. Naturally PHP has a certain architecture and it is geared towards request-response cycles. Which is still the vast majority on the web.

                  It doesn't stay running after processing your request. There are libraries to make this possible like the ev package on pecl.
                  And there are libraries who provide complete solutions for this like Ratchet and ReactPHP. But it gets convoluted again, and fast too! A common solution is a different backend in another language (could be js,/node but could also be go/rust/c/c++/anything that provides events). It would just be another thing to take care of complicating PHP usage.
                  I would go for swoole.
                  Use Open Swoole to build high-performance, scalable, concurrent TCP, UDP, Unix Socket, HTTP, WebSocket services with PHP without too much knowledge about non-blocking I/O programming and low-level Linux kernel with fiber and coroutines.

                  Anyway, as you can see there are plenty of options to achieve things PHP was kinda "never intended for".

                Comment


                • #18
                  There's a lot of FUD here about the language by people who either don't have any knowledge of it or whose experience with it is a decade old.

                  a) PECL: nobody uses PECL except for distro package maintainers. You'd be mad not to install the extension package provided for your operating system instead. The list of extensions is very large and all distros that matter have all extensions people actually use in projects.
                  b) Composer: composer is not "old", it's actively maintained, has hugely improved performance over the years and is in general one of the better package managers available to any language.
                  c) Node.js: different use-case entirely. PHP and Node are complementary, if you're proficient in both.
                  d) PHP is not dead.
                  e) Criticism of PHP based on 2004 opinions isn't insightful in this day and age. The language, interpreter and ecosystem have grown and improved immeasurably since then.
                  f) Legacy baggage: PHP is very good at keeping BC and communicating breakages during major version upgrades. There's a lot of low-level, legacy functions that map directly to C counterparts that, while ugly, are very fast. It's the price of not breaking half the internet which runs on those.

                  Comment


                  • #19
                    You should learn the definition of FUD before claiming it @royce!
                    There is no fear, no uncertainty and no doubt.

                    At most, there's outdated knowledge.

                    Your points are valid though, the FUD part is just - ironically - FUD on it's own.

                    Comment


                    • #20
                      Are you being FUD-phobic?

                      Comment

                      Working...
                      X