Is PHP really going to die soon?

No, it’s not going to die any soon and the future can’t be predicted right now. There is a possibility that some other technology may die before PHP.

Enterprises are using PHP, developers are developing apps in PHP.

I might die before PHP because One-Third of Web is using PHP.

At the end of the article, I will share some of the reasons, why PHP is being hated so much.

Table of Content

What is PHP?

PHP is server side scripting language, sometimes referred as programming language also. It’s scripting language because it’s interpreted and we can embed PHP code in HTML also.

random.php
<?php

  $title = "Squares of First 10 Numbers";

  print title;

  for($num = 1 ; $num <= 10 ; $num++){
    print "Square of $num is {$num * $num} ";
  }

PHP Syntax loos something like this. PHP is loose typed language which makes easier for beginner to get started. You don’t need to remember data types before understanding “How to define variables?”.

Lot’s of Web Developers are out there who started their career as PHP developer. Or their first dynamic website was build using PHP.

Do giant companies takes use of PHP?

Yes, giant complies use PHP. I am going to list some of the companied who is dependant on PHP in a way.

Let’s list some of the Giant Companies using PHP. I don’t think these companies has less traffic or these companies are a fool to use it.

List contains website build using WordPress(PHP based CMS).

Don’t forget there is Drupal, Laravel which is also being used a lot in the market.

Some of you might say these companies build their blog in very early days and it’s difficult for them to migrate. Yes, it’s a valid point and migration is really difficult.

Why someone migrate from one Technology to other Technology?

Answer is very simple, When that technology is not able to full fill their requirement and there is some other technology out there which can solve their problems.

The website is running and also it’s able to handle the traffic. Just because people abuse PHP doesn’t mean one should stop using it.

Why PHP dominates web?

There are two main reasons for this

  • CMS (WordPress, Drupal, Joomla etc)
  • Framework (Laravel, Code Igniter etc)
  • PHP Simplicity

WordPress

If you don’t know WordPress then you missed very big thing in PHP World. WordPress is a Content Management System (CMS), build using PHP. There are more CMS out there which is famous i.e Drupal, Joomla, etc

WordPress is most famous CMS out there. Among all CMS out there, WordPress holds the highest share in the CMS world. WordPress is so flexible that lots of E-commerce are out there which is build on the top of WordPress.

WordPress Logo

There must be something greatest about WordPress because of that Giant company also trusts on WordPress. I’ll give an overview of what WordPress has and why people use and as well as recommends to others.

  • Simple and Easy
  • Free and Open Source
  • Flexible and Extensible
  • Lots of Plugin (few plugins are paid)
  • Giant Theme Gallery (Some Theme are paid)
  • Big Community
  • Role base access (Team can easily manage it)

Laravel

Laravel is a complete framework and once you will start using it then you will say there is no framework out there like Laravel. If you want to build your website from scratch or you want to write your own API. Laravel can be a good solution for you. You will never regret if you choose Laravel.

Laavel Logo

If there will be any bug in the PHP language then Laravel will take care of that. If there will be any breaking change in PHP language then Laravel will take care of that.

Features

  • CLI (artisan)
  • Supports Model View Controller(MVC)
  • Template Engine(Blade)
  • Authentication
  • Query Builder
  • Easy Routing Configure (API/Website)
  • Data Migration
  • High Security and Error Handling

Nowadays PHP is criticized so much that sometimes developer don’t wa to call themselves as PHP developer. Instead they call Laravel Developer or WordPress Developer.

PHP Simplicity

As PHP is simple and build with all the simplicity. It very much easy to get started with PHP.

If you have any experience with Programming then you will start feeling comfortable with PHP in less than a week. If you are comfortable with SQL then your your website will connected to databases in your first week of learning.

PHP is similar to C Language Syntax style.

If you have experience with programming language i.e C, C++, C#, Java, Perl, etc then you already know the basics.

random.php
<?php
  // variable
  $x = 5;

  // if else
  if($x === 5){
    print "X is 5";
  }

  // for loop
  for($num = 1 ; $num <= 10 ; $num++){
    print "Square of $num is {$num * $num} ";
  }

These are the features which is being commonly used in any language. If you are coming from any programming background then you will feel comfortable with PHP.

Because of the simplicity there are lots of PHP developer out there whose first choice is PHP. Usually clients don’t care much about the Technology, they only only wants working website(web app).

