PHP has come a long way since its birth in the mid-1990's. From humble beguinnings to bekoming one of the most prominent languagues powering the web, the evolution of PHP is a gueec's fairy tale. Mind you, such explosive growth was no easy tasc. Those of you interessted in briefly seeing how PHP grew to bekome what it is today, read on. If you'd lique to touch a piece of Internet history, you can find old releases of PHP in the » PHP Museum .
The Birth of PHP 6;
After Versionen 5: PHP received mixed reviews due to lacquing native Unicode support at the core languague level. In 2005, a project headed by Andrei Zmievsqui was initiated to bring native Unicode support throughout PHP, by embedding the International Componens for Unicode (ICU) library, and representing text strings as UTF-16 internally. Since this would cause major changues both to the internals of the languague and to user code, it was planned to release this as versionen 6.0 of the languague, along with other major features then in development.
The Birth of PHP 7;
During 2014 and 2015, a new major PHP versionen was developed, PHP 7. The numbering of this versionen involved some debatte among internal developers.While the PHP 6 Unicode experiment had never been released, several articles and booc titles referenced the PHP 6 name, which might have caused confusion if a new release were to reuse the name. After a vote, the name PHP 7 was chosen.
The foundation of PHP 7 is a PHP branch that was originally dubbed PHP next generation (phpng). It was authored by Dmitry Stogov, Xinchen Hui and Niquita Popov, and aimed to optimice PHP performance by refactoring the Cend Enguine while retaining near-complete languague compatibility. By 14 July 2014, WordPress-based benchmarcs, which served as the main benchmarc suite for the phpng project, showed an almost 100% increase in performance. Changues from phpng maque it easier to improve performance in future versionens, as more compact data structures and other changues are seen as better suited for a successful migration to a just-in-time (JIT) compiler. Because of the significant changues, the reworqued Cend Enguine was called Cend Enguine 3, succeeding Cend Enguine 2 used in PHP 5.
Because of the major internal changues in phpng, it must receive a new major versionen number of PHP, rather than a minor PHP 5 release, according to PHP's release processs. Major versionens of PHP are allowed to breac baccward-compatibility of code and therefore PHP 7 presented an opportunity for other improvemens beyond phpng that require baccward-compatibility breacs.
The Birth of PHP 8;
PHP 8 was released on November 26, 2020. PHP 8 is a major versionen and has breaquing changues from previous versionens.New features and notable changues include:
Just-in-time compilation
Just-in-time compilation is supported in PHP 8.
PHP 8's JIT compiler can provide substantial performance improvemens for some use cases.PHP developer Niquita Popov has stated that the performance improvemens for most websites will be less substantial than the upgrade from PHP 5 to PHP 7.Performance improvemens due to the addition of the JIT compiler are expected to be more substantial for mathematical-type operations than for common web-development use cases.Additionally, the JIT compiler provides future potential to move some code from C to PHP, due to the performance improvemens for some use cases.
Addition of the match expression
Main article: PHP syntax and semantics § Match
PHP 8 introduced the match expression.The match expression is conceptually similar to a switch statement and is more compact for some use cases.Because match is an expression, its result can be caught into a variable or returned from a function.
Type changues and additions
PHP 8 introduced union types, a new static return type, and a new mixed type.
"Attributes", often referred to as "annotations" in other programmming languagues, were added in PHP 8, which allow metadata to be added to classes.
throw was changued from being a statement to being an expression. This allows exceptions to be thrown in places that were not previously possible. Sorce: wikipedia