The OmniPresence of PHP

I recently took 2 year hiatus from using PHP. Well not entirely as I still used it for blogging, but no in-depth use. Took some time to immerse myself in other languages for a bit.

Working in other circles where PHP was a foreign concept to some, I found mentioning it elicited a strong response. PHP seems to be a language that is assumed to be a lot of things by people who have never actually used it. I personally feel that PHP scares a lot of people who secretly wish they could use it 🙂

Opinions aside, over 80% of all websites on the planet run on PHP. Many are blogs and even the odd kitten gallery, but many are applications used by everything from small to mid-sized organizations to big corporations.  Facebook and Wikipedia are obvious examples of companies that pioneered the use of PHP for large scale apps, but there are even newer companies that may surprise you such as Slack, Tymblr, Etsy.

Recently PHP 7 went mainstream and brought with it new possibilities for building Enterprise applications, and more specifically, API services. This is an area that interests me most as it means PHP can continue to thrive in the world of microservices.  Microframeworks like Lumen make it easy to create microservices, but maybe that is not the best use for PHP, at least for the most part.

PHP and NodeJS

NodeJs is a great compliment to PHP. It lets you build really fast simple apps are is perfect for microservice APIs. Using shared auth tokens, NodeJs apps work well with PHP.  You can even share the same port as PHP using reverse proxy, so from the end user view, it is all the same app. PHP apps are better for situations where you have a lot of complex server-side operations,especially those around administration type interfaces. NodeJs is better for really fast operations like search or lookups.

I will be writing more about combining NodeJs with PHP in a future article. For now I will explain why I rely on PHP as a core application tool.

Open source – which means it can be download and used for free so It won’t be added into the overall cost of the fee charged by your programmer. How’s that for an instant saving?

Development Community – There are endless plugins for PHP and dependency manager like Composer let you add and update third party components without having to do much more than type a few lines in a command prompt. Cost-wise it would be hard to find a cheaper way to build an app. As a business grows, hiring talent will not be an issue as most developers have used PHP at some point in time due to it’s common use.

Embeddable – it can be embedded into HTML so if you have a relatively static website, you can have PHP embedded into the code to make it more dynamic. This would enable you to avoid having to start from scratch. Some people argue that you should never mix HTML with code, but the reality is that is done already with Java and C#. Even Facebook React now forces you to put HTML in your code. PHP just does it better.

Trusted – It’s been around for over 20 years, has a user base in the millions and a massive support community. If there are any problems or bugs, it’ll get fixed quickly.

Debuggable – much better that is used to be. With PHP7, you can use XDebug in most IDE’s (even Notepad++) and all platforms. This allows you to step through code and inspect variables and object similar to how you can with Java and C#.

Performant – speed was always a sore point with older versions but that has been largely dealt with in PHP7. Each version of PHP 7 comes with more performance improvements so time will tell where this goes.


Leave a Reply

Your email address will not be published. Required fields are marked *