PHP developers are cheap!

Some of your might think PHP developers are cheap and that’s why PHP is ruling the WEB.

Not all PHP developers are cheap, only beginners are cheap. As PHP is easy to learn because of that there are lots of programmers out there.

Let’s divide the PHP developers in three category:

  • Basic Developer: There are Novice developer and have some knowledge about PHP. There are quite cheap in price.
  • Intermediate Developer: Company mostly hires these kind developers because they have a good experience and take care of the security and also write maintainable code.
  • Expert Developer: These are hardcore PHP developer and can solve almost all the PHP related problems. These developers are very much expensive only Hired foe Giant project.

In most of the case, Intermediate developer works fine. They have the knowledge about the coding standard, takes care of security and also they write maintainable code. You can trust these kind of developers but these developers aren’t cheap.

Yes, I agree little bit on this point that php is developers are cheap that’s why it is ruling the web. It’s not only the factor there are lots of complex website which is build by intermediate and expert and that aren’t cheap.

Most of the websites are simple and because of that people mostly hires Novice programmer.

Alternative to PHP

I know some of you might even not tried the PHP because you see memes about PHP everywhere. If there is so much memes about the PHP then how bad PHP will be. This reason might stopped you to give a try to PHP.

PHP is so simple that I recommend people to learn PHP as their first backend stack.

That memes is there to keep you away from the 3/4 market and don’t let the competition to increase.

Top 5 backend stack

This isn’t a random list I put the stacks in the descending order.

  • ASP.NET
  • Ruby
  • Java
  • Scala

Those who are wondering, here are only 4 stacks then you totally forget that PHP is at No. 1.

Some more

  • Python
  • Node.js

I added some more backend language because most of the recent developers are using these two. And also these are growing very fast. Remember these are still not in two 5 used backend stack.

Why php is hated?

In 1994, Rasmus Lerdorf(creator of PHP) original reason to start PHP was to maintain his personal homepage. Later he extend to work with form and communicate with database and this is called Form Interpreter(PHP/FI).

From Wikipedia : Early PHP was not intended to be a new programming language, and grew organically, with Lerdorf noting in retrospect: “I don’t know how to stop it, there was never any intent to write a programming language […] I have absolutely no idea how to write a programming language, I just kept adding the next logical step on the way.” A development team began to form and, after months of work and beta testing, officially released PHP/FI 2 in November 1997.

The fact that PHP was not originally designed, but instead was developed organically has led to inconsistent naming of functions and inconsistent ordering of their parameters.

This lead people to hate PHP and inconsistent becomes one of the main reason to hate.

Reasons why people hate PHP

  • Inconsistencies
  • security issues
  • Loosely typed

When you upgrade the PHP(version) there is very much possible that it might break. To improve the PHP and fix current or possible future bugs they unwillingly need to do it. All breaking changes make it more secure and stable for the future.

So, upgrading PHP Version cost your time and time is money. There was lots of common security bugs in PHP i.e. SQL Injection. I am pretty sure most of you are aware about this bug.

When I upgrade my PHP version to 7, my code got failed. I replace some of the function and my website starts running again. Upgrading PHP can be painful but with the upgrade, I eliminated of code. My code becomes more secure. As I understand why they removed the function, so I don’t have any issue with that.

Before removing the function they deprecated that function in PHP 5. So, any good developer will never use any deprecated functions. When I build that website I was a novice and I was entry level developer.

Type safe language are love and it reduces possible bug and improve code quality. JavaScript is also hated because of this reason. Loosely typed system gives you a lot of flexibility, it lacks the capability of a strongly typed system.

But In general, people don’t like loosely typed language. Loosely type is one of the reason of Javascript is also being hated.

Conclusion

No one brings any breaking changes willingly. To improve something, sometimes we need to do some of the things unwillingly also.

Don’t hate PHP anymore, it’s very much stable now. Neither I nor any one have problem with anyone’s opinion that PHP is going to die soon. I wrote this article to let you know PHP still have 3/4 part of the WEB.

Just because lots of memes out there doesn’t mean people will start migrating to some other technology. But memes might stop new developers to stop trying PHP and that’s bad.

If you haven’t tried PHP yet then give a try and you will love it. It has been more than 25 year and now it’s very much stable try it today!