{"id":34859,"date":"2022-10-13T07:00:48","date_gmt":"2022-10-13T14:00:48","guid":{"rendered":"https:\/\/dhblog.dream.press\/blog\/?p=34859"},"modified":"2025-05-21T20:58:12","modified_gmt":"2025-05-22T03:58:12","slug":"php-8-2","status":"publish","type":"post","link":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/","title":{"rendered":"PHP 8.2: What to Expect (Developer\u2019s Guide &#8211; Updated)"},"content":{"rendered":"\n<p>PHP 8.2 is expected to release in November this year, with the most recent stable version being PHP 8.1.5. While it\u2019s still early in the process, there has been some mixed reception around PHP 8.2 and WordPress core, plugin, and theme compatibility.<\/p>\n\n\n\n<p>However, knowing what to expect can help you <a href=\"https:\/\/www.dreamhost.com\/blog\/update-php\/\" target=\"blank&quot;\" rel=\"noopener\">prepare for the latest PHP version<\/a>. By learning about the new features and the ones being deprecated, you can understand how the update may affect development. This knowledge can also help you get ready for the eventual release.<\/p>\n\n\n\n<p>In this post, we\u2019ll recap the most recent PHP versions. Then we\u2019ll cover what\u2019s new in PHP 8.2 and discuss the release schedule. Let\u2019s jump in!<\/p>\n\n\n\n<h2 id=\"h-an-overview-of-php-versions\" class=\"wp-block-heading\"><b>An Overview of PHP Versions<\/b><\/h2>\n\n\n\n<p><a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/214202188-PHP-overview\" target=\"blank&quot;\" rel=\"noopener\">PHP<\/a> is the primary programming language of WordPress. It plays a vital role in converting data from your database into HTML web pages for your site\u2019s visitors.<\/p>\n\n\n\n<p>As a website owner or developer, you\u2019re likely already familiar with the importance of keeping your WordPress core, themes, and plugins updated. However, it\u2019s also critical to keep your PHP up to date.<\/p>\n\n\n\n<p><style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }<\/style><\/p>\n\n\n\n<div class=\"embed-container\"><iframe data-src=\"https:\/\/www.youtube.com\/embed\/G_O-mxZAk-g\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" data-load-mode=\"1\"><\/iframe><\/div>\n\n\n\n<p>Currently, WordPress recommends using at least <a href=\"https:\/\/wordpress.org\/about\/requirements\/\" target=\"blank&quot;\" rel=\"noopener\">PHP 7.4<\/a>. Older versions of PHP no longer receive active support for security updates and bug fixes. Therefore, upgrading to the latest <i>stable<\/i> version of PHP can result in better site security, enhanced performance, and higher levels of support (we emphasize <i>stable<\/i> because a segment of WordPress\u2019s 60,000+ plugins aren\u2019t fully PHP 8.0 compatible just yet, so it\u2019s a good idea to approach these updates with some caution).<\/p>\n\n\n\n<p>PHP 7.4 introduced typed properties, an underscore numeric separator, and various improvements. Since then, there have been a couple more <a href=\"https:\/\/php.watch\/versions\" target=\"blank&quot;\" rel=\"noopener\">iterations of PHP<\/a> released.<\/p>\n\n\n\n<p>PHP 8.0, released in November 2020, brought a handful of essential features. In addition to syntax and performance enhancements, the release included:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Named parameters<\/li>\n\n\n\n<li>Match syntax<\/li>\n\n\n\n<li>Union types<\/li>\n\n\n\n<li>Constructor Property Promotion<\/li>\n\n\n\n<li>JIT (which affects how PHP executes source code)<\/li>\n<\/ul>\n\n\n\n<p>A year later came PHP 8.1, the latest major PHP version. This update includes significant features, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Intersection types<\/li>\n\n\n\n<li>Readonly properties<\/li>\n\n\n\n<li>Enums<\/li>\n\n\n\n<li>Fibers<\/li>\n\n\n\n<li>Never return type<\/li>\n<\/ul>\n\n\n\n<p>Staying on top of the latest versions of PHP can help boost the performance and security of your website. However, it\u2019s important to know which changes to expect before upgrading. If you\u2019re interested in testing the current state of PHP 8.2, you can do so via <a href=\"https:\/\/github.com\/devilbox\/docker-php-fpm-8.2\" target=\"blank&quot;\" rel=\"noopener\">GitHub<\/a>.<\/p>\n\n\n\n<h2 id=\"h-what-s-new-in-php-8-2\" class=\"wp-block-heading\"><b>What\u2019s New in PHP 8.2<\/b><\/h2>\n\n\n\n<p>PHP 8.2 is expected to be released by the end of 2022. Here is the <a href=\"https:\/\/wiki.php.net\/todo\/php82\" target=\"blank&quot;\" rel=\"noopener\">current release schedule<\/a>, with General Availability (GA) programmed for November 24, 2022:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>June 9: Alpha 1<\/li>\n\n\n\n<li>June 23: Alpha 2<\/li>\n\n\n\n<li>July 7: Alpha 3<\/li>\n\n\n\n<li>July 19: Feature freeze<\/li>\n\n\n\n<li>July 21: Beta 1<\/li>\n\n\n\n<li>August 4: Beta 2<\/li>\n\n\n\n<li>August 18: Beta 3<\/li>\n\n\n\n<li>September 1: Release candidate 1<\/li>\n\n\n\n<li>September 15: Release candidate 2<\/li>\n\n\n\n<li>September 29: Release candidate 3<\/li>\n\n\n\n<li>October 13: Release candidate 4<\/li>\n\n\n\n<li>October 27: Release candidate 5<\/li>\n\n\n\n<li>November 10: Release candidate 6<\/li>\n\n\n\n<li>November 24: GA<\/li>\n<\/ul>\n\n\n\n<p>According to the official documentation on the <a href=\"https:\/\/php.watch\/versions\/8.2\" target=\"_blank\" rel=\"noopener\">PHP website<\/a>, there should be a handful of new features and deprecated functions. Let\u2019s take a look at some of them!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-disjunctive-normal-form-dnf-types\"><b>Disjunctive Normal Form (DNF) Types<\/b><\/h3>\n\n\n\n<p>PHP 8.2 will <a href=\"https:\/\/wiki.php.net\/rfc\/dnf_types\" target=\"blank&quot;\" rel=\"noopener\">introduce<\/a> a new <a href=\"https:\/\/en.wikipedia.org\/wiki\/Disjunctive_normal_form\" target=\"blank&quot;\" rel=\"noopener\">Disjunctive Normal Form (DNF)<\/a> types feature. DNF is a standardized way of organizing boolean expressions \u2014 specifically, into an ORed series of ANDs. When DNF is applied to type declarations, it enables a standard way to write combined Union and Intersection types that the parser can handle.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-new-mysqli-execute-query-function-and-mysqli-execute-query-method\"><b>New mysqli_execute_query Function and mysqli::execute_query Method<\/b><\/h3>\n\n\n\n<p><a href=\"https:\/\/wiki.php.net\/rfc\/mysqli_execute_query\" target=\"blank&quot;\" rel=\"noopener\">Running parameterized MySQLi queries<\/a> will be easier in PHP 8.2, thanks to the new <span style=\"font-family: 'courier new', courier, monospace;\">mysqli_execute_query($sql, $params)<\/span> function and <span style=\"font-family: 'courier new', courier, monospace;\">mysqli::execute_query<\/span> method.<\/p>\n\n\n\n<p>This will further reduce the complexity of using parameterised queries, which will then make it easier for developers to move away from <span style=\"font-family: 'courier new', courier, monospace;\">mysqli_query()<\/span> as well as dangerous\/risky escaping of user values.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-fetch-enum-properties-in-const-expressions\"><b>Fetch enum Properties in const Expressions<\/b><\/h3>\n\n\n\n<p><a href=\"https:\/\/wiki.php.net\/rfc\/fetch_property_in_const_expressions\" target=\"blank&quot;\" rel=\"noopener\">According to the RFC<\/a>, \u201cThis RFC proposes to allow the use of <span style=\"font-family: 'courier new', courier, monospace;\">-&gt;\/?-&gt;<\/span> to fetch properties of enums in constant expressions. The primary motivation for this change is to allow fetching the name and value properties in places where enum objects aren&#8217;t allowed, like array keys.\u201d<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-new-random-extension\"><b>New Random Extension<\/b><\/h3>\n\n\n\n<p>PHP 8.2 introduces a new PHP extension named <span style=\"font-family: 'courier new', courier, monospace;\">random<\/span>. It organizes and consolidates existing PHP functionality related to random-number generation. It also introduces a series of PHP class structure and exception classes to provide granular options for random-number generators and exception handling.<\/p>\n\n\n\n<p>The random extension is bundled with PHP, and there is no compile-time or run-time configuration option to disable the <span style=\"font-family: 'courier new', courier, monospace;\">random<\/span> extension. The <span style=\"font-family: 'courier new', courier, monospace;\">random<\/span> extension will be always available in PHP 8.2 and later.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-new-curl-upkeep-function\"><b>New curl_upkeep Function<\/b><\/h3>\n\n\n\n<p>PHP 8.2 adds <a href=\"https:\/\/php.watch\/versions\/8.2\/curl_upkeep\" target=\"blank&quot;\" rel=\"noopener\">a new function<\/a> to the Curl extension called <span style=\"font-family: 'courier new', courier, monospace;\">curl_upkeep<\/span>. The curl_upkeep function calls <span style=\"font-family: 'courier new', courier, monospace;\">curl_easy_upkeep()<\/span> in libcurl, which is the underlying C library that PHP Curl extension uses.<\/p>\n\n\n\n<p>The <span style=\"font-family: 'courier new', courier, monospace;\">curl_upkeep()<\/span> function does the work that keeps a Curl connection alive. But not every connection type that Curl integrates supports connection upkeep. Currently, only HTTP\/2 connections support it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-new-ini-parse-quantity-function\"><b>New ini_parse_quantity function<\/b><\/h3>\n\n\n\n<p><a href=\"https:\/\/php.watch\/versions\/8.2\/ini_parse_quantity\" target=\"blank&quot;\" rel=\"noopener\"><span style=\"font-family: 'courier new', courier, monospace;\">ini_parse_quantity<\/span><\/a> is a new function that will be added to PHP in PHP 8.2. It parses any data size recognized by PHP INI values (such as 56K, 256M, or 1G), then returns the data size in bytes. It can be useful when parsing existing or provided INI values in a PHP application. However, it doesn\u2019t recognize IEC suffixes for data sizes like MB, MiB, or GB, and it isn\u2019t suitable to convert standard data size values to bytes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-new-memory-reset-peak-usage-function\"><b>New memory_reset_peak_usage Function<\/b><\/h3>\n\n\n\n<p>PHP 8.2 will include a new function called <a href=\"https:\/\/php.watch\/versions\/8.2\/memory_reset_peak_usage\" target=\"blank&quot;\" rel=\"noopener\"><span style=\"font-family: 'courier new', courier, monospace;\">memory_reset_peak_usage<\/span><\/a>. It will reset the peak memory usage returned by the <span style=\"font-family: 'courier new', courier, monospace;\">memory_get_peak_usage<\/span> function.<\/p>\n\n\n\n<p>This function will be helpful for cases that involve invoking an action several times and recording the peak memory usage of each iteration. Developers will be able to use this new feature to reset the peak memory usage at any given point during the lifetime of the request.<\/p>\n\n\n\n<div class=\"article-newsletter article-newsletter--gradient\">\n\n\n<h2>Get Content Delivered Straight to Your Inbox<\/h2><p>Subscribe now to receive all the latest updates, delivered directly to your inbox.<\/p><form class=\"nwsl-form\" id=\"newsletter_block_\" novalidate><div class=\"messages\"><\/div><div class=\"form-group\"><label for=\"input_newsletter_block_\"><input type=\"email\"name=\"email\"id=\"input_newsletter_block_\"placeholder=\"Enter your email address\"novalidatedisabled=\"disabled\"\/><\/label><button type=\"submit\"class=\"btn btn--brand\"disabled=\"disabled\"><span>Sign Me Up!<\/span><svg width=\"21\" height=\"14\" viewBox=\"0 0 21 14\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M13.8523 0.42524L12.9323 1.34521C12.7095 1.56801 12.7132 1.9304 12.9404 2.14865L16.7241 5.7823H0.5625C0.251859 5.7823 0 6.03416 0 6.3448V7.6573C0 7.96794 0.251859 8.2198 0.5625 8.2198H16.7241L12.9405 11.8535C12.7132 12.0717 12.7095 12.4341 12.9323 12.6569L13.8523 13.5769C14.072 13.7965 14.4281 13.7965 14.6478 13.5769L20.8259 7.39879C21.0456 7.17913 21.0456 6.82298 20.8259 6.60327L14.6477 0.42524C14.4281 0.205584 14.0719 0.205584 13.8523 0.42524Z\" fill=\"white\"\/>\n<\/svg>\n<\/button><\/div><\/form><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-readonly-classes\"><b>Readonly Classes<\/b><\/h3>\n\n\n\n<p>Introduced in PHP 8.1, readonly properties will be expanded in PHP 8.2 to add syntactic sugar so that all class properties are readonly at once:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">readonly class Post\n{\npublic function __construct(\npublic string $title,\npublic Author $author,\npublic string $body,\npublic DateTime $publishedAt,\n) {}\n}<\/pre>\n\n\n\n<p>This will prevent dynamic properties from being added to classes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-null-true-and-false-standalone-types\"><b>Null, True, and False Standalone Types<\/b><\/h3>\n\n\n\n<p>In PHP 8.2, the return type of false will be available as a standalone type rather than strictly a union type for when an error occurs, which is already possible:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">function alwaysFalse(): false\n{\nreturn false;\n}<\/pre>\n\n\n\n<p>The same is true for the null type. For example, as a standalone type, unlike before, NullPost::getAuthor()will be able to only return null.<\/p>\n\n\n\n<p>PHP 8.2 also <a href=\"https:\/\/php.watch\/versions\/8.2\/true-type\" target=\"blank&quot;\" rel=\"noopener\">allows true<\/a> as a standalone type.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-deprecate-dynamic-properties\"><b>Deprecate Dynamic Properties<\/b><\/h3>\n\n\n\n<p><a href=\"https:\/\/php.watch\/versions\/8.2\/dynamic-properties-deprecated\" target=\"blank&quot;\" rel=\"noopener\">Dynamic properties<\/a> will be deprecated in PHP 8.2, resulting in an ErrorException by PHP 9.0. These properties are set on an object:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">class Post\n{\npublic string $title;\n}\n\n\/\/ \u2026\n\n$post-&gt;name = 'Name';<\/pre>\n\n\n\n<p>Dynamic properties allow flexibility when creating classes (e.g., value objects) without a strict class declaration. Their deprecation will likely be an issue for developers who rely on dynamic properties because it will push them more toward static analysis. For this reason, some developers are apprehensive about this change with PHP 8.2.<\/p>\n\n\n\n<p>However, classes using __get and __set will still support dynamic properties, as will objects of stdClass.<\/p>\n\n\n\n<p>Alternatively, developers can use the new <a href=\"https:\/\/php.watch\/versions\/8.2\/AllowDynamicProperties\" target=\"blank&quot;\" rel=\"noopener\">#[AllowDynamicProperties]attribute<\/a>, declared in the global namespace, on classes to those properties:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#[AllowDynamicProperties]\nclass User() {}\n$user = new User();\n$user-&gt;foo = 'bar';<\/pre>\n\n\n\n<p>While it\u2019s not recommended, another option is to disable deprecation warnings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-new-n-modifier\"><b>New \/n Modifier<\/b><\/h3>\n\n\n\n<p>PHP 8.2 will include support for the <a href=\"https:\/\/php.watch\/versions\/8.2\/preg-n-no-capture-modifier\" target=\"blank&quot;\" rel=\"noopener\">\/n (no capture) modifier<\/a> to the preg_* function family. When used, any groups with()meta-characters won\u2019t capture apart from captured groups that are named. Essentially, the result is the same as marking each group as non-capturing.<\/p>\n\n\n\n<p>The reasoning behind this change is that the modifier simplifies complex regular expressions for multiple groups. Rather than marketing every group as non-capturing, developers can mark all groups as non-capturing. Then, they can select and name specific groups that need to capture.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-redact-parameters-in-back-traces\"><b>Redact Parameters in Back Traces<\/b><\/h3>\n\n\n\n<p>Many developers use services that track stack traces and production errors from codebases. These services can notify users if and when something goes wrong. For instance, tracing call stacks is helpful when debugging an application.<\/p>\n\n\n\n<p>However, sometimes stack traces can have sensitive information, such as usernames and passwords. PHP 8.2 will include a <a href=\"https:\/\/php.watch\/versions\/8.2\/backtrace-parameter-redaction\" target=\"blank&quot;\" rel=\"noopener\">#[SensitiveParameter] attribute<\/a> that will prevent this information from being included in stack traces when things go wrong:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">function test(\n$foo,\n#[SensitiveParameter] $bar,\n$baz\n) {\nthrow new Exception('Error');\n}\n\ntest('foo', 'bar', 'baz');<\/pre>\n\n\n\n<p>PHP 8.2 will use the sensitive parameters to redact private information from stack traces, making them more secure. These parameters ensure that the data won\u2019t end up in error logs. Note that this attribute will only be available to use on parameters.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-deprecate-string-interpolation\"><b>Deprecate ${} String Interpolation<\/b><\/h3>\n\n\n\n<p>There are multiple ways to embed variables in strings with PHP. However, PHP 8.2 will deprecate two methods. The first is using ${} in strings:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\"Hello ${world}\";<\/pre>\n\n\n\n<p>The second is using ${} (variable variables):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\"Hello ${(world)}\";<\/pre>\n\n\n\n<p>This likely won\u2019t be a significant issue for developers as the two most popular string interpolation methods will still work.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-deprecate-partially-supported-callables\"><b>Deprecate Partially Supported Callables<\/b><\/h3>\n\n\n\n<p>Another deprecated change will be with <a href=\"https:\/\/php.watch\/versions\/8.2\/partially-supported-callable-deprecation\" target=\"blank&quot;\" rel=\"noopener\">partially supported callables<\/a>. There are multiple ways to create a callable in PHP. It can be called either with or without parameters with the $callable() syntax, the user_call_func(\/a_array), or using a function with a callback.<\/p>\n\n\n\n<p>The deprecated callable patterns include the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$callable = \"self::method\";\n$callable = \"parent::method\";\n$callable = \"static::method\";\n$callable = [\"self\", \"method\"];\n$callable = [\"parent\", \"method\"];\n$callable = [\"static\", \"method\"];\n$callable = [\"MyClass\", \"MyParentClass::myMethod\"];\n$callable = [new MyClass(), \"MyOtherClass::myMethod\"];<\/pre>\n\n\n\n<p>Starting from PHP 8.2, calling any of the above will result in the following deprecation notice:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">class Test {\npublic static function myMethod(): void {\necho \"Called\";\n}<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">public static function call(): void {\n$callable = 'self::myMethod';\ncall_user_func($callable);\n}\n}<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">$callable = Test::call();\n\/\/ \"Called\";<\/pre>\n\n\n\n<p>However, passing these callables to the <span style=\"font-family: 'courier new', courier, monospace;\">is_callable<\/span> function or using them with the callable parameter types won\u2019t generate the deprecation message. To prevent the deprecation notice, developers can instead convert parent, self, and static keywords in callable code to their respective class names using the::class magic method.<\/p>\n\n\n\n<p>Part of the reason behind the change is to allow callables to be used for typed properties. It makes them less context-dependent.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-mysqli-can-no-longer-be-compiled-with-libmysql\"><b>MySQLi Can No Longer Be Compiled With libmysql<\/b><\/h3>\n\n\n\n<p>In the past, PHP has supported two libraries for connecting MySQL databases: mysqlnd and libmysql. As of PHP 5.4, the former has been the default library. However, it\u2019s been possible to compile MySQLi through extensions.<\/p>\n\n\n\n<p>Beginning with PHP 8.2, compiling a MySQLi extension with <a href=\"https:\/\/php.watch\/versions\/8.2\/mysqli-libmysql-no-longer-supported\" target=\"blank&quot;\" rel=\"noopener\">libmysql won\u2019t be supported<\/a>. Attempting to do so will result in a configuration error:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/configure --with-mysqli=FOO<\/pre>\n\n\n\n<p>Linking mysqli against external library is no longer supported<\/p>\n\n\n\n<p>This won\u2019t likely cause any significant errors for developers. However, the two biggest features supported by libmysql that aren\u2019t available with mysqlnd are supported for automatic reconnecting and authentication through LDAP and SASL.<\/p>\n\n\n\n<h2 id=\"h-keep-your-wordpress-php-version-up-to-date\" class=\"wp-block-heading\"><b>Keep Your WordPress PHP Version Up to Date<\/b><\/h2>\n\n\n\n<p>As a developer, it\u2019s essential to test your code against upcoming versions of PHP. In this case, developers should begin testing their code against PHP 8.2 as soon as possible to ensure your code doesn\u2019t break users\u2019 sites when they update.<\/p>\n\n\n\n\n\n<div\n\tclass=\"article-cta-shared article-cta-small\"\n>\n    <div class=\"tr-img-wrap-outer jsLoading\"><img decoding=\"async\" class=\"js-img-lazy \" src=\"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/lazy-loading-transparent.webp\" data-srcset=\"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/article-small-ad-cta-placeholder.webp 1x, https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/article-small-ad-cta-placeholder-x2.webp 2x\"  alt=\"Ad background image\" \/><\/div>\n\n\n\n\n  <div class=\"content-btm\">\n    <h2\n      class=\"h2--md\"\n    >\n      The Perfect Development Environment\n    <\/h2>\n    <p\n      class=\"p--md\"\n    >\n      We make sure your website is fast, secure and always up so your visitors trust you. Plans start at $1.99\/mo.\n    <\/p>\n\n            <a\n            href=\"https:\/\/www.dreamhost.com\/hosting\/\"\n                        class=\"btn btn--white-outline btn--sm btn--round\"\n                                    target=\"_blank\"\n            rel=\"noopener noreferrer\"\n            >\n                            Choose Your Plan                    <\/a>\n\n  <\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>PHP 8.2 is expected to release in November this year, with the most recent stable version being PHP 8.1.5. While it\u2019s still early in the process, there has been some mixed reception around PHP 8.2 and WordPress core, plugin, and theme compatibility. However, knowing what to expect can help you prepare for the latest PHP [&hellip;]<\/p>\n","protected":false},"author":1062,"featured_media":34862,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_yoast_wpseo_metadesc":"PHP 8.2 is expected to release in November this year. Learn more about previous versions, what's new with 8.2, and how you can prepare for the next release.","toc_headlines":"[[\"h-an-overview-of-php-versions\",\"<b>An Overview of PHP Versions<\/b>\"],[\"h-what-s-new-in-php-8-2\",\"<b>What\u2019s New in PHP 8.2<\/b>\"],[\"h-keep-your-wordpress-php-version-up-to-date\",\"<b>Keep Your WordPress PHP Version Up to Date<\/b>\"]]","hide_toc":false,"footnotes":""},"categories":[10025,12852],"tags":[],"class_list":["post-34859","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-talk","category-website-design"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.3 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>PHP 8.2: What to Expect - DreamHost<\/title>\n<meta name=\"description\" content=\"PHP 8.2 is expected to release in November this year. Learn more about previous versions, what&#039;s new with 8.2, and how you can prepare for the next release.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP 8.2: What to Expect (Developer\u2019s Guide - Updated)\" \/>\n<meta property=\"og:description\" content=\"PHP 8.2 is expected to release in November this year. Learn more about previous versions, what&#039;s new with 8.2, and how you can prepare for the next release.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/\" \/>\n<meta property=\"og:site_name\" content=\"DreamHost Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DreamHost\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-13T14:00:48+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-22T03:58:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/06\/Latest-PHP-Update-Social.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jason Cosper\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/06\/Latest-PHP-Update-Social.jpeg\" \/>\n<meta name=\"twitter:creator\" content=\"@dreamhost\" \/>\n<meta name=\"twitter:site\" content=\"@dreamhost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jason Cosper\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"PHP 8.2: What to Expect - DreamHost","description":"PHP 8.2 is expected to release in November this year. Learn more about previous versions, what's new with 8.2, and how you can prepare for the next release.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/","og_locale":"en_US","og_type":"article","og_title":"PHP 8.2: What to Expect (Developer\u2019s Guide - Updated)","og_description":"PHP 8.2 is expected to release in November this year. Learn more about previous versions, what's new with 8.2, and how you can prepare for the next release.","og_url":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/","og_site_name":"DreamHost Blog","article_publisher":"https:\/\/www.facebook.com\/DreamHost\/","article_published_time":"2022-10-13T14:00:48+00:00","article_modified_time":"2025-05-22T03:58:12+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/06\/Latest-PHP-Update-Social.jpeg","type":"image\/jpeg"}],"author":"Jason Cosper","twitter_card":"summary_large_image","twitter_image":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/06\/Latest-PHP-Update-Social.jpeg","twitter_creator":"@dreamhost","twitter_site":"@dreamhost","twitter_misc":{"Written by":"Jason Cosper","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/#article","isPartOf":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/"},"author":{"name":"Jason Cosper","@id":"https:\/\/www-dev.dreamhost.com\/blog\/#\/schema\/person\/2273b8bf7336df78f6d99a89c17253c4"},"headline":"PHP 8.2: What to Expect (Developer\u2019s Guide &#8211; Updated)","datePublished":"2022-10-13T14:00:48+00:00","dateModified":"2025-05-22T03:58:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/"},"wordCount":1763,"publisher":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/#organization"},"image":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/06\/Latest-PHP-Update-Feature.jpeg","articleSection":["Tech Talk","Website Design"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/","url":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/","name":"PHP 8.2: What to Expect - DreamHost","isPartOf":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/#primaryimage"},"image":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/#primaryimage"},"thumbnailUrl":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/06\/Latest-PHP-Update-Feature.jpeg","datePublished":"2022-10-13T14:00:48+00:00","dateModified":"2025-05-22T03:58:12+00:00","description":"PHP 8.2 is expected to release in November this year. Learn more about previous versions, what's new with 8.2, and how you can prepare for the next release.","breadcrumb":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/#primaryimage","url":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/06\/Latest-PHP-Update-Feature.jpeg","contentUrl":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/06\/Latest-PHP-Update-Feature.jpeg","width":900,"height":598,"caption":"what to expect with PHP 8.2"},{"@type":"BreadcrumbList","@id":"https:\/\/www-dev.dreamhost.com\/blog\/php-8-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dhblog.dream.press\/blog\/"},{"@type":"ListItem","position":2,"name":"PHP 8.2: What to Expect (Developer\u2019s Guide &#8211; Updated)"}]},{"@type":"WebSite","@id":"https:\/\/www-dev.dreamhost.com\/blog\/#website","url":"https:\/\/www-dev.dreamhost.com\/blog\/","name":"DreamHost Blog","description":"","publisher":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www-dev.dreamhost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www-dev.dreamhost.com\/blog\/#organization","name":"DreamHost","url":"https:\/\/www-dev.dreamhost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www-dev.dreamhost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/dhblog.dream.press\/blog\/wp-content\/uploads\/2019\/01\/dh_logo-blue-2.png","contentUrl":"https:\/\/dhblog.dream.press\/blog\/wp-content\/uploads\/2019\/01\/dh_logo-blue-2.png","width":1200,"height":168,"caption":"DreamHost"},"image":{"@id":"https:\/\/www-dev.dreamhost.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DreamHost\/","https:\/\/x.com\/dreamhost","https:\/\/www.instagram.com\/dreamhost\/","https:\/\/www.linkedin.com\/company\/dreamhost\/","https:\/\/www.youtube.com\/user\/dreamhostusa"]},{"@type":"Person","@id":"https:\/\/www-dev.dreamhost.com\/blog\/#\/schema\/person\/2273b8bf7336df78f6d99a89c17253c4","name":"Jason Cosper","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","url":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","contentUrl":"https:\/\/www-dev.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","caption":"Jason Cosper"},"description":"Jason is DreamHost\u2019s WordPress Product Advocate, based out of Bakersfield, CA. He is currently working on making our DreamPress product even better. In his free time, he likes to curl up on the couch and watch scary movies with his wife Sarah and three very small dogs. Follow him on Twitter.","url":"https:\/\/www-dev.dreamhost.com\/blog\/author\/jasoncosper\/"}]}},"lang":"en","translations":{"en":34859,"es":34876,"de":50851,"pt":51398,"pl":51402,"ru":51405,"uk":51416,"it":68537,"fr":70669,"nl":70695},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/34859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/users\/1062"}],"replies":[{"embeddable":true,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/comments?post=34859"}],"version-history":[{"count":10,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/34859\/revisions"}],"predecessor-version":[{"id":61508,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/34859\/revisions\/61508"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/media\/34862"}],"wp:attachment":[{"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/media?parent=34859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/categories?post=34859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www-dev.dreamhost.com\/blog\/wp-json\/wp\/v2\/tags?post=34859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}