🌐
fuzzy notepad
eev.ee › blog › 2012 › 04 › 09 › php-a-fractal-of-bad-design
PHP: a fractal of bad design / fuzzy notepad
I assert that the following qualities are important for making a language productive and useful, and PHP violates them with wild abandon. If you can’t agree that these are crucial, well, I can’t imagine how we’ll ever agree on much. A language must be predictable. It’s a medium for expressing human ideas and having a computer execute them, so it’s critical that a human’s understanding of a program actually be correct.
🌐
DEV Community
dev.to › jesuisundev › why-developers-hate-php-194i
Why developers hate PHP - DEV Community
January 8, 2021 - In the latest stack overflow survey, developers from all over the world put PHP in the top 5 most dreaded languages. The latest Hired survey puts it squarely in the top 2 most hated.
🌐
Reddit
reddit.com › r/php › what are some genuine criticisms of php?
r/PHP on Reddit: What are some genuine criticisms of PHP?
March 27, 2012 -

PHP tends to get a lot of flak, but mostly it is for something that isn't really the fault of PHP.

Things like "there is so much bad PHP code out there" may be true but you can write bad code in any language. You shouldn't be mixing PHP, SQL and HTML, and you should be escaping/parameterizing variables for queries. (Thankfully this is less prevalent nowadays.)

So do many PHP criticisms actually hold true today, now we have namespaces and we have buried crap like magic quotes at the bottom of the ocean?

Edit: Wow, a lot of responses! It seems like inconsistent function naming/parameter ordering is the biggest gripe. If that's really the worst problem with PHP then I think we're pretty well-off.

Top answer
1 of 4
41
My biggest gripe is basically the incredible pollution of the root namespace, for example, array_map, array_slice, etc. IMO would be nicer if they were callable methods on the default array type.... But since it's PHP, I can use SPL, or implement a class myself if I want. (Same argument for a lot of other categories for which there are lots of functions.) IMO, PDO is a good example of how it should be done.... One could argue that the massive number of functions tempt the undisciplined to produce poor code. The lack of real multithreading/multiprocessing is also is big downside. It isn't much better in some of the other popular scripting languages though; Last I checked, both python (because of the GIL) and ruby could only load one core per process, though for different reasons than PHP. (Ideally, I'd like to know which functions are not thread safe, then have the language let me shoot myself in the foot.) Multiple inheritance would also be nice... But traits in 5.4 can do something that is arguably better. I'd like type hinting in function signatures to work with built-in types (and traits, apparently). I'd like to have operator overloading too. That said, I've been developing PHP for a good while and I keep looking for something better... But I keep coming back to PHP. It has its quirks, but I think it's still one of my favorite languages. In the end, I think it offers the best of many worlds - more so than any other language I've used. Like many scripting languages, I can implement things in C if I need to speed up part of an algorithm. I can use the Apache, (F)CGI, or CLI SAPIs. PHP allows reasonably clean object-oriented implementations.... But the golden egg; The thing that keeps me winning me over, is the simplicity of deployment: svn diff, scp, ssh, patch. Apache/APC take care of the dirty work, and my change goes in with negligible downtime.
2 of 4
37
This could probably be applied to quite a few programming languages, but I've always disliked the lack of consistency in function parameter order. For example, str_replace($needle, $haystack) versus strpos($haystack, $needle) I'm sure this could be fixed by me using a more powerful IDE than notepad++ but I figured I'd just point it out. EDIT: I just googled it and apparently notepad++ gives you the hints if you enable it (Settings -> Preferences, Backup/Auto-Completion).
🌐
Medium
medium.com › @cannon_circuit › why-is-php-hated-so-much-is-it-that-bad-ef963e5cc974
Why is PHP Hated So Much Is It That Bad? | by Enigma of the Stack | Medium
September 29, 2024 - While PHP itself is not inherently messy, the ease with which beginners can misuse it contributes to its negative image. Another frequent criticism is PHP’s perceived lack of built-in security features.
🌐
Reddit
reddit.com › r/php › why do so many developers hate php?
r/PHP on Reddit: Why do so many developers hate PHP?
June 8, 2013 -

Sorry if this is a shit post, but it's been bugging me for a while and I need answers. I really like working with PHP, but at every web development conference I go to it seems like it's a forgone conclusion that PHP is horrible to the point where presenters don't even mention it as a viable language to use to build web applications. I just got done with a day long event today and it was the same. Presenters wanted a show of hands of what we were using. "Python? Ruby on Rails? .NET? Scala? Perl? Anything else?" I raise my hand and say PHP and the presenter literally gave me condolences.

Seriously? How the hell is PHP not like the first or second option? With all the major sites and CMSs out there in PHP and Scala is mentioned before PHP??

I realize some technologies are easy to use poorly but I've found PHP to be absolutely great with a framework (I use Zend) for application development and fantastic for small scripts to help me administer my servers.

What am I missing here? I find it annoying and rude, especially considering how crucial PHP has been for the web.

🌐
Stack Overflow
stackoverflow.com › beta › discussions › 77383225 › why-do-people-keep-shouting-php-is-dead-always
Why do people keep shouting "PHP is Dead" always? - Stack Overflow
October 29, 2023 - This is the sweet spot of PHP, and exactly that is what's wrong with it: In order to make programming easier, too many important implementation details are hidden. This approach makes it VERY HARD to write good code. Everytime when the approach is criticized the otherwise helpful community points out that people who complain should use something other that PHP.
🌐
Medium
medium.com › @berastis › debunking-the-php-hate-heres-why-detractors-may-be-wrong-c2c8d5046db1
Debunking the PHP Hate: Here’s Why Detractors May Be Wrong | by berastis | Medium
June 17, 2023 - They cite reasons such as inconsistency in its design, poor error handling, and its general lack of elegance compared to other languages like Python or JavaScript. But is this disdain justified, or are we too quick to criticize ...
🌐
Reddit
reddit.com › r/webdev › why do people have a negative opinion about php?
r/webdev on Reddit: Why do people have a negative opinion about PHP?
October 8, 2020 -

Disclaimer: I am not here to rant or declare the superiority of a specific language/system/framework etc. all I want is to have a civil talk with other devs that may or may not have a different opinion. So please, don't turn the comment section into a warzone. Thanks

Hi, I am a somewhat new backend web developer that comes from a system programming/game dev background. When I was doing my research about which backend language should I choose, I found out about PHP and liked it. Other options wereJS-based Node.js which I didn't quite like. I am not a frontend dev so neither It's being a JS-based nor its other features didn't make me interested. After making a few projects with PHP, I started to like it even more. When talking to other web devs, reading articles, watching Youtube videos, or browsing programming memes (I know, it's not the best place to learn), It occurred to me that most people look like they hate PHP. So I researched about the reasons and most of them blame it for 'Bad Security' and I can't understand this point. People accused it because of having 'Potential XSS exploit' which could be solved by just feeding the input from the user to a function (htmlspecialchars()) It's like blaming a gun for killing an innocent person rather than its operator. I might have wrong information about this topic (Which is why I am writing this) so what are your views on this topic?

