If you like this site, I would appreciate a gift from my wishlist.
PHP Sucks (originally by czth)
Note
This is a copy of a page that went offline from czth.net. I’ll add links to it below.
PHP Sucks. “PHP is an abomination.” - David Robins, December 17, 2002.
- PHP annoyances
- Some comments from use Perl;
- Experiences of Using PHP in Large Websites
- Nathan Torkington’s list of PHP’s shortcomings
- GNU-Friends article by lupo (broken link - parked domain)
- PHP in contrast to perl systematically points out PHP inconsistencies
- Joel on Software mentions PHP’s willful ignorance of character encodings[1]
- The PHP::Strings perl module will provide much enlightenment
[1] character encodings are a pain in the neck, but they are necessary
Some points of my own:
Of course you can write complex scripts in PHP - it’s Turing complete. It’s just painful. (See Paul Graham’s Succinctness is Power article.) You can write complex scripts in assembler; it’s also painful. But assembler has a niche, a place where it shines: when you need to hand-optimize something or write low-level code (think kernels, trampolines, compiler magic). PHP doesn’t. There’s nothing for which it is the best choice.
A simple problem and a perl solution: remove all matches to id=some integer value (at the end of a string) from a list, also stripping off id=value from the other strings. (Admittedly this seems a little contrived but it was actually needed by somebody at some point.)
@array = grep { s/id=(\d+)$// ? $1 != $value : 1 } @array;
[2005-02-04] Finally there’s a PHP equivalent from Jason Sweat, after almost 2 years:
$array = array_filter($array, create_function('$v','return !preg_match(\'/id=\d+$|id='.$value.'$/\',$v);'));
At least it’s possible, but note the following two things: it has to parse code at runtime (think eval STRING), and that it makes use of perl regular expression matching (beats reinventing the wheel I guess). It just doesn’t have the elegance of the perl (IMO).
More Links (by Shlomi Fish)
- “The Month of PHP Bugs”
- “PHP more maintainable than Perl, also Pepsi way better than Coke” - post to the Joel-on-Software board.
- Coding Horror: “PHP Sucks, But it Doesn’t Matter”
- “What I don’t like about PHP” -by Edwin Martin.
- Slashdot.org Review of the book Securing PHP Web Applications
- Perlbuzz: “PHP’s overly compliant subclassing”
- Slashdot.org: ‘Month of PHP Security’ Finds 60 Bugs
- Stackoverflow.com: “Defend PHP: Convince me it isn’t horrible”
- Jonas Maurus: “I’m sorry, but PHP sucks!”
- Comments on LWN.net about the “Cracks in the Foundation” post
- Ask Slashdot: “Which Web Platform Would You Use?” [instead of PHP]
-
fuzzy
notepad: “PHP: a fractal of bad design” - a comprehensive post.
- PHP Sadness - “These are things in PHP which make me sad. They are real, objective issues which I have personally encountered in my normal day-to-day activites.”
Jokes
-
I wrote a book about PHP - photo by Tom Hudson. (Local mirror.)