Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

Good article, and hopefully contrasts today's php with yesterday's php.

To me, it's no worse than any other dynamically typed language now. And arguably better than similar peers because the barrier to entry is so low.

FastCGI and user space caching like apcu mitigate the old "one process per request" complaint.

It's a true workhorse. Sure, node.js and Golang have advantages, but so does modern php.



sort by: page size:

I agree that PHP is a fine language these days, if using modern features and techniques. I've seen plenty of recently written PHP that looks like it was written in 1997.

That said, PHP does have complexity to running like node does with pm2, Apache or Nginx in front. Is it as bad, depends on the person, but it does suck IMO.


PHP, surprisingly, has legs. I started using it at my job in circa 2000, then moved to Rails, then to Node, then back to PHP for another project. It had lots of problems in 2000. But it has been fixed over the years.

It's not the dinosaur people make it out to be. The main concern was the number of threads it creates, and how that limits its scalability. But modern *Nix cores can handle more than 1024 processes. Node definitely improves efficiency by using async architecture which reduces OS load, but PHP isn't the devil as some claim.

I think there's a treadmill habit of JS frameworks that make anything >2 years old seem out-of-date, but PHP has it's benefits... assuming one adheres to separation of concerns (something that was casually disregarded by the same pedants when they discovered React, Angular, and Vue).

Wow, that was a soapbox rant.


It still has many of the same problems old PHP has. More speed is always great, but speed wasn't PHP's major issue. It's still mired in an interpreter that has a lot of issues with more abstract/higher level stuff (though I will say that's getting far better), and a team that doesn't embrace BC breaks as much as they should (my opinion - the stdlib sucks).

Extensions have always been PHP's strong point, but some newer stuff isn't as supported as well as it is in Python or Node because of PHP's lack of good async code.

Overall it's a step in the right direction, but PHP needs more big changes.


This is old and a lot of the points are obsolete, but that's not to say PHP isn't still a bad language from a programming language design perspective, BUT it certainly isn't as bad as it used to be.

PHP is getting a lot better these days. There is still a lot of clunky legacy syntax but the performance and features are pretty much on par with other scripting languages now.

Eh, modern PHP is pretty good. Sure the stdlib still has warts but that’s largely due to a reluctance to break compatibility.

Recent versions are plenty fast enough for the majority of web purposes, it does tons of stuff out of the box, it’s share-nothing nature is a good fit for web services, and for a dynamic language it has a surprisingly strong type system.


PHP has gotten a lot better. New APIs have been added on top of features like classes. And many of the worst of the older APIs have been deprecated.

It still works on the "new interpreter per request model". But that has advantages in the multicore world: everything is thread-safe by default, and will scale to N cores without any extra work (for shared state people tend to use something like Redis).

It's by no means perfect. But if you stick to the modern bits and use one of the nicer frameworks (like Laravel), then I think I'd prefer it over something like Ruby.


PHP is a great fit for most web projects. It is battle tested with great backwards compatibility, fast, offers the best deployment story and combines the advantages of dynamic and static typing with it's gradual typing system (Think Typescript without the complexity of Typescript.)

The next version is even going to improve on its weakest point, concurrency, with Fibers: https://php.watch/versions/8.1/fibers

Sure we all remember the bad old times and the horrible legacy projects that are still around but let's no forget PHP allowed the average Joe to hack up his own dynamic websites without jumping any hurdles. It helped democratize the internet for a while.

I really don't get why PHP is not more liked in hacker circles. Probably needs some new languages with slightly different syntax that transpiles to it for it to be hip again.


I am an erstwhile PHP apologist. Having come back to PHP after a long time away (not really by choice), I can confirm that the language has improved significantly since PHP5. PSR was a huge success in a lot of ways. However there are still a few things that prevent it from being my language of choice.

First off, there is a surprising number of core behaviors you'd expect from a modern web application that there isn't a clear go-to for in the PHP world. Does anyone know of a well maintained library for publishing and consuming AMQP messages asynchronously?

PHP is still limited by living inside of the context of the request. This has an effect on certain types of application-layer caching, and makes for a poor model for backend scripting.

You also still need to interact with multiple layers of dependency management -- from os packages to pear packages to composer libraries. Configuration can be messy, and many projects still aren't containerized.

Finally, while the language has evolved, many of the projects that use it have not. The longer lived the PHP project, the more likely you are to encounter the exact paradigms that make it so hard to work with. Other languages have benefitted from a much greater percentage of their lifespan being supported by ecosystems that encouraged keeping your dependencies and the parts of your code that exercise them up to date.

That being said, it's great to see that there is a path for starting new projects with a modern framework. But I would have said the same thing about Zend or Symfony, and those seem to have fallen off for reasons I don't know.


That's true.

There are a ton of features in modern PHP which address a lot of the common criticisms brought against it. Doing a proper comparison with other languages (framework to framework, not framework to language) I think PHP measures up reasonably well.

But there is so much terrible, legacy code out there. The evolution, if it's happening is happening very slowly.


I think modern PHP has improved in strides, and now isn't much worse than JavaScript. While it's not my first language of choice to go to anymore, I liked working with it. I didn't hate the language so much as the messy codebases I worked with it. And I would like to see what newer software is being made with PHP in a more modern way.

Whilst I've worked with older PHP which was indeed awful. The modern stuff is quite OK. PHP has drifted into a decent design recently. I hope that any future language designer will take PHP as a case study of incremental improvement.

Although the article didn't cover any specifics of the language, I think PHP has definitely improved. For what it lacks in elegance, it makes up in ease of deployment and scalability. Overall, the improvements made to PHP over the past few years and the upcoming changes in PHP 5.3/6.0 and the variety of excellent frameworks to choose from, make it a very good language to keep in your web development toolkit. It doesn't do everything extremely well, but it does many things well enough.

PHP isn't considered "dated". Modern PHP is excellent.

Yes, it gets a bad rap by communities like this one but PHP is still one of the leading tools for modern rapid web-driven application development.

Writing with PHP is better than ever... and getting better and better.

And... you don't need too worry too much about the server, or the request lifecycle, or networking... you just write your app, in a language which is, in my opinion, going in the right direction with a stronger slant towards OOP and types.

Of course it's still entirely possible to write garbage PHP code... but it's possible to write garbage in anything.

I'm increasingly proud to say I'm a PHP developer; it still gets a lot of bad commentary but it all tends to be based on historical stigmas which are increasingly untrue. Yet all the original benefits are still here, and the language itself is going from strength to strength...


I wouldn't say that php is every bit as bad as it was 8 years ago, its certainly made a lot of progress. There are now namespaces, generators/iterators, closures, traits, interfaces, type hinting, and with composer theres even a dependency manager. The zend engine rework coming later this year in php7 gives really promising performance boosts and some other niceties like ASTs.

Granted some (most?) of these modern php features aren't quite as nice as they are in other languages, and there is still some weirdness (/r/lolphp as you mentioned), and an inconsistently named standard library... But php has made some strides in the past 8 years. Once you're aware of the gotchas its not as bad as everyone makes it out to be.


Was PHP any good back then?

PHP is doing great! I like the direction it is going in. PHP 7.4 also introduced nice features to improve static typing. The FFI is pretty cool too. You also get free performance improvements while remaining mostly backward compatible. It is trying very hard to stay relevant and I believe it is succeeding.
next

Legal | privacy