You hear it all the time - "PHP is dead", "PHP is spaghetti code", so on and so on, but is that really the case?
I'm a PHP developer, who's dabbled in some backend JS too, and I try to be impartial as possible.
No. The short answer is no. PHP is alive and kicking. Does that mean you should flock to it for all projects? Again, no. Should you instantly dismiss the language? No.
No no no.
In late 2020, PHP 8 was publicly birthed into the world, packed full of enhancements, features, improvements, and life. I get it, I truly do - older PHP was... or could be... unfortunate... we'll say. Having inherited 8-year-old codebases originally build on PHP 5.x, I know just how messy PHP can and does get - heck, even modern PHP can be written badly, but isn't that the case for near all languages?
Near every language, sure, more commonly interpreted languages have room for messy code, but that doesn't mean the language itself is bad. Modern PHP can be elegant, scalable and efficient, and that's without much effort.
Let's think - PHP is very much in active development. There's many, many CMS' based on PHP, and many great frameworks, too. One of the world's most popular frameworks - Laravel, is based on PHP. The world's most popular CMS - WordPress, is based on PHP. The PHP community is growing, and so is the quality of code.
This doesn't mean you should swear by the language for every use-case. Sockets? Sure, PHP can do it, but should you? Are there better tools out there? Definitely.
I think the problem with PHP is the low-entry barrier. PHP is great at making code just "work", which means you can, and do see a lot of poor code. That isn't always a bad thing, though. Everyone starts somewhere, right? And with the gigantic community, it's so so easy to learn and grow, which is incredible.
This post is just me spewing my views. I think it's important to remain logical and to use the best languages and tools for the solution to problems. That language might be PHP, and if it is, you can write some incredible code with it - if it isn't? Great, you can do just that with any other language too.
I'm very keen to hear thoughts on this topic - please do share yours :)
Top comments (32)
Wordpress is the only thing keeping PHP alive.
What's keeping PHP alive is that it powers 80% of the websites on the internet. It is an absolute giant. Facebook, Yahoo and even P***hub is built with PHP. Regardless of what anyone says or think, especially the new kids in love with JS, PHP is NOT going anywhere.
PS, I'm also a MERN stack developer but thinking about languages dying or how A is better than B are completely immature ways to think as a developer. You have a problem, you look for the right tool to solve it with, and that's that.
Yes I agree. You have a problem so you find the right tool for solution.
But developers have mostly some own favorite programming language, mostly it is same which learned as first (JS, PHP, Ruby, Python, C#, Java, etc..) and also depends on personal tastes.
And doesn't want to learn something other when they have some own solution in their language.
Developers when talking about what language is "the best" are in real talking "I'm using this.." because for them it is the best solution because they don't have some large overview what is also possible with other languages and what are the pros or cons its solutions.. :)
I totally agree.
Having touched on MERN I know how powerful it is, and I think that's something some devs forget - we can get quite cult-ish with our languages. We need to change that 😁
you definitely touched MERN, but you definitely didn't touch PHP and its ecosystem well enough...
Not anymore.... this are old myths
Myth? Okay fam. Even Whitehouse's new website is built with WordPress.
The articles below ain't taking countless Laravel, other frameworks and core PHP into consideration. These are facts and not myths.
Facebook stopped using PHP as their primary language years ago. They built their own in-house language, HACK (used by be compatible with PHP, but not any longer)
Not quite. HHVM was an entirely separate implementation that supported PHP, but then they also forked the language to create HACK, and then dropped PHP language compatibility. HHVM and HACK is not PHP compatible at this point in time, but there was a point in time when there was compatibility.
I believe there's a few headless WP-esque JS solutions. I know Directus has a Vue-based admin system - still powered by PHP on the back, though!
This is a cms based on js
I think it's Laravel that keeps PHP alive. WordPress projects are live for a long time and not updating fast and dead to the developers.
What makes you think that?
Curious to know!
go read some resources first...
Wordpress destroy opinion about php
You're absolutely a developer outside the PHP ecosystem... i suggest you read more about the ecosystem of PHP...
I don't think any programming language is ever "dead". It may fall out of main stream but it is still there for one to use at any time. I once made a living programming in Visual Basic. It was hot in the 90's and almost non existent now days but if you look around there are new projects still being created with VB. Plus Microsoft still has VBA in their office suite, 🤣, some things won't die.
Definitely, those larger organisations will hold onto their legacy code until it literally collapses, but some things are designed to last 😁
Yes PHP is not Dead but for example Perl is also not dead or Delphi is still actively used and Fortran's last stable version is from November 2018. So is it Dead? NO!
What people means by "Dead" word is not about that it is not used or language doesn't have some updates. But how language is popular in mainstream and how is attractive for beginning developers.
During years 1990-2000 was PHP very attractive because no other language supported creating scripting for web pages on server side.
During 2000-2010 was swill popular because had a big community of developers and with this language was developed a lot of projects.
Also we have here some other languages with their popular web frameworks: Python/Django or Ruby/Rails
So why beginning developers should learn PHP/Laravel when we have here a lot of alternatives? What PHP have and other doesn't have?
Maybe a bad reputation from history or different syntax which is a lot different compared with other popular languages..
Maybe for some skilled developers like you PHP isn't dead and it's still improving (and it is good because you still have some work) but for others right now exists same or better alternatives then in 90's years.. :)
I really like that view!
I definitely agree for the most part. Competition is fierce, but I strongly believe PHP has it's place and will for a very long time. Career wise, I am putting all my eggs firmly in the PHP basket - because, really, in an agency environment, PHP is now, and will be the most cost-effective solution for a good few years to come in my opinion.
The ability to easily bootstrap an entire application, be it in Laravel, Cake, or a content focused brochure in WordPress makes it very valuable, when you're working against harsh timelines.
It's very interesting seeing JS grow on the backend - from what I've seen and experienced (2/3 years ago), it was quite a pain to ship a JS backend. Is that still the case?
This your words can say also other developers from other technology stacks. For example Python/Django is also very simple to bootstrap an entire application with Django CMS or Wagtail, or Ruby/Rails with some their RefineryCMS or LokomotiveCMS.
And situation now can be very different that 2,3 or 5 years ago..
Now you can see that developers are very satisfied there with express.js or next.js for long years: 2020.stateofjs.com/en-US/technolog...
Of course if you have some bad experience for example with meteor or something similar so I understand it but evolution is still in progress.. :)
Do you use Dvorak keyboard?
Was PHP ever alive to begin with?
Thank you Joe ! I completly agree ! I heard these things but most of people telling that PHP is dead are also the least pragmatic people.
PHP is a language with a nice environment and the last updates made PHP great again.
I never saw an SPA with amazing scores on Google PageSpeed Insight. With PHP I can choose my frontend and follow best practices here too.
(french here, sorry for my english).
Have a good day !
Definitely! The security of PHP is something that makes for a really great business choice in terms of longevity - PHP isn't going anywhere, and the frameworks are strong! Very cost-effective and scalable.
Amazing English, by the way :) Thanks for your opinion. I love seeing insightful views 😁
PHP is dead what you describe here are just updates for legacy php apps.
Nothing against this particular version, but over the past 15 years I have been exposed to "Is PHP dead?" - articles and videos. And I assume we will have to read this kind of content for years to come. After .NET developers have started this "trend" we are now facing a JS-generation proclaiming it. And after node will start to fade out, deno devs will claim the same.
I am fully aware that this and similar articles are a reaction to having been told that the language of choice has no future, but working with PHP myself for years believe me: just let them rant. True developers know that there is such a thing as the right kind of tool for the right kind of task.
PHP is not the language it used to be at all. PHP8 with its new JIT engine "Tracing JIT" is becoming a real contender beating go and nodeJS in some cases and being beaten in others. The syntax has changed also to be pretty much component based. Do I like PHP syntax? not really, but it is becoming more similar to other languages like C# or typescript with its own PHP "touch". There's nothing to be ashamed these days to say one is a PHP developer. Specially version 8.
Sockets nope but Mercure yes!!! ;)