Comments for What I don't like about PHP

Visit What I don't like about PHP.

  1. Nux

    2010-04-22 13:48:03

    "Magic quotes prevents PHP-scripts from SQL injection attacks. That's okay." Like hell they do. Fist of all Magic quotes will only work for some DB engines - for other they will only make you more conversions. Secondly it will only work out of the box if will read and write almost directly from the user. If you will input/output directly you will have no control on the input which is even worse then just SQL injection.

  2. Renato Elias

    2010-04-22 18:07:49

    They are really truths, because we cannot make fork? I started well to use kargo-events in the place of the apache/nginx, twirling to the style of rails, have given right.

  3. Random Visitor

    2010-07-31 06:03:51

    Dang. What's with the horrible spelling? It really undercuts your logic -- compair? Populair? Answeres? I agree with most of your points, but Unicode is not a trivial feature.

  4. Edwin Martin

    2010-08-10 23:23:06

    Random Visitor, I couldn't find the word compair, but I fixed the other two "horrible" spelled words. You might have guessed English is not my native language.

  5. Raj Talreja

    2010-08-22 17:33:50

    I agree on this article.. JSP ( i used back in 2003 )was much better and easy to manage with components, and secure though.. Raj Talreja Founder ZERO 360 Web Technologies

  6. pSub

    2010-09-03 21:17:07

    I agree with you at all points. But the problem is that PHP is accepted in more and more companies. I'm currently working as a PHP-programmer, too, to earn some money besides university. I would like to see a sane PHP version, but this is an oxymoron, so spent I spent my time in learning haskell and use happstack.

  7. John

    2010-09-03 21:54:50

    I agree with most of your article except a few points. * How is Zend the only "real" object oriented framework? I've read some of cake and it looks like it's using "objects" to me. * You say "Until then, when you start a project larger than five scripted pages, you might also consider C#/ASP.Net or Java/JSP as a better solution" UMMM EXCUSE ME?! I'm currently working on a very large project in PHP that is WAY larger than 5 pages and runs just fine (without hardware performance additions). And Python, Perl, or Ruby could use a mention from you as well.

  8. Edwin Martin

    2010-09-07 23:00:05

    John, PHP has become really object oriented since version 5, so any framework supporting PHP 4 can't really be object oriented. Maybe five pages is a bit exaggerated, but you get the point. Python, Perl, or Ruby are nice languages, but unfortunately, they're all very slow.

  9. visitor

    2010-10-15 10:15:10

    ..C#/ASP.NET and/or Java/JSP/JSF both have to startup a virtual runtime. Ever tried running a Tomcat on a 256MB RAM machine? Forget it, it just runs out of memory after you deployed a single container. The very same server however runs more than 100 websites and ~500k requests/month - to hell with PHP doesn't scale well. Your calculation on the 30k Facebook servers is quite funny. "They also use 30 thousand servers. That's a lot. If you do some calculations, you'll find out, on average, one server handles only 104 visits per hour". Short: WTF!? Long: Do you really think all 30k servers are running a webserver? Ever thought of how FB stores data? Exactly, you need servers for this. Probably 98% of those server are for storage only and build up a huge CDN for all the images/videos/text/crap that users share.

  10. qwerty

    2010-10-19 04:18:10

    As bad as Java the language is, Java the platform is outstanding. performance almost always takes more memory. See memoization. Is it a good tradeoff? It depends. On the web the network is the bottleneck and quite often increasing performance in a web app buys you nothing. If a web page can be fetched in 20ms but the round trip time is 500ms and it takes the browser 50ms to render it, increasing fetch time does nothing but buy you a few extra hits per hour. All that is moot. PHP has nothing positive to offer. Ease of learning and usage is not a plus. It is the reason so many PHP sites are an amateur hour mess of spaghetti code, SQL injection, and XSS. PHP doesn't scale, it is probably the worse designed language created for widespread use. VB is miles ahead, and VB sucks. PHP makes it really easy to do the wrong thing, but if you want to code correctly it puts lots of hurdles in your way. PHP: unsafe and unusable at any speed. Who should use PHP? Nobody!

  11. Peter Germany

    2010-11-26 10:51:19

    I tend to agree, particularly after learning c# last year. I am developing a large php program (for legacy reasons only), and added to your list are the arithmetic problems where using decimal and floats sometimes create false unpredictable results, therefore I would not recommend php for any financial code. I have also run into a few issues with type safety and you are left wondering why the php function does not work, and it is down to type safety, I think this is a mistake having loose types. That said, my new program works great but given the choice, next time its dot net.

  12. Mark of Sydney

    2010-12-07 15:05:54

    @ Edwin MArtin Python is slow? When compiled, it is "significantly" faster than PHP. I would reconsider revising your sources.

  13. David

    2011-03-11 04:29:58

    I don't know but maybe I'm a really good PHP programer because I've done things really amazing with PHP and I haven't had so many problems using PHP as this article pretends to say It could be lol... some things like picture manipulation, automatic recursive menu generators, all kind of database transactions, etc, etc, etc. By the way I work in an university, We have 25K new student per year and all they have to register online and we have ZERO data errors due to PHP however I'm not going to say PHP hasn't defects but I think that the most important thing is the programmer than the language, bad programmers will be bad in any language. Well I hope You can understand what I wanted to say, I'm not a native english speaker but I wanted to tell You my experiencie using PHP. Bye.

  14. beavis

    2011-03-11 19:18:13

    PHP absolutely sucks but a shared-nothing architecture makes a lot of sense. Sharing data in memory across multiple threads or processes is a very difficult thing to get right.

  15. James Dunmore

    2011-04-07 11:44:43

    What the lesson is - use the right tool for the right purpose. To build an entire app in PHP is stupid - to build and entire anything in one language is stupid. Java/C# are brilliant a the big beast back end systems. PHP is brilliant for a lightweight front end. Don't be scared to mix and match and use an API - if something is slow you can always change the interface later. In fact, you should always be looking at using an API / data mapper layer. PHP can be very fast if you use hiphop - it's what facebook do. Java is fast... once your already got enough power to run the runtime monster. C# is (mostly) an iis platform, a no go really. Python is a good alternative. Naming convention in PHP does drive me made, but surely that's what IDE's and the web docs are for? I think they need to be firm with PHP6 (which is on hold and now going for 5.4) and sort our naming conventions. I'm surprised you didn't mention the SPL - makes life much easier!

  16. John Abraham

    2011-05-24 03:01:47

    Some interesting stuff - but many experienced master PHP developers, at my work place, will disagree as we have built some serious web apps using PHP. John

  17. jacob beasley

    2011-06-25 17:28:55

    I've built huge apps in PHP that scale; the key is using a good framework. Out of box, CakePHP supports caching, sessions stored in the database, and OOP, so it scales incredibly well. Sure, there are some php guys who give the rest of us a bad name, but a good php developer really can program great, scalable systems using php and mysql.

  18. Justin Malcolm

    2011-07-27 21:40:07

    I was curious to see if it was PHP the language or PHP the framework that really sucked. So, as a bit of a lark, I built a PHP View Engine for ASP.NET MVC. So, now you can recommend PHP/ASP.NET as an alternative. :-)

  19. Albert E.

    2011-08-09 23:12:58

    What about VB? Just kidding. I'll leave now.

  20. DampeS8N

    2011-08-24 17:16:24

    "PHP has two advantages: it's very easy and it's widely supported by webhosting companies. But that doesn't make it a good language." Actually, that's exactly why PHP is such a prolific language. That's what makes it good. That's what makes it so wide-spread. That's what makes it so fast to code with. That's what makes finding developers for it so easy. Remember, the business choke point these days is NOT the speed of the code and computers. It is the time it takes from zilch to market, and that means the time it takes a programmer to create a solution. PHP is amazingly fast at this. And incredibly flexible there-after. It is this as-you-go optimization potential that makes it the go-to language for so many start-ups. PHP is also the cheapest platform. Which combined with the other attributes is a force to be reckoned with. That said, everything you mention about the language that are negatives are real negatives. But thinking that they will prevent anyone from adopting PHP shows a misunderstanding of how platforms evolve. Anything done to try to fix these problems for the long term, will make the language harder to pick up in the short term. Which means less people will. (Aside from naming conventions, which work to create a culture of people who are always looking in the docs, which means always finding new features) It is basic Natural Selection that has led to PHP being popular.

  21. Rajeev Jha

    2011-11-01 12:39:22

    I agree with some of the core issues, like not being thread safe and Unicode support. However share-nothing architecture objection does not count for much when you consider that most important use of PHP is to generate web pages. Heck, which language has an nl2br routine? No one is trying to write their next web server in PHP, yet! Bad Unicode support is a pain though. However I do not agree with "slow" comments. I do not know who coded a page to use 15 MB. That is just bad design. Some of the biggest systems on internet run on PHP (wordpress/FaceBook) and there is reason behind that. Do not equate stupidity of PHP programmers to that of PHP. Any real language and platform is messy. Just think of how messy C would have looked to Lisp hackers. Perl is messy and so is C++. A language, framework or platform is no guarantee to better code and products. Most of the time the guy using them matters more.

  22. Ahmed El Sayed

    2011-11-13 23:04:17

    If this page contains 100 opinion says PHP is bad, we have billion of site written and working with PHP, non of them says it a bad solution. As you say, Facebook, if its that bad I'm certain FB will not be so adventurer to be in that danger with PHP. If PHP that bad, can I believe your opinion and disbelieving in billion others??? I think those says php is bad just feel Jealousy from php.

  23. Kalyan

    2011-12-07 12:47:28

    Every one said their opinions,and above said all are true and PHP has over come some of them,and also going to be in PHP 6,and Java hasnot build in a single day my friend.

  24. Jordan

    2011-12-29 10:16:13

    PHP sucks primarily because its not compiled and has dynamic typing. I work on it everyday and I hate it. I cannot organize my code well with it, because everytime I want to I have to think about how it will slow down performance. This is a serious reason why PHP must die. PHP is OLD FASHIONED. We have outgrown it. Let's move onto something better, and please let it be compiled. ASP.NET, Java Servlets, anything is better than this crap.

  25. TGY

    2012-01-02 11:17:50

    As far as I know PHP is a scripting language, not a programming language. The article keeps claiming PHP is a programming language, while it isn't.

  26. Edwin Martin

    2012-01-04 22:10:12

    @TGY: Why is a scripting language not a programming language? PHP is a very real programming language.

  27. Dennis Wong

    2012-01-06 08:01:12

    @Edwin_Martin PHP may have gained its popularity over time and become very function rich so that people compare it with other real programming languages. However, it started out as a scripting language to change a-little-bit-this-and-that in HTML pages. Now, it is the most overgrown and messiest scripting language on the planet.

  28. netogallo

    2012-05-22 20:57:35

    Some of the comments harvest their own misery: Php can be made fast: It requires extra work, why not choose a fast solution right away? Easy to find php developers: Well good developers are equally scarce for every language (and usually don't like PHP). Faster to write php code: Get a savy functional programmer and I bet he can come up with cleaner solutions using less code and time. Big sites use PHP so it scales properly: Sort of biased, most big sites do a lot of hacking and customization to the php platform so it scales properly (FB even has it's own php to c compiler). With enough effort any solution is scalable. The thing is that there are platforms that scale with very little (or no) effort and PHP for sure isn't.

  29. Eddie

    2012-06-05 06:27:19

    After reading Rasmus' Q & A and just from general PHP experience you come to realize that PHP is a noobs language. Although, it solves a problem and so has a purpose. The point of PHP seems the ease of use factor wherein a person can create an interactive site easily. Granted if you want scalability you should consider Python but then again Python won't be as easy to setup and wasn't designed to solve the problem of the web. PHP has a dark side that a committed developer will encounter at some point. You either deal with it or move on.

  30. beReal

    2012-09-29 01:10:49

    Yeah!! PHP sucks but Java is the biggest shit, believe me!!

  31. Peter Drinnan

    2012-10-12 02:04:11

    For me PHP is just a data delivery mechanism, same as Java or Python or dare I say Ruby. The real work in building an awesome web app or web site is in creating an awesome user experience. People who get hung up on the server side of things may be ignoring more important things.

  32. Stephan Gerlach

    2012-11-12 11:49:11

    Nice read but I found a few things that I want to put out there. 1. 2GB is not 2000MB it is actually 2048MB. Yes not much of a difference but it is one that can make a big difference. 2. Your calculation about how many requests the facebook servers deal with is most likely to be wrong. Just because they have 30,000 servers that does not mean that they are all set up in the same way. There will be many servers that will only serve images, some will be used to run cronjobs for system maintenance and ensure things are cleaned up regular, some servers will only database servers and others will probably be only mail servers. So you see if you calculate the performance of their php servers you will look actually at a much much smaller number.

  33. john

    2014-10-11 12:56:13

    Some of the comments harvest their own misery: Php can be made fast: It requires extra work

  34. Riya Roy

    2015-04-13 07:44:44

    I wanna pay tons of thanks to this blog writer. I was assigned to create ecommerce with php so found this article and really this bloh helped me to guide about disadvantages of php . please add one more line if you can: A disadvantage in having query strings in url and long url. Google says it will not index urls with an id parameter. I told all above mentioned factors to my manager and he decided to complete that ecommerce in dot net!1

  35. Janvier

    2016-04-27 18:20:41

    Most of you "programmers" are really amazing me right here. 1) First of all, comparing PHP and Java,...or any other language is like saying "A limo is better than a Camry". IT DEPENDS ON THE REASON 2) Some situations require compiled languages while others are best suited for interpreted languages. Using java on a 5 page application in my opinion is an overkill, while trying to use PHP to create a Hosting environment is sheer madness. Apples and Oranges here... 3) Overall, PHP evolves and sometimes is forced to do things it wasn't designed to do initially. Welcome to Technology. Every language evolve. It all depends on context!

  36. Multilang

    2018-01-16 10:30:50

    I love PHP. What I hate is too many thing is needed to move from 5 to PHP7 - missing functions are a real nightmare for anyone migrating to a newer server.

Give your comment:

The sum is to prevent spam. Type your comment below.