Top answer
1 of 19
19

PHP has a low barrier to entry, is easy to learn, and very easy to write badly. PHP before version 5, the language itself, was rather badly designed.

Back in the day, tons of shitty PHP code was flying around. The only (but biggest) turd left from that era is WordPress, which is probably the single biggest factor in PHP's reputation at this point.

2 of 19
10

Personally my issues with PHP have nothing to do with the language. It's the jobs.

It seems weird to criticize a language for having successful projects built with it, but as a developer who has to work on these projects; that is the problem with PHP.

Most PHP jobs involve very old open source business software. Projects like WordPress, Drupal, OpenCart, or Magento. The thing almost all these have in common is being terrible to work on. They're super old codebases with all sorts of janky work arounds and hacks.

It's rare for there to be any sort of automated testing. You typically have less than ideal ops (these are often hosted on shared hosting and have no sort of CI / CD pipeline). Most of the custom business logic you will work on will involve hacking apart some plugin that does most of what you need to get the last 5% a client is requesting. These jobs also tend to be on the lower paying side as far as dev jobs go.

If you can find a job working on custom software in something like laravel or symfony, that has good test coverage, good CI / CD, and a great local dev environment; then PHP is great. But thats maybe 1 out of every 1000 PHP jobs.

On the flip side in something like ruby on rails almost every job will be like that.

🌐
Medium
medium.com › @affordablewebdesign › why-people-say-php-is-bad-and-why-theyre-wrong-faee07570dc3
Why People Say PHP is Bad — And Why They’re Wrong | by Val | Medium
June 7, 2024 - Another frequent complaint is PHP’s inconsistent syntax and function naming conventions. Critics argue that this inconsistency makes the language difficult to learn and use efficiently.
Find elsewhere
🌐
Whydoesitsuck
whydoesitsuck.com › why-does-php-suck
Why Does PHP Suck? | Why Does It Suck?
July 31, 2014 - There are so many awful things involved in this abomination of a high-level programming language, it outright exceeds full-blown ridicularity. PHP sucks on so many levels that it isn’t even funny anymore mocking it. To be honest, it just makes me sad. Its popularity is completely undeserved and I repeatedly find myself facepalming, thinking about how it is possible that this piece of junk gained even the slightest hint of acceptance.
🌐
InfoWorld
infoworld.com › home › software development › why developers love and hate php
Why developers love and hate PHP | InfoWorld
December 1, 2014 - Rather than being predictable and consistent, the language is full of surprises and is inconsistent, according to the blogger. Among the criticisms, PHP is called opaque, with no stack traces by default, and saddled with complex weak typing “There’s no clear design philosophy.
🌐
Evertpot
evertpot.com › PHP-Sucks
PHP Sucks
June 14, 2016 - If you just look at the language, I think it fine to say “PHP is worse than Java, Ruby, Python, and many others”. If you’re just pitting the merits of the PHP language against almost any other popular language, it will likely lose. PHP is generally not approved in the enterprise, regardless of how hard Zend will try to convince you otherwise. I noticed a pattern of people running Drupal, being surprised it’s built in PHP. So the critics are right, and so are PHP developers.
🌐
Coding Horror
blog.codinghorror.com › the-php-singularity
The PHP Singularity
May 20, 2025 - No. Clearly not. The great crime of PHP is its utter banality. Its continued popularity is living proof that quality is irrelevant; cheap and popular and everywhere always wins. PHP is the Nickelback of programming languages.
Top answer
1 of 1
29

