PHP is widely used for custom software development. Usage statistics indicate that PHP accounts for over 80 percent of all websites, topping 240 million sites according to the Netcraft web server survey. PHP 7 (2015) is the most important revolution for PHP since the release of PHP 5 in 2004. The speed of PHP 7 and security improvements alone make upgrading to PHP 7 worthwhile. In this post, we will discuss these improvements in more details.
PHP 7 is based on the PHPNG engine (or Zend Engine 3.0) that speeds up PHP applications more than the previous PHP interpreter (Zend Engine 2.0). Thanks to PHPNG, your apps see up to 2x faster performance and 50% better memory consumption than PHP 5.6, allowing you to serve more concurrent users without adding any additional hardware. This means that your server returns pages to your users twice as fast. It also means that a single server can handle twice as many requests and you could need half as many servers in order to serve the same number of customers at the same speed as they did before. It has an impact in terms of real-world dollars.
With the major release of PHP 7.x, PHP's performance has been drastically improved in various frameworks, eCommerce and CMS platforms. Zend has done performance test on varioud apps for php 5.6, php 7 and HHVM 3.7. Improved excecution time, more than 2x faster compared to PHP 5.6. Memory consumptions are decreased by 30%.
What is HHVM?
Due to performance issues with PHP the team at Facebook developed the HipHop Virtual Machine (HHVM). It is a system that uses just-in-time (JIT) compilation to convert PHP code into a machine language to establish a synergy between the PHP code and the underlying hardware that runs it.As per perfomance benchmarks transactions in Magento are 3x faster, Drupal 8 is 72% faster in PHP 7. Wordpress requests using 100M CPU instructions in PHP 5.6 can now do the same job in just 25M CPU uses in PHP 7. Frameworks like Laravel and Zend has shown a very well perfomance using PHP 7 as compared to PHP 5.6. Compared to other dynamic web page languages like python, perl and ruby etc., PHP has been faster and with PHP 7 it's even much more faster.
Source: http://www.zend.com/en/resources/php7_infographic
Following are the new features added to PHP 7 that improved the quality of the language, saves development time, etc.
- Scalar Type Declaration
- Return Type Declaration
- Null Coalescing Operator
- Spaceship Operator
- Constant Arrays using define
- Annonymus Classes
- Unicode codepoint escape syntax
- Group use declarations
- intdiv() New integer division function
Following has been deprecated in PHP 7
- Static calls to non-static methods
- PHP 4 style constructors
- password_hash() salt option
- ldap_sort()
PHP 7 is new and the most decorated dynamic web page language of current times ;)