ICTShore.com

We re-branded, ictshore.com is now accelerates.it!

Why use PHP? The Definitive Answer

Learn why use PHP by understanding its core advantages

Share This Post

Any programmer or scripter knows what PHP is. In fact, this language has been around since 1995. However, as time passed it started to get somehow a bad reputation in the Internet community. People even started to make memes about how bad PHP is. But, is it really that bad? True software engineers know that languages are tools, and there is no language better than another. Instead, there is a language that can serve a given purpose better than another. Thus, in this article, we are going to see what you can accomplish with PHP. We will answer the question: Why use PHP?

Why use PHP?

Some criticisms first

If many people say PHP is a bad language, there must be some kind of underlying truth. That truth is that PHP is dramatically simple and easy to learn. Making a PHP webpage is a s simple as creating a file with a few words. In fact, even a kid could be up and running with PHP in less than an afternoon.

With no special restrictions, you can do pretty much anything you want inside a PHP file. Combine that with lots of unexperienced programmers writing PHP, and you get an incredible amount of spaghetti code. Most concerns about PHP are specifically about that. However, bad code is not a characteristic of the language, but of the programmer. If you are a good programmer, you can write good PHP code.

Once we get that clear, it is time to understand the positive factors about: why use PHP? We have a few reasons for you.

Why we use PHP? Here we have some reasons
Some reasons to use PHP: Extended Platform Support, Alive Community, Surprisingly Fast, can be integrated in scalable and modern apps.

Extended Platform Support

PHP can run anywhere. This is true for many open-source languages (like PHP), but PHP beats everything else. As of 2019, most of the Internet still runs on PHP webpages, and this means there is a whole industry that have evolved around it. You can find cheap managed hosting for PHP in any country, while this may be hard to find for other languages.

If you want to run your own servers, you can set them up in literally minute: install apache and you are set to go. You can find web servers running PHP for virtually any platform.

There is one kind of service that currently (2019) has no support for PHP, and that is Serverless computing. You won’t be able to run Azure Functions or AWS Lambda functions with PHP, but only with Node and a few other languages. That’s a limitation if you want a serverless application. However, there are other good ways to develop a modern application (more on that later).

Why use PHP? You can run PHP virtually on any platform or hosted service.

Alive Community

While PHP has more than 20 years, its community is still thriving. PHP gets updated to meet modern requirements of a programming language, and you get all the benefits of a large community. For example, you have a lot of StackOverflow user base to ask questions to. You can count on the community for the support, and you won’t risk ending up with an End-of-Life language.

Surprisingly Fast

PHP does one thing, and it does it fast. It delivers dynamic web pages, and it is really good at it. With PHP 7.x, they added several improvements that brought PHP back to center stage. In fact, most frameworks doubled their performance compared to their PHP 5.6 version. If you run PHP inside HHVM, a Virtual Machine designed to run PHP, you will be able to increase your performances even more: between an additional 50% and 100%.

However, PHP is not the fastest language out there. Go is way more faster, and Node.js is slightly faster than PHP. Specifically, they can handle more requests per second. If you have a good design for your application, you can simply scale by adding more servers. As a result, this is not really important for most applications. You will only have to pay slightly more for your hosting, but – believe me – hosting is not the primary cost of an application: development is.

A language for every day

PHP does not have specific limitations that restrict your way to code. This means you can adapt it to your needs, from the simplest script to the most advanced web application. You can make use PHP from the simplest to the most advanced level you’d like. You only need to learn that language, and you will be able to make quick additions to your WordPress sites or create a new complex service.

PHP in modern applications

The question “why use PHP?” is only half of the picture. The other half is, “can PHP find its place in a modern application?”. Turns out, yes it can. The new trend of application development is microservices. Basically, your application is not a single monolithic server that does everything. Instead, it is a collection of small virtual machines (containers), each with a specific purpose. Each container (or better, pair of identical containers) is a micro-service, and your application is composed of them.

With this approach, you can handle scalability by increasing the number of containers, only on the micro-service which is suffering heavy load. Developing containers that can run PHP is easy, so that’s PHP’s place inside a modern application, in a container.

Wrapping it up

Okay, in this article we quickly saw the reasons that may bring PHP into your project. The main disadvantage is that PHP does not force you to follow good coding practices, so when it comes to good coding – you are left on your own. Another thing to consider is the lack of support from Cloud Serverless computing like Azure Functions or AWS Lambda functions. Note that this does not mean you cannot run PHP in the cloud, only that you cannot run it in a Cloud Function. For you, a table to recap the key benefits of PHP.

BenefitDescription
Extended Platform SupportRun anywhere, even on cheap hosting. Note: not supported for cloud functions like AWS Lambda.
Alive CommunityPHP gets its updates and you can ask questions to the large community.
Surprisingly FastWith HHVM you can rune PHP very fast. However, if you can scale your application horizontally, this is only a secondary benefit.
A lanauge for every dayVery flexible and easy to adopt.
Why use PHP?

What do you think of PHP? Do you see yourself using it in your next project? Let me know your opinions in the comments!

Picture of Alessandro Maggio

Alessandro Maggio

Project manager, critical-thinker, passionate about networking & coding. I believe that time is the most precious resource we have, and that technology can help us not to waste it. I founded ICTShore.com with the same principle: I share what I learn so that you get value from it faster than I did.
Picture of Alessandro Maggio

Alessandro Maggio

Project manager, critical-thinker, passionate about networking & coding. I believe that time is the most precious resource we have, and that technology can help us not to waste it. I founded ICTShore.com with the same principle: I share what I learn so that you get value from it faster than I did.

Join the Newsletter to Get Ahead

Revolutionary tips to get ahead with technology directly in your Inbox.

Alessandro Maggio

2019-06-13T16:30:21+00:00

Unspecified

Dev

Unspecified