{"id":89308,"date":"2019-07-26T14:37:44","date_gmt":"2019-07-26T19:37:44","guid":{"rendered":"https:\/\/wpengine.com\/?p=89308"},"modified":"2021-11-12T09:43:39","modified_gmt":"2021-11-12T15:43:39","slug":"a-first-look-at-php-7-4","status":"publish","type":"post","link":"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/","title":{"rendered":"A First Look at PHP 7.4"},"content":{"rendered":"\n<p>PHP, or Hypertext Preprocessor, is the scripting language widely used to develop WordPress themes and plugins. Using the most recent version of PHP is the quickest way to improve the performance of your site. <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/wpengine.com\/blog\/ready-to-speed-up-php-7-3-is-here\/\" target=\"_blank\">PHP 7.3<\/a>, which was released in April, introduced improvements in security and performance. WP Engine customers who moved from PHP 7.2 to PHP 7.3&nbsp; have seen <em>up to <\/em>a 15% decrease in request processing time. This mirrors<a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.phoronix.com\/scan.php?page=news_item&amp;px=PHP-7.3-Performance-Benchmarks\" target=\"_blank\"> official PHP benchmarks<\/a> that show PHP 7.3 is 10% faster than PHP 7.2<strong>.&nbsp;<\/strong><\/p>\n\n\n\n<p>Unfortunately, the majority of WordPress users aren\u2019t using the most recent version of PHP. In fact, more than half of WordPress users are using PHP version 7.0 or earlier. At WP Engine, we recognize that dampens the incentive for WordPress developers to utilize the latest version of PHP-doing so would alienate half the market. Additionally, earlier versions of PHP are often in the end-of-life stage without active support; software that isn\u2019t actively maintained is risky to use. If the majority of WordPress was in the practice of updating PHP versions, it would benefit the CMS as a whole. A<a href=\"https:\/\/make.wordpress.org\/core\/2019\/07\/29\/proposal-for-increasing-recommended-php-version-in-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" recent WordPress core proposal  (opens in a new tab)\"> recent WordPress core proposal <\/a>suggests increasing the recommended PHP version.  That\u2019s why WP Engine is committed to offering the latest version of PHP. Doing so allows our customers to take advantage of the best performance and security that WordPress has to offer.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"768\" src=\"https:\/\/wpengine.com\/wp-content\/uploads\/2019\/07\/PHP-Versions--1024x768.jpg\" alt=\"\" class=\"wp-image-89309\" srcset=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2019\/07\/PHP-Versions-.jpg 1024w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2019\/07\/PHP-Versions--300x225.jpg 300w, https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2019\/07\/PHP-Versions--768x576.jpg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The latest version of PHP, PHP 7.4, is tentatively scheduled to be released on <strong>November 28th, 2019<\/strong>. PHP 7.4, which is currently in feature-freeze beta, brings important improvements to performance as well as enhancements to code readability, comprehensibility, and maintainability. Keep reading for more information on what we at WP Engine have deemed most relevant to our customers in PHP 7.4:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Bringing More User-Friendly Code into PH<\/strong>P<\/h2>\n\n\n\n<p>The shift from PHP 7.2 to 7.3 was all about performance and syntax. PHP 7.4, on the other hand, aims to bring more improvements to the usability, readability, and maintainability of code; this will ultimately make PHP less redundant, faster, and more reliable. Here are some RFCs (Request for Comments) scheduled for release in 7.4 that should help improve the experience of working with PHP:&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/wiki.php.net\/rfc\/arrow_functions_v2\" target=\"_blank\">Arrow Functions<\/a><\/strong>: Short functions, also called arrow functions, allow developers to write shorter functions in PHP. Short functions have only one expression, which is also the return statement. Because of this, arrow functions are most suitable for one-line closure statements. These functions help improve the volubility of code.&nbsp;<\/li><li><strong><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/wiki.php.net\/rfc\/typed_properties_v2\" target=\"_blank\">Typed Class Declaration<\/a>: <\/strong>Another feature that is being added to PHP 7.4 is typed class properties. Users can opt-in and this addition is non-breaking to older versions of PHP. Types classes will only work in classes and they need an access modifier.&nbsp;<\/li><li><strong><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/wiki.php.net\/rfc\/null_coalesce_equal_operator\" target=\"_blank\">Null Coalescing Assignment Operator<\/a><\/strong>: The null coalescing assignment operator, a shorthand for null coalescing operations, helps eliminate code redundancy for certain operators.&nbsp;&nbsp;<\/li><li><strong><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/wiki.php.net\/rfc\/weakrefs\" target=\"_blank\">Support for Weak References<\/a><\/strong>: Weak References allow the programmer to retain a reference to an object which does not prevent the object from being destroyed. This empowers developers to create cache like structures. Direct support for weak refs will be introduced in 7.4.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Deprecations<\/strong><\/h2>\n\n\n\n<p>Deprecations are a notice to developers that certain functionality will be removed in the future. These are important to note ahead of the November 28th release date.&nbsp;<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/wiki.php.net\/rfc\/deprecate_php_short_tags\" target=\"_blank\">Short Open Tags<\/a><\/strong><\/li><li><strong><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/wiki.php.net\/rfc\/ternary_associativity\" target=\"_blank\">Left-Associative Ternary Operator Deprecation<\/a>: <\/strong>This will add a deprecation warning for ternary statements.&nbsp;<\/li><li><strong><a href=\"https:\/\/wiki.php.net\/rfc\/deprecate_curly_braces_array_access\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Curly Brackets for Array and String Access<\/a><\/strong><\/li><\/ul>\n\n\n\n<p>Be sure to check the RFC page for a <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/wiki.php.net\/rfc\/deprecations_php_7_4\" target=\"_blank\">full list of deprecations<\/a>.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Performance Enhancements&nbsp;<\/strong><\/h2>\n\n\n\n<p>The real incentive for upgrading your PHP version is the promise of a performance boost. PHP 7.4 will deliver on that. PHP 7.4 will introduce <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/wiki.php.net\/rfc\/preload\" target=\"_blank\">preloading<\/a> to PHP core. This is essentially done via an extension to <a href=\"https:\/\/www.php.net\/manual\/en\/book.opcache.php\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Opcache<\/a>, the software that stores precompiled script bytecode in shared memory. This helps eliminate the need for loading scripts on every request.&nbsp;<\/p>\n\n\n\n<p>Opcache works by using opcodes, simplified versions of your code. Preloading works by compiling source files to opcodes, compiling like things together, and keeping the compiled code in memory. This code will be much easier and faster for PHP to pull than the alternative: files loaded and linked on every request. This will result in huge performance gains and is the most compelling reason to update to 7.4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Looking Ahead&nbsp;<\/strong><\/h2>\n\n\n\n<p>PHP 7.4 promises to offer a few improvements and we expect to see a small performance boost. We predict that PHP 8.0, which is already on the horizon, will be a much larger update. PHP 7.4 is not yet available, but when it is, WP Engine will work to offer PHP 7.4 to our customers in a timely matter. So that you can be running the fastest, most secure experience possible, we\u2019ve developed our <a href=\"https:\/\/wpengine.com\/support\/php-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">PHP Selector<\/a> and <a href=\"https:\/\/wpengine.com\/support\/php-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">PHP Test Drive<\/a>r. No other tools allow you to preview your site on a new PHP version, and then make the switch with a click of a button. These tools are easy to use and free on every <a aria-label=\" (opens in a new tab)\" rel=\"noreferrer noopener\" href=\"https:\/\/wpengine.com\/plans\/\" target=\"_blank\">WP Engine plan type<\/a>!\u00a0<\/p>\n\n\n\n<p>For more information on the experience of upgrading PHP versions with WP Engine, check out this <a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/wpengine.com\/blog\/a-conversation-with-coywolf-updating-to-php-7-3-with-wp-engine\/\" target=\"_blank\">customer testimonial<\/a>. Check <a href=\"https:\/\/wpengine.com\/blog\/ready-to-speed-up-php-7-3-is-here\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">this<\/a> out for more information on the current PHP version, PHP 7.3.&nbsp;<\/p>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PHP, or Hypertext Preprocessor, is the scripting language widely used to develop WordPress themes and plugins. Using the most recent version of PHP is the quickest way to improve the performance of your site. PHP 7.3, which was released in April, introduced improvements in security and performance. WP Engine customers who moved from PHP 7.2<span class=\"tile__ellipses\">&hellip;<\/span><span class=\"tile__ellipses--animated\"><\/span><\/p>\n","protected":false},"author":173,"featured_media":89311,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-89308","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>A First Look at PHP 7.4<\/title>\n<meta name=\"description\" content=\"PHP 7.4 is currently in feature-freeze beta and is set to be released on November 28th, 2019. Get prepared and take a first look at the update.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A First Look at PHP 7.4\" \/>\n<meta property=\"og:description\" content=\"PHP 7.4 is currently in feature-freeze beta and is set to be released on November 28th, 2019. Get prepared and take a first look at the update.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/\" \/>\n<meta property=\"og:site_name\" content=\"WP Engine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/wpengine\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-26T19:37:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-11-12T15:43:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2019\/07\/PHP-7.4_hero.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Alyssa Cuda\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@wpengine\" \/>\n<meta name=\"twitter:site\" content=\"@wpengine\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alyssa Cuda\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/\",\"url\":\"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/\",\"name\":\"A First Look at PHP 7.4\",\"isPartOf\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\"},\"datePublished\":\"2019-07-26T19:37:44+00:00\",\"dateModified\":\"2021-11-12T15:43:39+00:00\",\"author\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/2e7ae57f60120ddae3dc029b03cfa81a\"},\"description\":\"PHP 7.4 is currently in feature-freeze beta and is set to be released on November 28th, 2019. Get prepared and take a first look at the update.\",\"breadcrumb\":{\"@id\":\"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/wpengine.com\/case-studies\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A First Look at PHP 7.4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#website\",\"url\":\"https:\/\/wpengine.com\/case-studies\/\",\"name\":\"WP Engine\",\"description\":\"Managed Hosting for WordPress\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/2e7ae57f60120ddae3dc029b03cfa81a\",\"name\":\"Alyssa Cuda\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9031010d4260959c1fffb0b199ffa33db42a2b53baa3bf9927a289237e907252?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9031010d4260959c1fffb0b199ffa33db42a2b53baa3bf9927a289237e907252?s=96&d=mm&r=g\",\"caption\":\"Alyssa Cuda\"},\"description\":\"Alyssa is a Content Specialist at WP Engine. If she\u2019s not searching for a swimming hole to escape the heat in, you can usually find her baking something caloric or reading.\u2002\u2002\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"A First Look at PHP 7.4","description":"PHP 7.4 is currently in feature-freeze beta and is set to be released on November 28th, 2019. Get prepared and take a first look at the update.","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"A First Look at PHP 7.4","og_description":"PHP 7.4 is currently in feature-freeze beta and is set to be released on November 28th, 2019. Get prepared and take a first look at the update.","og_url":"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/","og_site_name":"WP Engine","article_publisher":"https:\/\/www.facebook.com\/wpengine","article_published_time":"2019-07-26T19:37:44+00:00","article_modified_time":"2021-11-12T15:43:39+00:00","og_image":[{"width":2400,"height":1260,"url":"https:\/\/wpengine.com\/case-studies\/wp-content\/uploads\/2019\/07\/PHP-7.4_hero.jpg","type":"image\/jpeg"}],"author":"Alyssa Cuda","twitter_card":"summary_large_image","twitter_creator":"@wpengine","twitter_site":"@wpengine","twitter_misc":{"Written by":"Alyssa Cuda","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/","url":"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/","name":"A First Look at PHP 7.4","isPartOf":{"@id":"https:\/\/wpengine.com\/case-studies\/#website"},"datePublished":"2019-07-26T19:37:44+00:00","dateModified":"2021-11-12T15:43:39+00:00","author":{"@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/2e7ae57f60120ddae3dc029b03cfa81a"},"description":"PHP 7.4 is currently in feature-freeze beta and is set to be released on November 28th, 2019. Get prepared and take a first look at the update.","breadcrumb":{"@id":"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/wpengine.com\/case-studies\/a-first-look-at-php-7-4\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/wpengine.com\/case-studies\/"},{"@type":"ListItem","position":2,"name":"A First Look at PHP 7.4"}]},{"@type":"WebSite","@id":"https:\/\/wpengine.com\/case-studies\/#website","url":"https:\/\/wpengine.com\/case-studies\/","name":"WP Engine","description":"Managed Hosting for WordPress","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/wpengine.com\/case-studies\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/2e7ae57f60120ddae3dc029b03cfa81a","name":"Alyssa Cuda","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/wpengine.com\/case-studies\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9031010d4260959c1fffb0b199ffa33db42a2b53baa3bf9927a289237e907252?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9031010d4260959c1fffb0b199ffa33db42a2b53baa3bf9927a289237e907252?s=96&d=mm&r=g","caption":"Alyssa Cuda"},"description":"Alyssa is a Content Specialist at WP Engine. If she\u2019s not searching for a swimming hole to escape the heat in, you can usually find her baking something caloric or reading.\u2002\u2002"}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/posts\/89308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/users\/173"}],"replies":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/comments?post=89308"}],"version-history":[{"count":0,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/posts\/89308\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media\/89311"}],"wp:attachment":[{"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/media?parent=89308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/categories?post=89308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpengine.com\/case-studies\/wp-json\/wp\/v2\/tags?post=89308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}