2021-11-17
1500
#php#vanilla javascript
Andrew Evans
77288
Nov 17, 2021 â‹… 5 min read

Why don’t people like PHP?

Andrew Evans Husband, engineer, FOSS contributor, and developer at AWS. Follow me at rhythmandbinary.com and andrewevans.dev.

Recent posts:

Implementing Infinite Scroll In React Snap Carousel

Implementing infinite scroll in React with React Snap Carousel

Making carousels can be time-consuming, but it doesn’t have to be. Learn how to use React Snap Carousel to simplify the process.

David Omotayo
Dec 13, 2024 â‹… 10 min read
React Libraries For Building Forms And Surveys

React libraries for building forms and surveys

Consider using a React form library to mitigate the challenges of building and managing forms and surveys.

Hussain Arif
Dec 11, 2024 â‹… 7 min read
Hoppscotch Vs Postman: A Guide To API Testing

Hoppscotch vs. Postman: a guide to open source API testing

In this article, you’ll learn how to set up Hoppscotch and which APIs to test it with. Then we’ll discuss alternatives: OpenAPI DevTools and Postman.

Chigozie Oduah
Dec 10, 2024 â‹… 5 min read
React Native logo over red background.

Implementing camera functionality in React Native

Learn to migrate from react-native-camera to VisionCamera, manage permissions, optimize performance, and implement advanced features.

Chimezie Innocent
Dec 9, 2024 â‹… 13 min read
View all posts

27 Replies to "Why don’t people like PHP?"

  1. Hello guys! Some things were not mentioned about PHP, for example the existence of libraries and extensions to work asynchronously, like ReactPHP and Swoole.

      1. To be fair, they also didn’t mention how JavaScript can be multi threaded. So it’s fairly even. Except web workers are part of the actual ES spec, unlike Swoole.

      2. Agree with you John Doe.

        You can’t compare JavaScript to PHP, they serve two totally different purposes. 2021 PHP is fantastic and it integrates nicely with React.

  2. In my experience, we don’t use Zend that much. PHP has some really solid frameworks like Symfony and Laravel. Also, PHP is an excellent option for making APIs using and ORM like Doctrine.

  3. The comparison dies not match Javascript vs php that does not make sense. You can say nodejs vs php then you can compare. Ssr with frameworks can still be done with php if you want to but why would you since you can gain with both ends if you are laravel developer and decide to use live-wire. Swoole also gives php some features of nodejs event driven approach

  4. I am very confused by this article. No mention that Javascript is front end and PHP is back end? And the title “Why Don’t People Like PHP?” But The article is a comparison of PHP and Javascript and not a discussion on what makes people not like PHP. How did you choose Zend as the most popular PHP framework? Laravel is arguably the most popular. How about mentioning that you can and probably should use both? I don’t know of many sites running on PHP that don’t have Javascript on the front end. It makes no sense that Javascript developers need to be familiar with HTML and CSS but PHP developers don’t. I understand the point of this article or what it is you’re trying to accomplish. A LOT more research should have been done.

  5. Small point: PHP has very similar scoping rules to JS. You present this aspect of both languages as if PHP has none at all, this is very misleading. Furthermore, you neglected to mention PHP’s namespacing feature (which makes managing scope MUCH easier). This section of your article is deeply flawed.

    I love using both languages, and I agree that the non-blocking io/async nature of JS is very powerful. But badly written JS is usually harder to fix than badly written PHP (callback hell etc).

    FWIW, I’m the tech editor of PHP 8 Objects, Patterns, and Practice (Zandstra, 2020).

  6. You all really seem to be trying a lot to press php put of the game. Till tomorrow, php is still outperforming JavaScript in web development. Talk about security, etc…

  7. People don’t like PHP because its not the flashy new language. They make silly comparisons between PHP (a language) and a front-end framework (React, Vue, etc…). They make performance assertions based on NodeJS being asyncronous and PHP not. While PHP is run in the context of a webserver that is running multiple threads, each thread capable of executing your PHP code. The application model between nodeJS and PHP is completely different, you don’t necessarily need async or threading at the PHP language level.

    1. Agree, a developer saying Javascript is fast because it is async has no clue on underlying engines. With opcache and optimizations starting with php7, php is one of the fastest scripting languages around on runtime.

      This discussion is also cheesy as many veteran (and successful) coders/architects just choose the appropriate programming language according to the project and they generally have no problem on switching between different languages as they already know the main concepts. This is the discussion of junior coders on what to learn first which unfortunately author seemed to stay in that level.

  8. There are many confusing things in this post that shows that the author does not fully understand PHP, or JavaScript for that matter.

    First you can’t compare front-end JavaScript to PHP, and to that extent talking about fronted frameworks like React and Vue does not make sense either. You should compare backend features only.

    There’s no interpreter and runtime, in PHP you only have the interpreter. It’s one thing. Also, there isn’t different ways to implement PHP, there’s only one. Zend Engine is a piece of the PHP core, it’s not an option and it’s not something that’s relevant in a comparison.

    You could say that one of the advantages of JavaScript as a language is that it can be used in the front-end and back-end, but when comparing with PHP, only the backend makes sense.

    Anyway, I hope people reading this article take time to read the comments because of the disinformation it brings.

    1. Also like… Php has no scope?… One Google on W3 schools can tell you it does… And it works almost the same

  9. If your team is already working in the LAMP stack, PHP will probably be best for you. If your team doesn’t know much about the LAMP stack and also has less backend experience, JavaScript is the way to go.

  10. It looks like the author planned this post a long time ago. I don’t think the comparison between JS and PHP makes sense.

  11. JavaScript only has 1 thread. It’s a event loop model. It cannot run multiple statement at the same time because it only has 1 thread. It’s concurrent but not **parallel**.
    The post is very misleading.

  12. You need to compare JS vs PHP from a real web apps perspective.

    The main reason JS is so popular is that it can handle the frontend (there are many ways), backend (non-blocking), and heavy tasks (web workers). JS is skyrocketing after Node.js was released and web APIs were standardized (~2009, I knew about it in ~2012).

    You can build an app in the JS ecosystem entirely.

    You can even scale that app with no usage of other programming languages. When you find scaling solutions you are probably will be used other programming languages in infrastructure code.

    The main reason for PHP decline – very long release cycle (6 years from v.5.3 to v.7 = 2009-2015) and lack of innovations. There are no new programming languages based on PHP that was released.

    There was hope on FB (the Hack), but they give up too.

    Now PHP can handle backend logic and do it pretty well on the lower scale (LAMP stack is alive). But there are new solutions that are more efficient on the big scale (Go, Rust, JS, etc).

    I have started from C++ and PHP and now stick with JS/TS with minor adoption of Rust. C++ is also interesting, as a source of different conceptions and problem-solving solutions.

    I think you can’t move JS from its top position 5+ years at least. JS is the backbone of the nowadays internet.

  13. React is best framework because more people use it as compared to svelte BUT PHP is not better than JavaScript for same reason. Why?

Leave a Reply