{"id":32635,"date":"2015-11-12T10:39:07","date_gmt":"2015-11-12T17:39:07","guid":{"rendered":"http:\/\/webdesignledger.com\/?p=32635"},"modified":"2015-11-13T09:46:18","modified_gmt":"2015-11-13T16:46:18","slug":"php-7-whats-new-how-will-it-affect-a-wordpress-site","status":"publish","type":"post","link":"https:\/\/webdesignledger.com\/php-7-whats-new-how-will-it-affect-a-wordpress-site\/","title":{"rendered":"PHP 7: What&#8217;s New &#038; How Will It Affect a WordPress Site?"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-32639 lazyload\" data-src=\"https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/PHP7.png\" alt=\"PHP7\" width=\"798\" height=\"354\" data-srcset=\"https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/PHP7.png 798w, https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/PHP7-500x222.png 500w, https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/PHP7-610x271.png 610w\" data-sizes=\"(max-width: 798px) 100vw, 798px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 798px; --smush-placeholder-aspect-ratio: 798\/354;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-32639\" src=\"https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/PHP7.png\" alt=\"PHP7\" width=\"798\" height=\"354\" srcset=\"https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/PHP7.png 798w, https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/PHP7-500x222.png 500w, https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/PHP7-610x271.png 610w\" sizes=\"(max-width: 798px) 100vw, 798px\" \/><\/noscript><\/p>\n<p><span style=\"font-weight: 400;\">PHP 7, a major update to the server-side web development language PHP, is right around the corner. According to <\/span><a href=\"https:\/\/wiki.php.net\/todo\/php70#timetable\"><span style=\"font-weight: 400;\">PHP 7 project timetable<\/span><\/a><span style=\"font-weight: 400;\"> mentioned on PHP.net wiki, if everything goes as planned, its final version will be released on Nov 12, 2015. Meanwhile, you as a future user may consider playing around with the <\/span><a href=\"https:\/\/downloads.php.net\/~ab\"><span style=\"font-weight: 400;\">latest beta<\/span><\/a><span style=\"font-weight: 400;\"> to have an overview of what features the new version of PHP offers and how it will shape up and affect your development work.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you\u2019re a website developer\/owner running their sites on WordPress (or on any other PHP-powered CMS such as Joomla, Drupal, Magento), then you\u2019ve landed to the right blog post. This informative guide will not only give you a taste of what\u2019s new coming in PHP 7 but also will answer all your questions related to the new PHP version!<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-32636 lazyload\" data-src=\"https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Wordpress-php7-performance.jpg\" alt=\"Wordpress-php7-performance\" width=\"700\" height=\"391\" data-srcset=\"https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/Wordpress-php7-performance.jpg 700w, https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/Wordpress-php7-performance-500x279.jpg 500w, https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/Wordpress-php7-performance-610x341.jpg 610w\" data-sizes=\"(max-width: 700px) 100vw, 700px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 700px; --smush-placeholder-aspect-ratio: 700\/391;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-32636\" src=\"https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Wordpress-php7-performance.jpg\" alt=\"Wordpress-php7-performance\" width=\"700\" height=\"391\" srcset=\"https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/Wordpress-php7-performance.jpg 700w, https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/Wordpress-php7-performance-500x279.jpg 500w, https:\/\/webdesignledger.com\/wp-content\/uploads\/2015\/11\/Wordpress-php7-performance-610x341.jpg 610w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/noscript><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-32638 lazyload\" data-src=\"https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Drupal-on-PHP7.jpg\" alt=\"Drupal on PHP7\" width=\"1024\" height=\"569\" data-srcset=\"https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Drupal-on-PHP7.jpg 1024w, https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Drupal-on-PHP7-500x278.jpg 500w, https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Drupal-on-PHP7-768x427.jpg 768w, https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Drupal-on-PHP7-970x539.jpg 970w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/569;\" \/><noscript><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-32638\" src=\"https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Drupal-on-PHP7.jpg\" alt=\"Drupal on PHP7\" width=\"1024\" height=\"569\" srcset=\"https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Drupal-on-PHP7.jpg 1024w, https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Drupal-on-PHP7-500x278.jpg 500w, https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Drupal-on-PHP7-768x427.jpg 768w, https:\/\/storage.googleapis.com\/webdesignledger.pub.network\/WDL\/2015\/11\/Drupal-on-PHP7-970x539.jpg 970w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/noscript><\/p>\n<p><span style=\"font-weight: 400;\">Let\u2019s dive in!<\/span><\/p>\n<p><strong>What&#8217;s New in PHP 7?<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">First of all, let\u2019s take a closer look at some of the exciting features and improvements that you\u2019ll see in PHP version 7:<\/span><\/p>\n<p><strong>Huge Performance Improvements:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">PHP has always been criticized for performance-related issues, which is greatly improved in PHP 7. Even, the poor performance of PHP prompted Facebook to build <\/span><a href=\"http:\/\/hhvm.com\/\"><span style=\"font-weight: 400;\">HHVM<\/span><\/a><span style=\"font-weight: 400;\"> &#8211; a virtual machine designed to maximize the performance of PHP based applications. Since the new version of PHP is based on the <\/span><a href=\"https:\/\/wiki.php.net\/phpng\"><span style=\"font-weight: 400;\">PHPNG project (PHP Next-Gen)<\/span><\/a><span style=\"font-weight: 400;\">, it gives up to 50% boost to real-world apps and performs <\/span><a href=\"https:\/\/www.zend.com\/en\/resources\/php7_infographic\"><span style=\"font-weight: 400;\">faster than HHVM<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><strong>Twice as fast as Previous Versions:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">PHP 7 is almost <\/span><a href=\"http:\/\/talks.php.net\/fluent15#\/wpbench\"><span style=\"font-weight: 400;\">2X faster than PHP 5.x<\/span><\/a><span style=\"font-weight: 400;\">. It not only executes your code faster but also requires fewer servers to handle the same amount of requests per second. As an example, the WordPress homepage now <\/span><a href=\"http:\/\/www.zend.com\/en\/resources\/php-7\"><span style=\"font-weight: 400;\">requires 72% lesser CPU instructions<\/span><\/a><span style=\"font-weight: 400;\"> to execute than before. That\u2019s because PHP 7 receives a brand new version (refactored) of Zend Engine, which adds a significant speed enhancement to the language.<\/span><\/p>\n<p><strong>New Operators:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">PHP 7 introduces two new operators: Spaceship (Combined Comparison) and Null Coalescing. Where the Spaceship operator (&lt;=&gt;) makes your chained comparison more concise, on the other hand, Null Coalescing (??) operator is used to check if something exists. However, these both tasks could be accomplished before, but probably not in all conditions.<\/span><\/p>\n<p><strong>Return &amp; Scalar Type Hints:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">In the new PHP version, developers would be able to use Booleans, Strings, Floats and Integers as type hints for functions. Also, they\u2019ll be allowed to declare the return type of a function. This will save them passing and returning wrong types from functions, which may lead to unpredictable behavior in code.<\/span><\/p>\n<p><strong>Engine Exceptions:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Handling existing fatal and recoverable fatal errors has always been a herculean task for PHP developers. But now, exceptions implemented in the brand spanking new Zend engine will facilitate error handling in your application. The new Engine Exceptions will replace these kinds of errors, making it possible for developers to catch all fatal errors and take appropriate action immediately.<\/span><\/p>\n<p><strong>Consistent 64-Bit Support:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Even though the native environment of PHP is Linux, but still you can <\/span><a href=\"http:\/\/windows.php.net\/\"><span style=\"font-weight: 400;\">run it on a Windows-powered system<\/span><\/a><span style=\"font-weight: 400;\">. Since the previous versions of PHP doesn\u2019t have support for a large file or 64-bit integer, the x64 builds of PHP for Windows have been considered experimental yet. To the contrary, version 7 features consistent 64-bit support that enables you to confidently run PHP on a 64-bit Windows system.<\/span><\/p>\n<p><strong>Group Use Declarations:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">PHP 7 introduces a new concept, called Group Use Declarations, which dramatically improves the implementation of PHP namespace. The new syntax makes it possible for you to import multiple classes from the same namespace. Needless to say, this new feature will save you a lot of typing time and also make your code shorter and readable.<\/span><\/p>\n<p><strong>Supports Anonymous Classes:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Like other programming languages such as Java and C#, the new version of PHP enables you to use anonymous classes in your code. An anonymous class is a class with no name. When used properly, anonymous classes can not only improve your coding but also can speed up execution time to a great extent.<\/span><\/p>\n<p><strong>Abstract Syntax Tree (AST):<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Another big change made to PHP core is the use of Abstract Syntax Tree (AST) as an intermediary stage in the language compilation process. This improvement would mainly be visible to developers and not have any direct impact on userland code. There are several advantages of using AST, including the potential for more optimizations, the scope for utilizing tools like static code analyzers and better code quality etc.<\/span><\/p>\n<p><strong>Deprecated Items Removed: <\/strong><\/p>\n<p><span style=\"font-weight: 400;\">To make PHP even faster, a number of deprecated functionalities and dead or unsupported Server APIs and extensions have been eliminated from the version 7. \u00a0Some of the items that are removed from PHP 7 are PHP4 style constructors, ASP style tags, ereg and MySQL extensions etc. For more details, you may check out <\/span><a href=\"https:\/\/wiki.php.net\/rfc\/remove_deprecated_functionality_in_php7\"><span style=\"font-weight: 400;\">removed deprecated functionalities in PHP7<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><strong>But, where is PHP 6?<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">After getting acquainted with the exciting features of PHP 7, you would definitely want to know why PHP moved to version 7 from version 5. What happened to version 6? Well, <\/span><a href=\"https:\/\/wiki.php.net\/rfc\/php6\"><span style=\"font-weight: 400;\">PHP 6<\/span><\/a><span style=\"font-weight: 400;\"> was an experimental project that was officially started in 2005 and unfortunately abandoned in 2010. One of the main reasons behind the termination of version 6 was technical difficulties faced by PHP core developers during the implementation of language-integrated Unicode.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Meanwhile, people around the web adopted the name PHP 6 and started writing books and developing resources related to version 6. Since there might be confusion between the former attempt and the current development work, the PHP core team was compelled to seriously think about the name of the new major release. And finally, the development team decided to skip the logical number 6 and launch the new version under the name of PHP 7.<\/span><\/p>\n<p><strong>How Can PHP 7 Really Affect Your WordPress Site?<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Despite the fact that WordPress core development team is <\/span><a href=\"https:\/\/make.wordpress.org\/core\/2015\/09\/10\/wordpress-and-php7\"><span style=\"font-weight: 400;\">continuously working<\/span><\/a><span style=\"font-weight: 400;\"> on making the CMS ready for PHP7, the latest version of PHP can break your site. The reason is the incompatibility of themes and plug-ins with PHP 7. Even though WordPress has suggested theme and plugin authors to get familiarize with <\/span><a href=\"https:\/\/github.com\/php\/php-src\/blob\/php-7.0.0RC2\/UPGRADING\"><span style=\"font-weight: 400;\">all backward incompatible changes<\/span><\/a><span style=\"font-weight: 400;\"> and update things accordingly, most of the themes and plug-ins are not yet ready for the upcoming release of PHP 7.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Since WordPress has started fixing every possible issue related to PHP 7, more and more people are now taking necessary steps toward making their themes and plug-ins compatible to PHP 7. For instance, the author of Simple Social Icons has already <\/span><a href=\"https:\/\/wordpress.org\/plugins\/simple-social-icons\/changelog\"><span style=\"font-weight: 400;\">updated the plug-in<\/span><\/a><span style=\"font-weight: 400;\"> to make it PHP 7compatible. That means, soon after PHP 7 official release, not only WordPress would fully support PHP 7 but also all themes and plug-ins would have been updated to work with version 7. In a nutshell, consider upgrading your site to PHP 7 only when you found everything \u2013 hosting server, themes, plug-ins and WordPress \u2013 compatible to version 7.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Crucial Things to Consider When Migrating from PHP 5 to PHP 7<\/span><\/p>\n<p><span style=\"font-weight: 400;\">So if you\u2019ve decided to move your WordPress site from PHP 5 to PHP 7 right after the official release of version 7, here are some best practices that you should follow to prevent any issues before, during and after migration:<\/span><\/p>\n<p><strong>Watch for Notifications:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Before implementing any PHP update, most of the hosting providers send a notification to site owners. The purpose of this notification is to make you inform about the update so that you could keep a look out to see if something goes wrong. So continuously watch for notifications and inform your hosting provider immediately if you found anything wrong.<\/span><\/p>\n<p><strong>Backup Your WordPress Site:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Even if you\u2019re fully confident that the PHP update will not break your website, it\u2019s always good to have a fallback plan. Whether or not you receive the notification from your hosting provider, always have a saved copy of your site on multiple locations. This will save you from any unforeseen disaster that may occur during migration.<\/span><\/p>\n<p><strong>Keep Everything Updated before Migration:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">Before moving to PHP 7 from PHP 5, update all elements &#8211; including themes, plugins and WordPress itself &#8211; related to your WordPress site. This will prevent these (and other) elements from stop working after PHP gets updated. Also, if a certain element is not compatible with the new version of the language, it\u2019ll no longer function.<\/span><\/p>\n<p><strong>Contact Your Hosting Provider:<\/strong><\/p>\n<p><span style=\"font-weight: 400;\">For further help, you may consider contacting your web host\u2019s support team. In case, your web host is unable to completely resolve your issues, then install a new copy of WordPress and restore your site from a backup.<\/span><\/p>\n<p><strong>Author Bio<\/strong><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Ajeet is a senior web developer at WordPress Integration &#8211; <\/span><a href=\"http:\/\/www.wordpressintegration.com\/\"><span style=\"font-weight: 400;\">PSD to WordPress service provider<\/span><\/a><span style=\"font-weight: 400;\">, where he is responsible for writing custom JavaScript code during the conversion process. In his spare time, he writes on different topics related to WordPress, JavaScript and Web Design to share his work experience with others. You can follow <\/span><a href=\"https:\/\/www.facebook.com\/wordpressintegration.official\/\"><span style=\"font-weight: 400;\">WordPressIntegration on Facebook<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP 7, a major update to the server-side web development language PHP, is right around the corner. According to PHP 7 project timetable mentioned on PHP.net wiki, if everything goes as planned, its final version will be released on Nov 12, 2015. Meanwhile, you as a future user may consider playing around with the latest [&hellip;]<\/p>\n","protected":false},"author":1814,"featured_media":32640,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[476,489,532],"tags":[52],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webdesignledger.com\/wp-json\/wp\/v2\/posts\/32635"}],"collection":[{"href":"https:\/\/webdesignledger.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webdesignledger.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webdesignledger.com\/wp-json\/wp\/v2\/users\/1814"}],"replies":[{"embeddable":true,"href":"https:\/\/webdesignledger.com\/wp-json\/wp\/v2\/comments?post=32635"}],"version-history":[{"count":0,"href":"https:\/\/webdesignledger.com\/wp-json\/wp\/v2\/posts\/32635\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webdesignledger.com\/wp-json\/wp\/v2\/media\/32640"}],"wp:attachment":[{"href":"https:\/\/webdesignledger.com\/wp-json\/wp\/v2\/media?parent=32635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webdesignledger.com\/wp-json\/wp\/v2\/categories?post=32635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webdesignledger.com\/wp-json\/wp\/v2\/tags?post=32635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}