Open SourceThe State of PHP in 2014

The State of PHP in 2014

Developer.com content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Where We Came From

PHP has come a long way from humble beginnings: it started out being a collection of tools (mostly Perl scripts) that recorded the traffic on Rasmus Lerdorf’s online resume (PHP stood for Personal Home Pages,) and has risen to being a fully (almost) object oriented language. It has become the leading language on the web: more websites run on PHP than all the other websites combined (we’ll look at the stats shortly.) In the mean time sites like Facebook and Wikipedia have grown to dominate the web, CMS systems like WordPress, Joomla, Drupal and many more have become the foundations of a great number of websites, and frameworks have blossomed: from Codeigniter to Zend Framework, Yii to Laravel, you are simply swamped with choices when searching for one to use. Design patterns seem to matter lately, with MVC being the most popular.

When you stop to think about it, you wonder why so many websites are built on PHP. If you have ever developed anything in PHP, though, you will realize why: PHP is easy to learn, has great documentation, is simple to host and setup on a server and there are many IDEs that support PHP to a great degree (Zend Studio, Netbeans and PHPStorm are just the top of a very deep barrel.) You can connect PHP to just about any database, including – but not limited to – MySQL, MSSQL and Oracle.

Where We Are Now

PHP is currently experiencing it’s golden age. I think this is because we have reached a point where more and more people are trying to learn to code, and the go-to language is currently PHP. Let’s face it: you can put a WordPress blog together in no-time at all, and, using the excellent documentation, easily modify it as required. Do that long enough, and you’ll start to understand the language. That’s the good thing about where we are at this point in time.

The bad thing about where we are right now is that PHP is at a kind of precipice: and the next few years are vital to its existence. I don’t think PHP is ever going to fall off the map completely – at least not in my lifetime – but I do think that what Zend does next will make or break it. Will PHP 6 be a complete rewrite of the core engine? Will PHP 6 address the developer annoyances with PHP? Will PHP 6 ever even be released? We’ve been waiting for it for about 3 years now, and even Zend is mum on the subject. PHP has a lot of competition out there. ASP.net is one of them, but I think that the Ruby On Rails framework is a greater threat. Ruby is a great language and is also easy to learn. It’s not that simple to host it, yet, but I believe that will change. If Zend drops the ball today, tomorrow will not look too good for PHP.

These are a few of the problems we are currently facing with PHP. Let’s not kid ourselves. The language is inconsistent. Some functions can be called function_name() and others functionname(). The old ‘needle’ and ‘haystack’ (some functions arguments are function($needle, $haystack) while others are function($haystack, $needle)) issue is also a minor annoyance that forces me to visit php.net more often that I would really like to do. There are so many duplications of core functionality that it can become confusing to beginners. Not having scalar functions ($text->length(), for example) is a problem that, if solved, would make so many others go away. Am I being a sceptic? Yes, I guess I am. But as someone who has his primary income directly hitched to the PHP language, I think I have the right to be. I love PHP, but I hate the problems it currently has.

Statistics

Let’s take a look at some stats. According to w3techs.com, PHP is used by 81.7% of all websites. Of all these websites, 97.6% are using PHP 5, as can be seen in Figure 1.

Percentage of Websites using PHP
Figure 1

PHP is still growing, although the growth has seemed to level out a bit, as expected. See Figure 2.

Usage of PHP for Websites
Figure 2

A look at the market position (Figure 3) is quite interesting. This shows us that more sites than not use PHP, but that PHP’s average site traffic is less than, for example, Java sites. I believe this is due to the high security factor of Java sites, especially in the financial and enterprise application sectors.

PHP Market Position
Figure 3

PHP is clearly the current market leader. But is this going to stay that way?

Let’s take a peek into the future.

Where We Are Going

This is dangerous territory. I don’t think the folks at Zend are telling us anything more than we want to hear when we ask about PHP’s future. PHP 6 is rumored, and although anyone can speculate about what this version would entail, it is hardly worth trying. Nobody expected PHP 5 to be extended into so many versions, and to make such huge leaps in each version increment. PHP 5.3, which was the greatest change in terms of functionality, was probably supposed to be PHP 6. Many of the new features in PHP 5.3 were indeed promoted as PHP 6 features, and some features that were promised for PHP 6 have also shown up in PHP 5.4 and 5.5.

What I see happening in the future is dependent on what Zend actually does with PHP. Since the death of Steve Jobs, Apple seems to be quite happy reiterating iPhone and iPad versions. Will Zend do the same with PHP? Certainly, PHP 5 is leaps and bounds ahead of PHP 4. If PHP 6 does come soon, I’m hoping it will add a lot of direction to the language, and sort out the issues. Completing the object model would be nice too.

But what about the other, less popular, iterations of PHP? PHP was built for the web – we know that – but recently there has been a strong interest in PHP for desktop. There are a number of PHP implementations meant for building desktop software, most notably PHP-GTK, although the PHP-GTK website last was updated in 2010. A recent revival of the wxPHP project has made significant improvements to the language and has become quite popular. I’m hoping this goes well, but I don’t want anyone to forget that PHP is a web language, and that’s what it should be doing. It’s nice to play with PHP desktop apps, but these things belong to programming languages that are built for those purposes. I do see a string resurgence of desktop applications written in PHP this year, though, fuelled more by the frustration of PHP developers who get more and more clients requesting desktop applications. My own feeling is that this will fall away eventually. I personally think the web is going to kill the desktop application market.

The trend in PHP growth shows no sign of abating, however, and I think that this is the decade of the developer. I believe more and more people – and I’m not just talking about school leavers here – are starting to realize the benefits of understanding some kind of computer language. PHP is a good fit, again, and I think this is going to spur the growth on at a rapid rate.

Final Thoughts – The Mobile Revolution

Let’s face it – native mobile development is not for the masses. Java and Objective-C development is hard, and takes time to learn. Most people don’t have the time or patience to go through a one-year course in order to learn these languages. Step in – PHP. Using something like Phonegap or Appcelerator, mobile development across all platforms becomes almost trivial. If you know HTML, CSS and some JavaScript, you can easily develop an application. If you know some PHP, you can use it to create a web service that feeds your app it’s content. Zend have already launched phpcloud.com, a website that allows you to setup development environments in the cloud. It is also easy to setup web services with this cloud based hosting, and with Zend Studio, it becomes a matter of drag and drop to do so.

The mobile revolution is going to change things a lot within the next three years. Mobile applications already depend on the cloud, to a certain extent. I think this is going to grow and I believe that the cloud is going to be the next space to be in within the next 5 years, and PHP is going to be a big contributor to this.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories