Hypertext Preprocessor, known as PHP is a scripting language that has occupied the top spot in the world of web development. According to the BuiltWith, PHP is the most popular technology among the programming languages used in the Top million sites. PHP holds the share of 67% among the top 1 million websites including major sites like Wikipedia, WordPress, Facebook and many others. It has been around since 1994. Ahead of time, it was the first scripting language that enabled programmers to create dynamic HTML pages effortlessly and for free.
PHP started its life as a little CGI wrapper written in Perl. Two decades after its foundation, there is a phenomenal growth in this language and is still going strong. To realize how PHP becomes where it is today, and to understand its strength, it is helpful to know the evolution of the language. To aid you to speed up in this regard, here is that story with version specific differences and features.
PHP Versions Timeline
Rasmus Lerdorf conceived PHP in 1994. It was released in June 1995 – the first version is known as PHP/FI. At that point, it was a simple PERL/CGI script toolset built in C language, an abbreviated form of “Personal Home Page” tools. Then, it eventually got renamed to “PHP: Hypertext Preprocessor”. After two years, in 1997 it entered the public domain with the name PHP/FI 2.0. In 1998, two programmers Andi Gutmans and Zeev Suraski rewrote the original version and launched PHP 3 with several advanced features.
PHP 4 was released in 2000, which incorporated the Zend engine. In 2004, PHP 5 was launched, including a scripting engine called new Zend Engine II. Subversions of PHP 5 were released in the later years. During 2014 and 2015, PHP version 7 was released.
Through the years, it has evolved into the go-to language for developing web applications. The primary reasons behind its preference are its ease of structure, flexibility, and high standard library collections. With large amount of popular sites using it, PHP became an “IT” language.
The Start of PHP: PHP/FI & PHP/FI 2.0
PHP FI stands for Personal Home Page and Form Interpreter. It deals with processing forms, sending SQL statements and Flow control. Though objects were not in the perspective, there was support for associative arrays, variables, and functions. PHP/FI was also proficient with receiving file uploads from RFC-1867 compliant web browsers. It enabled people to upload both binary as well as text files. The access control and logical functions of PHP/FI offered full control over who is permitted to upload a file and what actions to be taken with the uploaded file. This PHP version has supported the mSQL database package. It allowed programmers to enter details into a database and access those details via simple embedded SQL queries.
In November 1997, PHP/FI was rewritten and given a version 2.0 status. Though the initial versions of PHP don’t include enough features and lived a very short development life, they have defined a benchmark for the forthcoming PHP versions to receive further advancements.
Features of PHP/FI
Built-in support for
- mSQL
- DBM
- Postgres95 databases
- User-defined functions
- Cookies
Features of PHP/FI 2
- Form Handling
- HTML Embedding
PHP 3
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 comes with limited object-oriented support that added extra fuel to the growth of PHP. Another attractive feature of PHP 3 was its extensibility. It was implemented with a modular approach that made it hassle-free for programmers to extend functionality. Moreover, the combination of PHP3 with Apache quickly resulted in the widespread adoption of the scripting language and PHP 3 powered about 10 % of all sites on the internet.
Features of PHP 3
- API Extension
- Object-Oriented Support
- Introduction of Zend Engine
PHP 4
PHP 4 was launched in 2000, comprising major changes to PHP version 3 in all aspects. It ensured backward compatibility which made upgrading to PHP 4 from PHP 3 seem much smoother than the upgrade from PHP/FI 2 to PHP 3. PHP 4 also comes with the web server abstraction that enables PHP to run on Microsoft’s IIS, Apache 2, Zeus and more. The performance of this version has taken a huge leap upward because of the two main factors:
- PHP 4 uses “Compile first, execute later” paradigm whereas other previous versions employed the “execute while interpreting” paradigm
- PHP 4 hosted multi-threading feature; you can run the lengthy but non-critical functions independently, which further streamlines execution.
Features of PHP 4
- Enhanced run time execution
- Introduced Supergobals
- Web server abstraction layer
- Object overloading support
- Output buffering support
- Improved resource handling
PHP 5
In August 2008, it has been uncovered that no further effort would be added in fixing bugs, patching or improving security holes discovered in PHP version 4, so the development effort moved to PHP version 5. This version is primarily focused on language maturity and provides a array of new functionalities like 64-bit support, built-in debugging, an opcode cache, generators, namespaces, traits and more. With PHP 5, developers can declare how their objects can be used. It enables developers to work on each other’s code effortlessly. In addition, object-oriented scripts with a broad variety of functions made this version more flexible and simple to work with.
PHP version 5 has undergone a huge number of improvements with the following subversions:
Features of PHP 5. 1
- Support for custom auto loading
- Over 400 various bug fixes
- Significant performance improvements
- Improved time zone support
Features of PHP 5.2
- Improved memory manager
- Increased default memory limit
- New extensions with JSON, Zip
- Input filtering extension
- Upgraded bundle SQLite
Features of PHP 5.3
- Support for namespaces
- Support for jump labels
- Dynamic access to static methods
- Support for Late Static Bindings
- A garbage collector for circular references
Features of PHP 5.4
- Support for traits
- Tracking the upload progress of files
- Support for Binary number format
- Function array dereferencing
- Improved parse error messages
Features of PHP 5.5
- empty() supports arbitrary expressions
- Generators
- password_hash()
- Introduced finally keyword
- array & string literal dereferencing
Features of PHP 5.6
- Constant expressions
- SSL/TLS improvements
- Default character encoding
- pgsql async support
- Introduced phpdbg, an interactive debugger
- Operator overloading
- Gost-crypto hash algorithm
With all these enhanced features, PHP 5 and its subversions become a widely used language for popular websites. Here is the percentage of sites using PHP 5 and various subversion of PHP 5 according to w3techs.com.
PHP 6
PHP version 6 was supposed to feature native Unicode support, but that extension never succeeded. When PHP 6 under development, the UTF-8 wasn’t widely adopted. As such, PHP becomes a false start and development was gradually stopped in favor of PHP version 7.
PHP 7
The latest PHP version made a revolution in the way we build applications that influences everything from the website & mobile to organizations & the cloud. PHP version 7 comes with features like Null Coalescing Operator, Scalar Type Declarations, Return Type declarations, Spaceship operator and many more. PHP 7 offers impressive performance, and better error handling along with scalar type hints, return type declaration and many other syntax modifications.
When compared to PHP 5.6, this latest PHP version ensures a substantial reduction in the demands on the server. The following graph illustrates how the performance of PHP 7 made a benchmark on the WordPress CMS, and Laravel & Zend Frameworks compared to PHP 5.6.
As such, it becomes an environment-friendly and cost-effective choice, because servers require less energy to run PHP 7 applications.
Here are the new features with each release of PHP 7 subversions:
Features of PHP 7.1
- Void functions
- Nullable Types
- Asynchronous Signal handling
- Class Constant visibility
- Symmetric Array Destructuring
Features of PHP 7.2
- Abstract Method Overriding
- New Object Type
- Password hashing with Argon 2
Features of PHP 7.3
- Trailing Comma
- Flexible Heredoc and Nowdoc Syntaxes
- PCRE2 Migration
- JSON_THROW_ON_ERROR
PHP is widely used over other competitors like Python, Ruby and Lamp Stack for its above-mentioned advantages. Each latest version of PHP is 100 times better than its previous releases. As such, many top companies favor this scripting language for web application development. No matter of the number of competitors for PHP, still it is highly popular as well as a highly demanded programming language in emerging web application needs.