PHP 7 accelerates many dynamic websites by over 100% compared to PHP 5.6 through OpCode caching and an optimized Zend engine.
For your visitors, this means a better user experience due to faster page set-up, for your website an improved ranking on Google due to higher page speed.
Speed improvements in PHP 7
PHP 7 achieves the enormous increase in speed primarily through improvements to the Zend Engine, extended OpCode caching, an improved data structure and thus reduced memory requirements and more efficient memory management.
How OpCode Caching Works
Normally PHP scripts are compiled at runtime. Part of the computing time is required to convert the code. When using OPcache, this calculation is performed only once and the precompiled, script is stored in a cache. The script can subsequentially be loaded from this cache at lightning speed if required. In most cases this leads to considerable speed improvements.
Especially larger websites can handle much more requests simultaneously with OPcache activated - an important advantage for corporate websites and eCommerce applications.
How to Disable OPcache
Opcode Caching is enabled by default for all websites. In case you want to disable it you can do so by doing the following:
Enter in your .htaccess
file:
php_flag opcache.enable Off
or you can place the following in your php script
:
ini_set('opcache.enable', '0');