PHP emerged as a natural ally for web development over the past decades of digital revolution on internet. From almost an experimental effort of Rasmus Lerdorf in 1994 who referred to it as “Personal Home Page”, this soon became the ubiquitous choice of websites. However, with other options arriving like Ruby and RoR, Python, not to speak of already existing competitors like the jsp, asp.net, etc, a question that is often asked is if PHP is fast becoming obsolete? Well, doesn’t look like!
Recent usage statistics by W3Techs.com, PHP is used for server-side programming by 79.2% of all the websites even today. However, PHP has come a long way from PHP 3.0 to PHP 7.0 and is now on its way to PHP 8.0. A relative assessment of various versions of PHP being used in PHP based sites shows that these sites adapted to such transitions quite well. As of today, while most of the sites have moved on to PHP 7.0, many are in the process of this transition. It is therefore, anyone’s guess that when PHP 8.0 stabilizes, this loyalty shall stay with the scripting language.
The question therefore remains Why does PHP continue to be the web’s favorite?
Before we answer this question, let us see how this language evolved to address the changes in technology.
PHP 3.0 was the first version that closely resembles PHP as it exists today.
Zeev Suraski and Andi Gutmans realized that PHP was lacking some common features. They decided to rewrite the scripting language, so they teamed up with Rasmus to launch PHP 3. PHP 3 came with limited object-oriented support that added extra fuel to the growth of PHP. Some of its features were
After the work on rewriting the core of PHP started, the next version of PHP that got released was PHP 4.0 in 2000. The PHP 4.0 introduced several new features including:
After almost four years of introduction of PHP 4.0, the new version of this server side scripting language was introduced. This version gave PHP an unprecedented popularity and acceptance, and PHP made its mark on millions of servers across the globe. The major features offered by this newer version of PHP included:
This is the most current version of PHP which is in use today, and it was introduced in 2014 with colossal performance improvements. This version of PHP was up to twice as fast as its predecessor, PHP 5.6 and introduced many imperative enhancements while deprecating the features from the previous branch.
Some of the top improvements introduced with PHP 7.0 include:
Considering that the recent significant transition is from PHP5 to PHP7, this article shall focus on just these for the moment.
|Feature||PHP 5||PHP 7|
|Speed and Performance||Uses Zend II engine. Offers High speed, but insufficient for developer’s requirements.||Designed to increase performance, ensures faster loading of websites and increased performance of scripting.|
|64 Bit Supported||not supported||supported|
|Handling of Fatal Errors||difficult to handle||With PHP7, handling fatal errors is effortless|
|Return Type||PHP5 is not integrated with functionalities||return type of a function can be declared|
|Memory||Consume more memory||Consume less memory|
|Security||Less secure||More secure|
So while there are many limitations that PHP needs to overcome as it evolves, the reason why developers prefer to use PHP are