Note: This is written from a highly opinionated stance.

See also: PHP: A Fractal of Bad Design

Long ago, when the web was young, you wrote a web app in perl. That was really it. That was your only choice (unless you really liked working with strings in C). (And yes, I'm glossing over great swaths of ASP and the like... I'd rather forget those days.) There were great and large applications of the web written in perl. And there were many, many pieces of... well, crap written in perl. You can still find them if you look - buggy CGI scripts that someone slapped together that don't even come close to sanitizing their inputs.

As the web became more enterprisey, the great and huge applications moved to other frameworks that were better designed for handling thousands of connections (perl at that time wasn't). Those who could learn a new language moved on to Java (that was the best choice for many frameworks). Those who couldn't, well, there was this language that looked a lot like perl and did some things better (didn't need to fork a process for each request). It was php.

Php grew, organically... if you can call a Frankenstein monster organic. Lots of hacks (did you know the original hash function for function names was strlen?). Partial things added to the core language (rather than libraries) that still remain there today. Its not that pretty. (Poke at reddit's /r/lolphp which pokes fun of many of these inconstancies... did you know that -1 month is always 30 days?)

And while great and huge things have been built in php (look at wordpress as an example), it is still a monster under the covers with esoterica about how things work (or don't work, or what parts of things work most of the time).

It's the quick and easy language to learn so a lot of people who don't want to spend time learning a language use it. And then when it breaks and you have to maintain it now? Well, a language that allows such lack of discipline from coders who don't always understand what they are doing makes for some very 'interesting' bugs.

Its the language of quick tossed together websites and half baked wordpress plugins. Where some 16 year old wrote the code for their neighbor for $20 or a college student for beer money... knowing that they'll never look at it again. Go browse Stack Overflow's php tag for a bit and consider that you may be maintaining that code some day.

Remember that everyone else's code always sucks. And if you have to deal with someone else's code in php - it sucks.

🌐
DEV Community
dev.to › lunamiller › php-isnt-the-worst-programming-language-so-why-do-so-many-people-criticize-it-48ph
PHP isn't the worst programming language, so why do so many people criticize it? - DEV Community
May 13, 2024 - I've seen its evolution from 5.4 ... robusted and renewed, so current critics about PHP are, in many cases, outdated sign about language changes....
🌐
jewei.toString()
jewei.net › they-said-php-is-dead
They said PHP is dead - jewei.toString()
September 22, 2024 - Let’s acknowledge this up front: PHP didn’t always have the best reputation. ... One of the most pervasive criticisms of PHP is the way it historically encouraged the mixing of HTML and logic.
🌐
HostAdvice
hostadvice.com › blog › web-hosting › php › is-php-dead
Is PHP Dead? Critical Analysis of the Language's Relevance Today
March 21, 2024 - Even though PHP is very popular, it has been criticized over the years, especially when it comes to security holes, performance problems, and issues with maintaining the code. Some experts say that PHP’s loosely typed nature makes it vulnerable ...
🌐
Red Shark Digital
redsharkdigital.com › home › news categories › php: the good, the bad, the ugly
PHP: The Good, The Bad, The Ugly | RSD News
May 1, 2023 - PHP is easy, which can also be a downside. Because of its ease to learn, and how forgiving it can be with errors, this has lead to a lot of terrible code being written with the language over the years.
🌐
Je suis un dev
jesuisundev.com › home › why developers hate php
Why developers hate PHP - Je suis un dev
January 3, 2021 - If I’m saying that PHP is hated by the whole world, it’s not my personal opinion. In the latest stack overflow survey, developers from all over the world put PHP in the top 5 most dreaded languages. The latest Hired survey puts it squarely in the top 2 most hated.
🌐
Stephencoakley
stephencoakley.com › 2020 › 06 › 10 › dumb-reasons-to-hate-php
Dumb Reasons to Hate PHP - Articles - Stephen Coakley
June 10, 2020 - This complaint doesn’t really make much sense to me. PHP’s syntax is very heavily inspired by C (which it is written in) and borrows many things from it. In fact, it fits right in with most of the languages in the C family of syntax. Just swap the dot operator for -> (which by the way is also lifted from C, its equivalent to (*struct_ptr).field), prepend all your variables with the $ sigil, and that’s just about it.